fastmcp.client.transports.config
Classes
MCPConfigTransport
Transport for connecting to one or more MCP servers defined in an MCPConfig.
This transport provides a unified interface to multiple MCP servers defined in an MCPConfig
object or dictionary matching the MCPConfig schema. It supports two key scenarios:
- If the MCPConfig contains exactly one server, it creates a direct transport to that server.
- If the MCPConfig contains multiple servers, it creates a composite client by mounting all servers on a single FastMCP instance, with each server’s name, by default, used as its mounting prefix.
{server_name}_{tool_name}
and resources with the pattern protocol://{server_name}/path/to/resource.
This is particularly useful for creating clients that need to interact with multiple specialized
MCP servers through a single interface, simplifying client code.
Examples:

