| Name | Type | Description |
|---|---|---|
connections | dict[str, Connection] | None | Default: NoneA |
callbacks | Callbacks | None | Default: NoneOptional callbacks for handling notifications and events. |
tool_interceptors | list[ToolCallInterceptor] | None | Default: None |
tool_name_prefix | bool | Default: False |
handle_tool_errors | bool | Default: True |
| Name | Type |
|---|---|
| connections | dict[str, Connection] | None |
| callbacks | Callbacks | None |
| tool_interceptors | list[ToolCallInterceptor] | None |
| tool_name_prefix | bool |
| handle_tool_errors | bool |
Client for connecting to multiple MCP servers.
Loads LangChain-compatible tools, prompts and resources from MCP servers.
Optional list of tool call interceptors for modifying requests and responses.
If True, tool names are prefixed with the server name
using an underscore separator (e.g., "weather_search" instead of
"search"). This helps avoid conflicts when multiple servers have tools
with the same name. Defaults to False.
If True (default), an MCP tool execution error
(CallToolResult(isError=True)) is returned to the model as a
ToolMessage with status="error" so the agent can self-correct
instead of crashing the run. If False, a ToolException is
raised instead (legacy behavior). Transport/session failures and
content-conversion errors (e.g. unsupported audio content) always
raise regardless of this setting; only MCP execution errors
(isError=True) are governed by it.