Skip to content

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.

NameTypeDescriptionDefined in
transport?McpTransportPre-constructed transport. Mutually exclusive with url.src/mcp.ts:80
url?string | URLServer URL. When provided, a StreamableHTTP transport is constructed automatically.src/mcp.ts:83
auth?McpClientCredentialsClient credentials for OAuth machine-to-machine auth. Requires url.src/mcp.ts:86
authProvider?OAuthClientProviderCustom 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?booleanDisable OpenTelemetry MCP instrumentation.src/mcp.ts:95
tasksConfig?TasksConfigConfiguration 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?ElicitationCallbackCallback 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?booleanWhen true, connection failures are logged as warnings instead of throwing.src/mcp.ts:112
logHandler()?(params) => voidCalled when the server emits a log message. Defaults to routing through the Strands logger.src/mcp.ts:115