fastmcp.mcp_config
Canonical MCP Configuration Format.
This module defines the standard configuration format for Model Context Protocol (MCP) servers.
It provides a client-agnostic, extensible format that can be used across all MCP implementations.
The configuration format supports both stdio and remote (HTTP/SSE) transports, with comprehensive
field definitions for server metadata, authentication, and execution parameters.
Example configuration:
Functions
infer_transport_type_from_url
update_config_file
Classes
StdioMCPServer
MCP server configuration for stdio transport.
This is the canonical configuration format for MCP servers using stdio transport.
Methods:
to_transport
TransformingStdioMCPServer
A Stdio server with tool transforms.
RemoteMCPServer
MCP server configuration for HTTP/SSE transport.
This is the canonical configuration format for MCP servers using remote transports.
Methods:
to_transport
TransformingRemoteMCPServer
A Remote server with tool transforms.
MCPConfig
A configuration object for MCP Servers that conforms to the canonical MCP configuration format
while adding additional fields for enabling FastMCP-specific features like tool transformations
and filtering by tags.
For an MCPConfig that is strictly canonical, see the CanonicalMCPConfig
class.
Methods: