McpClientConfig
type McpClientConfig = RuntimeConfig & { transport?: McpTransport; url?: string | URL; auth?: McpClientCredentials; authProvider?: OAuthClientProvider; headers?: Record<string, string>; disableMcpInstrumentation?: boolean; tasksConfig?: TasksConfig; elicitationCallback?: ElicitationCallback; failOpen?: boolean; logHandler?: (params) => void;};Defined in: src/mcp.ts:78
Arguments for configuring an MCP Client.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description | Defined in |
|---|---|---|---|
transport? | McpTransport | Pre-constructed transport. Mutually exclusive with url. | src/mcp.ts:80 |
url? | string | URL | Server URL. When provided, a StreamableHTTP transport is constructed automatically. | src/mcp.ts:83 |
auth? | McpClientCredentials | Client credentials for OAuth machine-to-machine auth. Requires url. | src/mcp.ts:86 |
authProvider? | OAuthClientProvider | Custom OAuth provider for advanced auth flows. Requires url. Mutually exclusive with auth. | src/mcp.ts:89 |
headers? | Record<string, string> | Custom headers to include on every request to the server. Requires url. | src/mcp.ts:92 |
disableMcpInstrumentation? | boolean | Disable OpenTelemetry MCP instrumentation. | src/mcp.ts:95 |
tasksConfig? | TasksConfig | Configuration for task-augmented tool execution (experimental). When provided (even as empty object), enables MCP task-based tool invocation. When undefined, tools are called directly without task management. | src/mcp.ts:102 |
elicitationCallback? | ElicitationCallback | Callback to handle server-initiated elicitation requests. When provided, the client advertises elicitation support (form + url modes) and routes incoming elicitation requests to this callback. | src/mcp.ts:109 |
failOpen? | boolean | When true, connection failures are logged as warnings instead of throwing. | src/mcp.ts:112 |
logHandler()? | (params) => void | Called when the server emits a log message. Defaults to routing through the Strands logger. | src/mcp.ts:115 |