Create a new MultiServerMCPClient.
Returns clone of server config for inspection purposes.
Client does not support config modifications.
Optional
additionalAn additional prefix to add to the tool name Prefixes are separated by double underscores
(example: mcp__add
).
A map of server names to their configuration
Optional
prefixWhether to prefix tool names with the server name. Prefixes are separated by double
underscores (example: calculator_server_1__add
).
Optional
throwWhether to throw an error if a tool fails to load
Get a the MCP client for a specific server. Useful for fetching prompts or resources from that server.
The name of the server
The client for the server, or undefined if the server is not connected
Get tools from specified servers as a flattened array.
Rest
...servers: string[]Optional array of server names to filter tools by. If not provided, returns tools from all servers.
A flattened array of tools from the specified servers (or all servers)
Proactively initialize connections to all servers. This will be called automatically when methods requiring an active connection (like getTools or getClient) are called, but you can call it directly to ensure all connections are established before using the tools.
A map of server names to arrays of tools
Client for connecting to multiple MCP servers and loading LangChain-compatible tools.