π The fast, Pythonic way to build MCP servers and clients.
Update SDK docs (#1236)
Jeremiah Lowind408dbc4771e
diff --git a/docs/docs.json b/docs/docs.jsonindex c81d310a9..bff00e977 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -65,7 +65,10 @@{"group": "Essentials","icon": "cube",- "pages": ["servers/server", "deployment/running-server"]+ "pages": [+ "servers/server",+ "deployment/running-server"+ ]},{"group": "Core Components",@@ -93,7 +96,9 @@{"group": "Authentication","icon": "shield-check",- "pages": ["servers/auth/bearer"]+ "pages": [+ "servers/auth/bearer"+ ]}]},@@ -103,7 +108,10 @@{"group": "Essentials","icon": "cube",- "pages": ["clients/client", "clients/transports"]+ "pages": [+ "clients/client",+ "clients/transports"+ ]},{"group": "Core Operations",@@ -129,7 +137,10 @@{"group": "Authentication","icon": "user-shield",- "pages": ["clients/auth/oauth", "clients/auth/bearer"]+ "pages": [+ "clients/auth/oauth",+ "clients/auth/bearer"+ ]}]},@@ -175,12 +186,17 @@},{"anchor": "What's New",- "pages": ["updates", "changelog"]+ "pages": [+ "updates",+ "changelog"+ ]},{"anchor": "Community","icon": "users",- "pages": ["community/showcase"]+ "pages": [+ "community/showcase"+ ]}]},@@ -207,7 +223,7 @@"python-sdk/fastmcp-cli-install-claude_code","python-sdk/fastmcp-cli-install-claude_desktop","python-sdk/fastmcp-cli-install-cursor",- "python-sdk/fastmcp-cli-install-mcp_config",+ "python-sdk/fastmcp-cli-install-mcp_json","python-sdk/fastmcp-cli-install-shared"]},@@ -318,6 +334,7 @@"python-sdk/fastmcp-utilities-json_schema","python-sdk/fastmcp-utilities-json_schema_type","python-sdk/fastmcp-utilities-logging",+ "python-sdk/fastmcp-utilities-mcp_config","python-sdk/fastmcp-utilities-openapi","python-sdk/fastmcp-utilities-tests","python-sdk/fastmcp-utilities-types"diff --git a/docs/python-sdk/fastmcp-cli-cli.mdx b/docs/python-sdk/fastmcp-cli-cli.mdxindex 51e8bd4e1..3c1bd0c60 100644--- a/docs/python-sdk/fastmcp-cli-cli.mdx+++ b/docs/python-sdk/fastmcp-cli-cli.mdx@@ -10,7 +10,7 @@ FastMCP CLI tools using Cyclopts.## Functions-### `version` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L89" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `version` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L103" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonversion()@@ -20,7 +20,7 @@ version()Display version information and platform details.-### `dev` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L127" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `dev` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L141" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondev(server_spec: str) -> None@@ -33,7 +33,7 @@ Run an MCP server with the MCP Inspector for development.- `server_spec`: Python file to run, optionally with \:object suffix-### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L245" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L286" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun(server_spec: str) -> None@@ -42,19 +42,20 @@ run(server_spec: str) -> NoneRun an MCP server or connect to a remote one.-The server can be specified in three ways:-1. Module approach: server.py - runs the module directly, looking for an object named 'mcp', 'server', or 'app'-2. Import approach: server.py:app - imports and runs the specified server object-3. URL approach: http://server-url - connects to a remote server and creates a proxy+The server can be specified in four ways:+1. Module approach: "server.py" - runs the module directly, looking for an object named 'mcp', 'server', or 'app'+2. Import approach: "server.py:app" - imports and runs the specified server object+3. URL approach: "http://server-url" - connects to a remote server and creates a proxy+4. MCPConfig file: "mcp.json" - runs as a proxy server for the MCP Servers in the MCPConfig fileServer arguments can be passed after -- :fastmcp run server.py -- --config config.json --debug**Args:**-- `server_spec`: Python file, object specification (file\:obj), or URL+- `server_spec`: Python file, object specification (file\:obj), MCPConfig file, or URL-### `inspect` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L344" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `inspect` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/cli.py#L442" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoninspect(server_spec: str) -> Nonediff --git a/docs/python-sdk/fastmcp-cli-install-claude_code.mdx b/docs/python-sdk/fastmcp-cli-install-claude_code.mdxindex 207756e69..cd2c07592 100644--- a/docs/python-sdk/fastmcp-cli-install-claude_code.mdx+++ b/docs/python-sdk/fastmcp-cli-install-claude_code.mdx@@ -49,12 +49,15 @@ Install FastMCP server in Claude Code.- `with_editable`: Optional directory to install in editable mode- `with_packages`: Optional list of additional packages to install- `env_vars`: Optional dictionary of environment variables+- `python_version`: Optional Python version to use+- `with_requirements`: Optional requirements file to install from+- `project`: Optional project directory to run within**Returns:**- True if installation was successful, False otherwise-### `claude_code_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/claude_code.py#L153" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `claude_code_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/claude_code.py#L170" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclaude_code_command(server_spec: str) -> Nonediff --git a/docs/python-sdk/fastmcp-cli-install-claude_desktop.mdx b/docs/python-sdk/fastmcp-cli-install-claude_desktop.mdxindex ceb3ee328..4bd05ac95 100644--- a/docs/python-sdk/fastmcp-cli-install-claude_desktop.mdx+++ b/docs/python-sdk/fastmcp-cli-install-claude_desktop.mdx@@ -36,12 +36,15 @@ Install FastMCP server in Claude Desktop.- `with_editable`: Optional directory to install in editable mode- `with_packages`: Optional list of additional packages to install- `env_vars`: Optional dictionary of environment variables+- `python_version`: Optional Python version to use+- `with_requirements`: Optional requirements file to install from+- `project`: Optional project directory to run within**Returns:**- True if installation was successful, False otherwise-### `claude_desktop_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/claude_desktop.py#L126" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `claude_desktop_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/claude_desktop.py#L143" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclaude_desktop_command(server_spec: str) -> Nonediff --git a/docs/python-sdk/fastmcp-cli-install-cursor.mdx b/docs/python-sdk/fastmcp-cli-install-cursor.mdxindex 29c20d827..2f2c9499a 100644--- a/docs/python-sdk/fastmcp-cli-install-cursor.mdx+++ b/docs/python-sdk/fastmcp-cli-install-cursor.mdx@@ -59,12 +59,15 @@ Install FastMCP server in Cursor.- `with_editable`: Optional directory to install in editable mode- `with_packages`: Optional list of additional packages to install- `env_vars`: Optional dictionary of environment variables+- `python_version`: Optional Python version to use+- `with_requirements`: Optional requirements file to install from+- `project`: Optional project directory to run within**Returns:**- True if installation was successful, False otherwise-### `cursor_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/cursor.py#L136" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `cursor_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/cursor.py#L153" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncursor_command(server_spec: str) -> Nonediff --git a/docs/python-sdk/fastmcp-cli-install-mcp_config.mdx b/docs/python-sdk/fastmcp-cli-install-mcp_json.mdxsimilarity index 51%rename from docs/python-sdk/fastmcp-cli-install-mcp_config.mdxrename to docs/python-sdk/fastmcp-cli-install-mcp_json.mdxindex f22480400..aecf21fa7 100644--- a/docs/python-sdk/fastmcp-cli-install-mcp_config.mdx+++ b/docs/python-sdk/fastmcp-cli-install-mcp_json.mdx@@ -1,19 +1,19 @@----title: mcp_config-sidebarTitle: mcp_config+title: mcp_json+sidebarTitle: mcp_json----# `fastmcp.cli.install.mcp_config`+# `fastmcp.cli.install.mcp_json`MCP configuration JSON generation for FastMCP install using Cyclopts.## Functions-### `install_mcp_config` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/mcp_config.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `install_mcp_json` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/mcp_json.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-install_mcp_config(file: Path, server_object: str | None, name: str) -> bool+install_mcp_json(file: Path, server_object: str | None, name: str) -> bool```@@ -27,15 +27,18 @@ Generate MCP configuration JSON for manual installation.- `with_packages`: Optional list of additional packages to install- `env_vars`: Optional dictionary of environment variables- `copy`: If True, copy to clipboard instead of printing to stdout+- `python_version`: Optional Python version to use+- `with_requirements`: Optional requirements file to install from+- `project`: Optional project directory to run within**Returns:**- True if generation was successful, False otherwise-### `mcp_config_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/mcp_config.py#L96" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `mcp_json_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/install/mcp_json.py#L116" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-mcp_config_command(server_spec: str) -> None+mcp_json_command(server_spec: str) -> None```diff --git a/docs/python-sdk/fastmcp-cli-run.mdx b/docs/python-sdk/fastmcp-cli-run.mdxindex 16cb54405..b1a477db1 100644--- a/docs/python-sdk/fastmcp-cli-run.mdx+++ b/docs/python-sdk/fastmcp-cli-run.mdx@@ -10,7 +10,7 @@ FastMCP run command implementation with enhanced type hints.## Functions-### `is_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L18" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `is_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L21" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonis_url(path: str) -> bool@@ -20,7 +20,7 @@ is_url(path: str) -> boolCheck if a string is a URL.-### `parse_file_path` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L24" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `parse_file_path` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L27" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonparse_file_path(server_spec: str) -> tuple[Path, str | None]@@ -36,7 +36,7 @@ Parse a file path that may include a server object specification.- Tuple of (file_path, server_object)-### `import_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `import_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L58" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonimport_server(file: Path, server_object: str | None = None) -> Any@@ -53,7 +53,30 @@ Import a MCP server from a file.- The server object-### `create_client_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L125" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `run_with_uv` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L128" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+run_with_uv(server_spec: str, python_version: str | None = None, with_packages: list[str] | None = None, with_requirements: Path | None = None, project: Path | None = None, transport: TransportType | None = None, host: str | None = None, port: int | None = None, path: str | None = None, log_level: LogLevelType | None = None, show_banner: bool = True) -> None+```+++Run a MCP server using uv run subprocess.++**Args:**+- `server_spec`: Python file, object specification (file\:obj), or URL+- `python_version`: Python version to use (e.g. "3.10")+- `with_packages`: Additional packages to install+- `with_requirements`: Requirements file to use+- `project`: Run the command within the given project directory+- `transport`: Transport protocol to use+- `host`: Host to bind to when using http transport+- `port`: Port to bind to when using http transport+- `path`: Path to bind to when using http transport+- `log_level`: Log level+- `show_banner`: Whether to show the server banner+++### `create_client_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L206" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncreate_client_server(url: str) -> Any@@ -69,7 +92,17 @@ Create a FastMCP server from a client URL.- A FastMCP server instance-### `import_server_with_args` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L145" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `create_mcp_config_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L226" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+create_mcp_config_server(mcp_config_path: Path) -> FastMCP[None]+```+++Create a FastMCP server from a MCPConfig.+++### `import_server_with_args` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L237" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonimport_server_with_args(file: Path, server_object: str | None = None, server_args: list[str] | None = None) -> Any@@ -87,17 +120,17 @@ Import a server with optional command line arguments.- The imported server object-### `run_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L169" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `run_command` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/cli/run.py#L261" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-run_command(server_spec: str, transport: TransportType | None = None, host: str | None = None, port: int | None = None, path: str | None = None, log_level: LogLevelType | None = None, server_args: list[str] | None = None, show_banner: bool = True) -> None+run_command(server_spec: str, transport: TransportType | None = None, host: str | None = None, port: int | None = None, path: str | None = None, log_level: LogLevelType | None = None, server_args: list[str] | None = None, show_banner: bool = True, use_direct_import: bool = False) -> None```Run a MCP server or connect to a remote one.**Args:**-- `server_spec`: Python file, object specification (file\:obj), or URL+- `server_spec`: Python file, object specification (file\:obj), MCPConfig file, or URL- `transport`: Transport protocol to use- `host`: Host to bind to when using http transport- `port`: Port to bind to when using http transport@@ -105,4 +138,5 @@ Run a MCP server or connect to a remote one.- `log_level`: Log level- `server_args`: Additional arguments to pass to the server- `show_banner`: Whether to show the server banner+- `use_direct_import`: Whether to use direct import instead of subprocessdiff --git a/docs/python-sdk/fastmcp-client-transports.mdx b/docs/python-sdk/fastmcp-client-transports.mdxindex 8e29e754f..0a1c7190d 100644--- a/docs/python-sdk/fastmcp-client-transports.mdx+++ b/docs/python-sdk/fastmcp-client-transports.mdx@@ -7,7 +7,7 @@ sidebarTitle: transports## Functions-### `infer_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/transports.py#L849" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `infer_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/transports.py#L847" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoninfer_transport(transport: ClientTransport | FastMCP | FastMCP1Server | AnyUrl | Path | MCPConfig | dict[str, Any] | str) -> ClientTransport@@ -238,7 +238,7 @@ object or dictionary matching the MCPConfig schema. It supports two key scenario1. If the MCPConfig contains exactly one server, it creates a direct transport to that server.2. 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 used as its mounting prefix.+ all servers on a single FastMCP instance, with each server's name, by default, used as its mounting prefix.In the multi-server case, tools are accessible with the prefix pattern `{server_name}_{tool_name}`and resources with the pattern `protocol://{server_name}/path/to/resource`.@@ -281,7 +281,7 @@ async with client:**Methods:**-#### `connect_session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/transports.py#L801" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `connect_session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/transports.py#L799" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonconnect_session(self, **session_kwargs: Unpack[SessionKwargs]) -> AsyncIterator[ClientSession]diff --git a/docs/python-sdk/fastmcp-mcp_config.mdx b/docs/python-sdk/fastmcp-mcp_config.mdxindex 3c6839dad..bd3bd8e06 100644--- a/docs/python-sdk/fastmcp-mcp_config.mdx+++ b/docs/python-sdk/fastmcp-mcp_config.mdx@@ -15,22 +15,24 @@ The configuration format supports both stdio and remote (HTTP/SSE) transports, wfield definitions for server metadata, authentication, and execution parameters.Example configuration:- {- "mcpServers": {- "my-server": {- "command": "npx",- "args": ["-y", "@my/mcp-server"],- "env": {"API_KEY": "secret"},- "timeout": 30000,- "description": "My MCP server"- }+```json+{+ "mcpServers": {+ "my-server": {+ "command": "npx",+ "args": ["-y", "@my/mcp-server"],+ "env": {"API_KEY": "secret"},+ "timeout": 30000,+ "description": "My MCP server"}}+}+```## Functions-### `infer_transport_type_from_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L43" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `infer_transport_type_from_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L57" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoninfer_transport_type_from_url(url: str | AnyUrl) -> Literal['http', 'sse']@@ -40,19 +42,22 @@ infer_transport_type_from_url(url: str | AnyUrl) -> Literal['http', 'sse']Infer the appropriate transport type from the given URL.-### `update_config_file` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L253" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `update_config_file` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L293" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-update_config_file(file_path: Path, server_name: str, server_config: StdioMCPServer | RemoteMCPServer) -> None+update_config_file(file_path: Path, server_name: str, server_config: CanonicalMCPServerTypes) -> None```-Update MCP configuration file with new server, preserving existing fields.+Update an MCP configuration file from a server object, preserving existing fields.++This is used for updating the mcpServer configurations of third-party tools so we do not+worry about transforming server objects here.## Classes-### `StdioMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L63" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `StdioMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L110" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>MCP server configuration for stdio transport.@@ -62,13 +67,19 @@ This is the canonical configuration format for MCP servers using stdio transport**Methods:**-#### `to_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L93" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `to_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L140" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonto_transport(self) -> StdioTransport```-### `RemoteMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L104" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `TransformingStdioMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L151" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+++A Stdio server with tool transforms.+++### `RemoteMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L155" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>MCP server configuration for HTTP/SSE transport.@@ -78,33 +89,58 @@ This is the canonical configuration format for MCP servers using remote transpor**Methods:**-#### `to_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L140" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `to_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L191" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonto_transport(self) -> StreamableHttpTransport | SSETransport```-### `MCPConfig` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L165" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `TransformingRemoteMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L216" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>-Canonical MCP configuration format.+A Remote server with tool transforms.-This defines the standard configuration format for Model Context Protocol servers.-The format is designed to be client-agnostic and extensible for future use cases.++### `MCPConfig` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L227" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+++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:**-#### `from_dict` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L177" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `validate_mcp_servers` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L240" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+validate_mcp_servers(self, info: ValidationInfo) -> dict[str, Any]+```++Validate the MCP servers.+++#### `add_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L250" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+add_server(self, name: str, server: MCPServerTypes) -> None+```++Add or update a server in the configuration.+++#### `from_dict` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L255" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-from_dict(cls, config: dict[str, Any]) -> MCPConfig+from_dict(cls, config: dict[str, Any]) -> Self```Parse MCP configuration from dictionary format.-#### `to_dict` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L212" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `to_dict` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L259" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonto_dict(self) -> dict[str, Any]@@ -113,7 +149,7 @@ to_dict(self) -> dict[str, Any]Convert MCPConfig to dictionary format, preserving all fields.-#### `write_to_file` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L225" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `write_to_file` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L263" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonwrite_to_file(self, file_path: Path) -> None@@ -122,29 +158,31 @@ write_to_file(self, file_path: Path) -> NoneWrite configuration to JSON file.-#### `from_file` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L232" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_file` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L269" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-from_file(cls, file_path: Path) -> MCPConfig+from_file(cls, file_path: Path) -> Self```Load configuration from JSON file.-#### `add_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L243" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `CanonicalMCPConfig` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L278" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>-```python-add_server(self, name: str, server: StdioMCPServer | RemoteMCPServer) -> None-```-Add or update a server in the configuration.+Canonical MCP configuration format.+This defines the standard configuration format for Model Context Protocol servers.+The format is designed to be client-agnostic and extensible for future use cases.-#### `remove_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L247" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++**Methods:**++#### `add_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/mcp_config.py#L288" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-remove_server(self, name: str) -> None+add_server(self, name: str, server: CanonicalMCPServerTypes) -> None```-Remove a server from the configuration.+Add or update a server in the configuration.diff --git a/docs/python-sdk/fastmcp-server-context.mdx b/docs/python-sdk/fastmcp-server-context.mdxindex b41e84aa0..edca73dda 100644--- a/docs/python-sdk/fastmcp-server-context.mdx+++ b/docs/python-sdk/fastmcp-server-context.mdx@@ -7,7 +7,7 @@ sidebarTitle: context## Functions-### `set_context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L50" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `set_context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L51" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonset_context(context: Context) -> Generator[Context, None, None]@@ -15,7 +15,7 @@ set_context(context: Context) -> Generator[Context, None, None]## Classes-### `Context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L59" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `Context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L60" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Context object providing access to MCP capabilities.@@ -44,16 +44,26 @@ def my_tool(x: int, ctx: Context) -> str:request_id = ctx.request_idclient_id = ctx.client_id+ # Manage state across the request+ ctx.set_state_value("key", "value")+ value = ctx.get_state_value("key")+return str(x)```+State Management:+Context objects maintain a state dictionary that can be used to store and share+data across middleware and tool calls within a request. When a new context+is created (nested contexts), it inherits a copy of its parent's state, ensuring+that modifications in child contexts don't affect parent contexts.+The context parameter name can be anything as long as it's annotated with Context.The context is optional - tools that don't need it can omit the parameter.**Methods:**-#### `request_context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L116" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `request_context` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrequest_context(self) -> RequestContext@@ -64,7 +74,7 @@ Access to the underlying request context.If called outside of a request context, this will raise a ValueError.-#### `report_progress` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L126" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `report_progress` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L143" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonreport_progress(self, progress: float, total: float | None = None, message: str | None = None) -> None@@ -77,7 +87,7 @@ Report progress for the current operation.- `total`: Optional total value e.g. 100-#### `read_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L153" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `read_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L170" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonread_resource(self, uri: str | AnyUrl) -> list[ReadResourceContents]@@ -92,7 +102,7 @@ Read a resource by URI.- The resource content as either text or bytes-#### `log` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L165" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `log` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L182" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlog(self, message: str, level: LoggingLevel | None = None, logger_name: str | None = None) -> None@@ -107,7 +117,7 @@ Send a log message to the client.- `logger_name`: Optional logger name-#### `client_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L189" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `client_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L206" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclient_id(self) -> str | None@@ -116,7 +126,7 @@ client_id(self) -> str | NoneGet the client ID if available.-#### `request_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L198" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `request_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L215" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrequest_id(self) -> str@@ -125,7 +135,7 @@ request_id(self) -> strGet the unique ID for this request.-#### `session_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L203" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `session_id` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L220" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsession_id(self) -> str | None@@ -142,7 +152,7 @@ the same client session.- for stdio and in-memory transports which don't use session IDs.-#### `session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L234" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `session` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L251" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsession(self) -> ServerSession@@ -151,7 +161,7 @@ session(self) -> ServerSessionAccess to the underlying session for advanced usage.-#### `debug` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L239" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `debug` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L256" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondebug(self, message: str, logger_name: str | None = None) -> None@@ -160,7 +170,7 @@ debug(self, message: str, logger_name: str | None = None) -> NoneSend a debug log message.-#### `info` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L243" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `info` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L260" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoninfo(self, message: str, logger_name: str | None = None) -> None@@ -169,7 +179,7 @@ info(self, message: str, logger_name: str | None = None) -> NoneSend an info log message.-#### `warning` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L247" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `warning` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L264" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonwarning(self, message: str, logger_name: str | None = None) -> None@@ -178,7 +188,7 @@ warning(self, message: str, logger_name: str | None = None) -> NoneSend a warning log message.-#### `error` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L251" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `error` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L268" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonerror(self, message: str, logger_name: str | None = None) -> None@@ -187,7 +197,7 @@ error(self, message: str, logger_name: str | None = None) -> NoneSend an error log message.-#### `list_roots` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L255" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_roots` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L272" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_roots(self) -> list[Root]@@ -196,7 +206,7 @@ list_roots(self) -> list[Root]List the roots available to the server, as indicated by the client.-#### `send_tool_list_changed` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L260" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `send_tool_list_changed` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L277" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsend_tool_list_changed(self) -> None@@ -205,7 +215,7 @@ send_tool_list_changed(self) -> NoneSend a tool list changed notification to the client.-#### `send_resource_list_changed` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L264" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `send_resource_list_changed` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L281" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsend_resource_list_changed(self) -> None@@ -214,7 +224,7 @@ send_resource_list_changed(self) -> NoneSend a resource list changed notification to the client.-#### `send_prompt_list_changed` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L268" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `send_prompt_list_changed` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L285" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsend_prompt_list_changed(self) -> None@@ -223,7 +233,7 @@ send_prompt_list_changed(self) -> NoneSend a prompt list changed notification to the client.-#### `sample` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L272" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `sample` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L289" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsample(self, messages: str | list[str | SamplingMessage], system_prompt: str | None = None, include_context: IncludeContext | None = None, temperature: float | None = None, max_tokens: int | None = None, model_preferences: ModelPreferences | str | list[str] | None = None) -> ContentBlock@@ -236,25 +246,25 @@ completion from the client. The client must be appropriately configured,or the request will error.-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L319" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L336" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: None) -> AcceptedElicitation[dict[str, Any]] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L331" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L348" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: type[T]) -> AcceptedElicitation[T] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L341" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L358" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: list[str]) -> AcceptedElicitation[str] | DeclinedElicitation | CancelledElicitation```-#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L350" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `elicit` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L367" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonelicit(self, message: str, response_type: type[T] | list[str] | None = None) -> AcceptedElicitation[T] | AcceptedElicitation[dict[str, Any]] | AcceptedElicitation[str] | DeclinedElicitation | CancelledElicitation@@ -283,7 +293,7 @@ type or dataclass or BaseModel. If it is a primitive type, anobject schema with a single "value" field will be generated.-#### `get_http_request` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L443" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_http_request` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L460" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_http_request(self) -> Request@@ -291,3 +301,21 @@ get_http_request(self) -> RequestGet the active starlette request.++#### `set_state` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L475" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+set_state(self, key: str, value: Any) -> None+```++Set a value in the context state.+++#### `get_state` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/context.py#L479" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+get_state(self, key: str) -> Any+```++Get a value from the context state. Returns None if the key is not found.+diff --git a/docs/python-sdk/fastmcp-server-middleware.mdx b/docs/python-sdk/fastmcp-server-middleware.mdxdeleted file mode 100644index ec8eab242..000000000--- a/docs/python-sdk/fastmcp-server-middleware.mdx+++ /dev/null@@ -1,56 +0,0 @@-----title: middleware-sidebarTitle: middleware------# `fastmcp.server.middleware`--## Functions--### `make_middleware_wrapper`--```python-make_middleware_wrapper(middleware: Middleware, call_next: CallNext[T, R]) -> CallNext[T, R]-```---Create a wrapper that applies a single middleware to a context. The-closure bakes in the middleware and call_next function, so it can be-passed to other functions that expect a call_next function.---## Classes--### `CallNext`--### `CallToolResult`--### `ListToolsResult`--### `ListResourcesResult`--### `ListResourceTemplatesResult`--### `ListPromptsResult`--### `ServerResultProtocol`--### `MiddlewareContext`---Unified context for all middleware operations.---**Methods:**--#### `copy`--```python-copy(self, **kwargs: Any) -> MiddlewareContext[T]-```--### `Middleware`---Base class for FastMCP middleware with dispatching hooks.-diff --git a/docs/python-sdk/fastmcp-server-proxy.mdx b/docs/python-sdk/fastmcp-server-proxy.mdxindex db83a5611..ca07a9cda 100644--- a/docs/python-sdk/fastmcp-server-proxy.mdx+++ b/docs/python-sdk/fastmcp-server-proxy.mdx@@ -7,7 +7,7 @@ sidebarTitle: proxy## Functions-### `default_proxy_roots_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L479" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `default_proxy_roots_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L491" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondefault_proxy_roots_handler(context: RequestContext[ClientSession, LifespanContextT]) -> RootsList@@ -19,7 +19,7 @@ A handler that forwards the list roots request from the remote server to the pro## Classes-### `ProxyToolManager` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L48" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyToolManager` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L51" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A ToolManager that sources its tools from a remote client in addition to local and mounted tools.@@ -27,7 +27,7 @@ A ToolManager that sources its tools from a remote client in addition to local a**Methods:**-#### `get_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L58" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_tools(self) -> dict[str, Tool]@@ -36,7 +36,7 @@ get_tools(self) -> dict[str, Tool]Gets the unfiltered tool inventory including local, mounted, and proxy tools.-#### `list_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L76" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L84" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_tools(self) -> list[Tool]@@ -45,7 +45,7 @@ list_tools(self) -> list[Tool]Gets the filtered list of tools including local, mounted, and proxy tools.-#### `call_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L81" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `call_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L89" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncall_tool(self, key: str, arguments: dict[str, Any]) -> ToolResult@@ -54,7 +54,7 @@ call_tool(self, key: str, arguments: dict[str, Any]) -> ToolResultCalls a tool, trying local/mounted first, then proxy if not found.-### `ProxyResourceManager` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L97" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyResourceManager` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L105" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A ResourceManager that sources its resources from a remote client in addition to local and mounted resources.@@ -62,7 +62,7 @@ A ResourceManager that sources its resources from a remote client in addition to**Methods:**-#### `get_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L104" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L112" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_resources(self) -> dict[str, Resource]@@ -71,7 +71,7 @@ get_resources(self) -> dict[str, Resource]Gets the unfiltered resource inventory including local, mounted, and proxy resources.-#### `get_resource_templates` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L127" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_resource_templates` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L135" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_resource_templates(self) -> dict[str, ResourceTemplate]@@ -80,7 +80,7 @@ get_resource_templates(self) -> dict[str, ResourceTemplate]Gets the unfiltered template inventory including local, mounted, and proxy templates.-#### `list_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L150" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L158" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_resources(self) -> list[Resource]@@ -89,7 +89,7 @@ list_resources(self) -> list[Resource]Gets the filtered list of resources including local, mounted, and proxy resources.-#### `list_resource_templates` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L155" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_resource_templates` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L163" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_resource_templates(self) -> list[ResourceTemplate]@@ -98,7 +98,7 @@ list_resource_templates(self) -> list[ResourceTemplate]Gets the filtered list of templates including local, mounted, and proxy templates.-#### `read_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L160" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `read_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L168" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonread_resource(self, uri: AnyUrl | str) -> str | bytes@@ -107,7 +107,7 @@ read_resource(self, uri: AnyUrl | str) -> str | bytesReads a resource, trying local/mounted first, then proxy if not found.-### `ProxyPromptManager` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L178" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyPromptManager` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L186" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A PromptManager that sources its prompts from a remote client in addition to local and mounted prompts.@@ -115,7 +115,7 @@ A PromptManager that sources its prompts from a remote client in addition to loc**Methods:**-#### `get_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L185" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L193" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_prompts(self) -> dict[str, Prompt]@@ -124,7 +124,7 @@ get_prompts(self) -> dict[str, Prompt]Gets the unfiltered prompt inventory including local, mounted, and proxy prompts.-#### `list_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L208" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L216" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_prompts(self) -> list[Prompt]@@ -133,7 +133,7 @@ list_prompts(self) -> list[Prompt]Gets the filtered list of prompts including local, mounted, and proxy prompts.-#### `render_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L213" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `render_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L221" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrender_prompt(self, name: str, arguments: dict[str, Any] | None = None) -> GetPromptResult@@ -142,7 +142,7 @@ render_prompt(self, name: str, arguments: dict[str, Any] | None = None) -> GetPrRenders a prompt, trying local/mounted first, then proxy if not found.-### `ProxyTool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L230" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyTool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L238" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A Tool that represents and executes a tool on a remote server.@@ -150,7 +150,7 @@ A Tool that represents and executes a tool on a remote server.**Methods:**-#### `from_mcp_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L240" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_mcp_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L248" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_mcp_tool(cls, client: Client, mcp_tool: mcp.types.Tool) -> ProxyTool@@ -159,7 +159,7 @@ from_mcp_tool(cls, client: Client, mcp_tool: mcp.types.Tool) -> ProxyToolFactory method to create a ProxyTool from a raw MCP tool schema.-#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L252" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L260" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun(self, arguments: dict[str, Any], context: Context | None = None) -> ToolResult@@ -168,7 +168,7 @@ run(self, arguments: dict[str, Any], context: Context | None = None) -> ToolResuExecutes the tool by making a call through the client.-### `ProxyResource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L271" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyResource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L279" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A Resource that represents and reads a resource from a remote server.@@ -176,7 +176,7 @@ A Resource that represents and reads a resource from a remote server.**Methods:**-#### `from_mcp_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L291" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_mcp_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L299" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_mcp_resource(cls, client: Client, mcp_resource: mcp.types.Resource) -> ProxyResource@@ -185,7 +185,7 @@ from_mcp_resource(cls, client: Client, mcp_resource: mcp.types.Resource) -> ProxFactory method to create a ProxyResource from a raw MCP resource schema.-#### `read` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L306" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `read` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L314" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonread(self) -> str | bytes@@ -194,7 +194,7 @@ read(self) -> str | bytesRead the resource content from the remote server.-### `ProxyTemplate` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L321" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyTemplate` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L329" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A ResourceTemplate that represents and creates resources from a remote server template.@@ -202,7 +202,7 @@ A ResourceTemplate that represents and creates resources from a remote server te**Methods:**-#### `from_mcp_template` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L331" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_mcp_template` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L339" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_mcp_template(cls, client: Client, mcp_template: mcp.types.ResourceTemplate) -> ProxyTemplate@@ -211,7 +211,7 @@ from_mcp_template(cls, client: Client, mcp_template: mcp.types.ResourceTemplate)Factory method to create a ProxyTemplate from a raw MCP template schema.-#### `create_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L345" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `create_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L353" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncreate_resource(self, uri: str, params: dict[str, Any], context: Context | None = None) -> ProxyResource@@ -220,7 +220,7 @@ create_resource(self, uri: str, params: dict[str, Any], context: Context | NoneCreate a resource from the template by calling the remote server.-### `ProxyPrompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L378" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyPrompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A Prompt that represents and renders a prompt from a remote server.@@ -228,7 +228,7 @@ A Prompt that represents and renders a prompt from a remote server.**Methods:**-#### `from_mcp_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L390" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_mcp_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L398" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_mcp_prompt(cls, client: Client, mcp_prompt: mcp.types.Prompt) -> ProxyPrompt@@ -237,7 +237,7 @@ from_mcp_prompt(cls, client: Client, mcp_prompt: mcp.types.Prompt) -> ProxyPrompFactory method to create a ProxyPrompt from a raw MCP prompt schema.-#### `render` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L410" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `render` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L418" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrender(self, arguments: dict[str, Any]) -> list[PromptMessage]@@ -246,14 +246,14 @@ render(self, arguments: dict[str, Any]) -> list[PromptMessage]Render the prompt by making a call through the client.-### `FastMCPProxy` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L417" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `FastMCPProxy` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L425" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A FastMCP server that acts as a proxy to a remote MCP-compliant server.It uses specialized managers that fulfill requests via a client factory.-### `ProxyClient` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L489" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyClient` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L501" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A proxy client that forwards advanced interactions between a remote MCP server and the proxy's connected clients.@@ -262,7 +262,7 @@ Supports forwarding roots, sampling, elicitation, logging, and progress.**Methods:**-#### `default_sampling_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L520" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `default_sampling_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L532" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondefault_sampling_handler(cls, messages: list[mcp.types.SamplingMessage], params: mcp.types.CreateMessageRequestParams, context: RequestContext[ClientSession, LifespanContextT]) -> mcp.types.CreateMessageResult@@ -271,7 +271,7 @@ default_sampling_handler(cls, messages: list[mcp.types.SamplingMessage], params:A handler that forwards the sampling request from the remote server to the proxy's connected clients and relays the response back to the remote server.-#### `default_elicitation_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L546" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `default_elicitation_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L558" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondefault_elicitation_handler(cls, message: str, response_type: type, params: mcp.types.ElicitRequestParams, context: RequestContext[ClientSession, LifespanContextT]) -> ElicitResult@@ -280,7 +280,7 @@ default_elicitation_handler(cls, message: str, response_type: type, params: mcp.A handler that forwards the elicitation request from the remote server to the proxy's connected clients and relays the response back to the remote server.-#### `default_log_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L564" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `default_log_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L577" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondefault_log_handler(cls, message: LogMessage) -> None@@ -289,7 +289,7 @@ default_log_handler(cls, message: LogMessage) -> NoneA handler that forwards the log notification from the remote server to the proxy's connected clients.-#### `default_progress_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L572" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `default_progress_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L585" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondefault_progress_handler(cls, progress: float, total: float | None, message: str | None) -> None@@ -297,3 +297,28 @@ default_progress_handler(cls, progress: float, total: float | None, message: strA handler that forwards the progress notification from the remote server to the proxy's connected clients.++### `StatefulProxyClient` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L598" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+++A proxy client that provides a stateful client factory for the proxy server.++The stateful proxy client bound its copy to the server session.+And it will be disconnected when the session is exited.++This is useful to proxy a stateful mcp server such as the Playwright MCP server.+Note that it is essential to ensure that the proxy server itself is also stateful.+++**Methods:**++#### `new_stateful` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/proxy.py#L616" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+new_stateful(self) -> Client[ClientTransportT]+```++Create a new stateful proxy client instance with the same configuration.++Use this method as the client factory for stateful proxy server.+diff --git a/docs/python-sdk/fastmcp-server-server.mdx b/docs/python-sdk/fastmcp-server-server.mdxindex 986e382bd..611980c70 100644--- a/docs/python-sdk/fastmcp-server-server.mdx+++ b/docs/python-sdk/fastmcp-server-server.mdx@@ -10,7 +10,7 @@ FastMCP - A more ergonomic interface for MCP servers.## Functions-### `default_lifespan` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L86" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `default_lifespan` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L97" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondefault_lifespan(server: FastMCP[LifespanResultT]) -> AsyncIterator[Any]@@ -26,7 +26,7 @@ Default lifespan context manager that does nothing.- An empty context object-### `add_resource_prefix` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2047" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `add_resource_prefix` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2114" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_resource_prefix(uri: str, prefix: str, prefix_format: Literal['protocol', 'path'] | None = None) -> str@@ -64,7 +64,7 @@ add_resource_prefix("resource:///absolute/path", "prefix")- `ValueError`: If the URI doesn't match the expected protocol\://path format-### `remove_resource_prefix` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2107" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `remove_resource_prefix` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2174" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonremove_resource_prefix(uri: str, prefix: str, prefix_format: Literal['protocol', 'path'] | None = None) -> str@@ -103,7 +103,7 @@ remove_resource_prefix("resource://prefix//absolute/path", "prefix")- `ValueError`: If the URI doesn't match the expected protocol\://path format-### `has_resource_prefix` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2174" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `has_resource_prefix` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2241" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonhas_resource_prefix(uri: str, prefix: str, prefix_format: Literal['protocol', 'path'] | None = None) -> bool@@ -143,29 +143,29 @@ False## Classes-### `FastMCP` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L117" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `FastMCP` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L128" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>**Methods:**-#### `settings` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L268" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `settings` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L281" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsettings(self) -> Settings```-#### `name` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L279" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `name` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L292" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonname(self) -> str```-#### `instructions` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L283" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `instructions` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L296" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoninstructions(self) -> str | None```-#### `run_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L286" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L299" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun_async(self, transport: Transport | None = None, show_banner: bool = True, **transport_kwargs: Any) -> None@@ -177,7 +177,7 @@ Run the FastMCP server asynchronously.- `transport`: Transport protocol to use ("stdio", "sse", or "streamable-http")-#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L316" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L329" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun(self, transport: Transport | None = None, show_banner: bool = True, **transport_kwargs: Any) -> None@@ -189,13 +189,13 @@ Run the FastMCP server. Note this is a synchronous function.- `transport`: Transport protocol to use ("stdio", "sse", or "streamable-http")-#### `add_middleware` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L358" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_middleware` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L371" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_middleware(self, middleware: Middleware) -> None```-#### `get_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L361" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_tools(self) -> dict[str, Tool]@@ -204,13 +204,13 @@ get_tools(self) -> dict[str, Tool]Get all registered tools, indexed by registered key.-#### `get_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L365" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L378" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_tool(self, key: str) -> Tool```-#### `get_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L371" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_resources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L384" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_resources(self) -> dict[str, Resource]@@ -219,13 +219,13 @@ get_resources(self) -> dict[str, Resource]Get all registered resources, indexed by registered key.-#### `get_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L375" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L388" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_resource(self, key: str) -> Resource```-#### `get_resource_templates` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L381" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_resource_templates` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L394" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_resource_templates(self) -> dict[str, ResourceTemplate]@@ -234,7 +234,7 @@ get_resource_templates(self) -> dict[str, ResourceTemplate]Get all registered resource templates, indexed by registered key.-#### `get_resource_template` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L385" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_resource_template` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L398" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_resource_template(self, key: str) -> ResourceTemplate@@ -243,7 +243,7 @@ get_resource_template(self, key: str) -> ResourceTemplateGet a registered resource template by key.-#### `get_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L392" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_prompts` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L405" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_prompts(self) -> dict[str, Prompt]@@ -252,16 +252,16 @@ get_prompts(self) -> dict[str, Prompt]List all available prompts.-#### `get_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L398" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L411" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_prompt(self, key: str) -> Prompt```-#### `custom_route` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L404" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `custom_route` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L417" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-custom_route(self, path: str, methods: list[str], name: str | None = None, include_in_schema: bool = True)+custom_route(self, path: str, methods: list[str], name: str | None = None, include_in_schema: bool = True) -> Callable[[Callable[[Request], Awaitable[Response]]], Callable[[Request], Awaitable[Response]]]```Decorator to register a custom HTTP route on the FastMCP server.@@ -279,7 +279,7 @@ Starlette's reverse URL lookup feature)- `include_in_schema`: Whether to include in OpenAPI schema, defaults to True-#### `add_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L762" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L778" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_tool(self, tool: Tool) -> Tool@@ -297,7 +297,7 @@ with the Context type annotation. See the @tool decorator for examples.- The tool instance that was added to the server.-#### `remove_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L788" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `remove_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L804" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonremove_tool(self, name: str) -> None@@ -312,19 +312,37 @@ Remove a tool from the server.- `NotFoundError`: If the tool is not found-#### `tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L810" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_tool_transformation` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L825" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+add_tool_transformation(self, tool_name: str, transformation: ToolTransformConfig) -> None+```++Add a tool transformation.+++#### `remove_tool_transformation` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L831" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+remove_tool_transformation(self, tool_name: str) -> None+```++Remove a tool transformation.+++#### `tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L836" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythontool(self, name_or_fn: AnyFunction) -> FunctionTool```-#### `tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L825" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L851" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythontool(self, name_or_fn: str | None = None) -> Callable[[AnyFunction], FunctionTool]```-#### `tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L839" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L865" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythontool(self, name_or_fn: str | AnyFunction | None = None) -> Callable[[AnyFunction], FunctionTool] | FunctionTool@@ -379,7 +397,7 @@ server.tool(my_function, name="custom_name")```-#### `add_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L966" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L992" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_resource(self, resource: Resource) -> Resource@@ -394,7 +412,7 @@ Add a resource to the server.- The resource instance that was added to the server.-#### `add_template` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L989" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_template` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1015" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_template(self, template: ResourceTemplate) -> ResourceTemplate@@ -409,7 +427,7 @@ Add a resource template to the server.- The template instance that was added to the server.-#### `add_resource_fn` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1011" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_resource_fn` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1037" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_resource_fn(self, fn: AnyFunction, uri: str, name: str | None = None, description: str | None = None, mime_type: str | None = None, tags: set[str] | None = None) -> None@@ -429,7 +447,7 @@ has parameters, it will be registered as a template resource.- `tags`: Optional set of tags for categorizing the resource-#### `resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1050" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `resource` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1076" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonresource(self, uri: str) -> Callable[[AnyFunction], Resource | ResourceTemplate]@@ -487,7 +505,7 @@ async def get_weather(city: str) -> str:```-#### `add_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1176" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1202" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_prompt(self, prompt: Prompt) -> Prompt@@ -502,19 +520,19 @@ Add a prompt to the server.- The prompt instance that was added to the server.-#### `prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1200" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1226" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonprompt(self, name_or_fn: AnyFunction) -> FunctionPrompt```-#### `prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1212" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1238" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonprompt(self, name_or_fn: str | None = None) -> Callable[[AnyFunction], FunctionPrompt]```-#### `prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1223" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `prompt` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1249" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonprompt(self, name_or_fn: str | AnyFunction | None = None) -> Callable[[AnyFunction], FunctionPrompt] | FunctionPrompt@@ -591,7 +609,7 @@ Decorator to register a prompt.```-#### `run_stdio_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1360" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run_stdio_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun_stdio_async(self, show_banner: bool = True) -> None@@ -600,7 +618,7 @@ run_stdio_async(self, show_banner: bool = True) -> NoneRun the server using stdio transport.-#### `run_http_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1380" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run_http_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1406" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun_http_async(self, show_banner: bool = True, transport: Literal['http', 'streamable-http', 'sse'] = 'http', host: str | None = None, port: int | None = None, log_level: str | None = None, path: str | None = None, uvicorn_config: dict[str, Any] | None = None, middleware: list[ASGIMiddleware] | None = None, stateless_http: bool | None = None) -> None@@ -619,7 +637,7 @@ Run the server using HTTP transport.- `stateless_http`: Whether to use stateless HTTP (defaults to settings.stateless_http)-#### `run_sse_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1454" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run_sse_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1480" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun_sse_async(self, host: str | None = None, port: int | None = None, log_level: str | None = None, path: str | None = None, uvicorn_config: dict[str, Any] | None = None) -> None@@ -628,7 +646,7 @@ run_sse_async(self, host: str | None = None, port: int | None = None, log_level:Run the server using SSE transport.-#### `sse_app` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1482" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `sse_app` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1508" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonsse_app(self, path: str | None = None, message_path: str | None = None, middleware: list[ASGIMiddleware] | None = None) -> StarletteWithLifespan@@ -642,7 +660,7 @@ Create a Starlette app for the SSE server.- `middleware`: A list of middleware to apply to the app-#### `streamable_http_app` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1513" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `streamable_http_app` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1539" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonstreamable_http_app(self, path: str | None = None, middleware: list[ASGIMiddleware] | None = None) -> StarletteWithLifespan@@ -655,7 +673,7 @@ Create a Starlette app for the StreamableHTTP server.- `middleware`: A list of middleware to apply to the app-#### `http_app` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1534" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `http_app` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1560" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonhttp_app(self, path: str | None = None, middleware: list[ASGIMiddleware] | None = None, json_response: bool | None = None, stateless_http: bool | None = None, transport: Literal['http', 'streamable-http', 'sse'] = 'http') -> StarletteWithLifespan@@ -672,13 +690,13 @@ Create a Starlette app using the specified HTTP transport.- A Starlette application configured with the specified transport-#### `run_streamable_http_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1583" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run_streamable_http_async` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1609" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun_streamable_http_async(self, host: str | None = None, port: int | None = None, log_level: str | None = None, path: str | None = None, uvicorn_config: dict[str, Any] | None = None) -> None```-#### `mount` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1608" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `mount` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1634" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonmount(self, server: FastMCP[LifespanResultT], prefix: str | None = None, as_proxy: bool | None = None) -> None@@ -732,7 +750,7 @@ automatically determined based on whether the server has a custom lifespan- `prompt_separator`: Deprecated. Separator character for prompt names.-#### `import_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1732" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `import_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1757" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonimport_server(self, server: FastMCP[LifespanResultT], prefix: str | None = None, tool_separator: str | None = None, resource_separator: str | None = None, prompt_separator: str | None = None) -> None@@ -773,25 +791,25 @@ applied using the protocol\://prefix/path format- `prompt_separator`: Deprecated. Separator for prompt names.-#### `from_openapi` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1857" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_openapi` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1882" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-from_openapi(cls, openapi_spec: dict[str, Any], client: httpx.AsyncClient, route_maps: list[RouteMap] | None = None, route_map_fn: OpenAPIRouteMapFn | None = None, mcp_component_fn: OpenAPIComponentFn | None = None, mcp_names: dict[str, str] | None = None, tags: set[str] | None = None, **settings: Any) -> FastMCPOpenAPI+from_openapi(cls, openapi_spec: dict[str, Any], client: httpx.AsyncClient, route_maps: list[RouteMap] | list[RouteMapNew] | None = None, route_map_fn: OpenAPIRouteMapFn | OpenAPIRouteMapFnNew | None = None, mcp_component_fn: OpenAPIComponentFn | OpenAPIComponentFnNew | None = None, mcp_names: dict[str, str] | None = None, tags: set[str] | None = None, **settings: Any) -> FastMCPOpenAPI | FastMCPOpenAPINew```Create a FastMCP server from an OpenAPI specification.-#### `from_fastapi` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1885" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_fastapi` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1931" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-from_fastapi(cls, app: Any, name: str | None = None, route_maps: list[RouteMap] | None = None, route_map_fn: OpenAPIRouteMapFn | None = None, mcp_component_fn: OpenAPIComponentFn | None = None, mcp_names: dict[str, str] | None = None, httpx_client_kwargs: dict[str, Any] | None = None, tags: set[str] | None = None, **settings: Any) -> FastMCPOpenAPI+from_fastapi(cls, app: Any, name: str | None = None, route_maps: list[RouteMap] | list[RouteMapNew] | None = None, route_map_fn: OpenAPIRouteMapFn | OpenAPIRouteMapFnNew | None = None, mcp_component_fn: OpenAPIComponentFn | OpenAPIComponentFnNew | None = None, mcp_names: dict[str, str] | None = None, httpx_client_kwargs: dict[str, Any] | None = None, tags: set[str] | None = None, **settings: Any) -> FastMCPOpenAPI | FastMCPOpenAPINew```Create a FastMCP server from a FastAPI application.-#### `as_proxy` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1927" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `as_proxy` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1994" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonas_proxy(cls, backend: Client[ClientTransportT] | ClientTransport | FastMCP[Any] | AnyUrl | Path | MCPConfig | dict[str, Any] | str, **settings: Any) -> FastMCPProxy@@ -805,7 +823,7 @@ instance or any value accepted as the `transport` argument of`fastmcp.client.Client` constructor.-#### `from_client` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L1988" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_client` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2055" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_client(cls, client: Client[ClientTransportT], **settings: Any) -> FastMCPProxy@@ -814,4 +832,4 @@ from_client(cls, client: Client[ClientTransportT], **settings: Any) -> FastMCPPrCreate a FastMCP proxy server from a FastMCP client.-### `MountedServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2041" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `MountedServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/server.py#L2108" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>diff --git a/docs/python-sdk/fastmcp-settings.mdx b/docs/python-sdk/fastmcp-settings.mdxindex 7f546c31b..6c460937b 100644--- a/docs/python-sdk/fastmcp-settings.mdx+++ b/docs/python-sdk/fastmcp-settings.mdx@@ -25,7 +25,9 @@ get_field_value(self, field: FieldInfo, field_name: str) -> tuple[Any, str, bool### `ExtendedSettingsConfigDict` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L54" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>-### `Settings` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L58" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ExperimentalSettings` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L58" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++### `Settings` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L77" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>FastMCP settings.@@ -33,33 +35,44 @@ FastMCP settings.**Methods:**-#### `settings_customise_sources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L70" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_setting` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L89" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-settings_customise_sources(cls, settings_cls: type[BaseSettings], init_settings: PydanticBaseSettingsSource, env_settings: PydanticBaseSettingsSource, dotenv_settings: PydanticBaseSettingsSource, file_secret_settings: PydanticBaseSettingsSource) -> tuple[PydanticBaseSettingsSource, ...]+get_setting(self, attr: str) -> Any```-#### `settings` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L88" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+Get a setting. If the setting contains one or more `__`, it will be+treated as a nested setting.+++#### `set_setting` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L102" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-settings(self) -> Self+set_setting(self, attr: str, value: Any) -> None```-This property is for backwards compatibility with FastMCP < 2.8.0,-which accessed fastmcp.settings.settings+Set a setting. If the setting contains one or more `__`, it will be+treated as a nested setting.-#### `normalize_log_level` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L107" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `settings_customise_sources` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L116" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-normalize_log_level(cls, v)+settings_customise_sources(cls, settings_cls: type[BaseSettings], init_settings: PydanticBaseSettingsSource, env_settings: PydanticBaseSettingsSource, dotenv_settings: PydanticBaseSettingsSource, file_secret_settings: PydanticBaseSettingsSource) -> tuple[PydanticBaseSettingsSource, ...]```-#### `setup_logging` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L175" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `settings` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L134" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-setup_logging(self) -> Self+settings(self) -> Self```-Finalize the settings.+This property is for backwards compatibility with FastMCP < 2.8.0,+which accessed fastmcp.settings.settings++#### `normalize_log_level` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/settings.py#L153" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+normalize_log_level(cls, v)+```diff --git a/docs/python-sdk/fastmcp-tools-tool.mdx b/docs/python-sdk/fastmcp-tools-tool.mdxindex 60c8fff9a..ce27bb86f 100644--- a/docs/python-sdk/fastmcp-tools-tool.mdx+++ b/docs/python-sdk/fastmcp-tools-tool.mdx@@ -7,7 +7,7 @@ sidebarTitle: tool## Functions-### `default_serializer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L48" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `default_serializer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L56" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondefault_serializer(data: Any) -> str@@ -15,17 +15,17 @@ default_serializer(data: Any) -> str## Classes-### `ToolResult` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L52" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ToolResult` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L60" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>**Methods:**-#### `to_mcp_result` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L83" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `to_mcp_result` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L91" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonto_mcp_result(self) -> list[ContentBlock] | tuple[list[ContentBlock], dict[str, Any]]```-### `Tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L91" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `Tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L99" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Internal tool registration info.@@ -33,25 +33,25 @@ Internal tool registration info.**Methods:**-#### `enable` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L109" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `enable` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L117" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonenable(self) -> None```-#### `disable` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L117" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `disable` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L125" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondisable(self) -> None```-#### `to_mcp_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L125" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `to_mcp_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonto_mcp_tool(self, **overrides: Any) -> MCPTool```-#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L144" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L152" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_function(fn: Callable[..., Any], name: str | None = None, title: str | None = None, description: str | None = None, tags: set[str] | None = None, annotations: ToolAnnotations | None = None, exclude_args: list[str] | None = None, output_schema: dict[str, Any] | None | NotSetT | Literal[False] = NotSet, serializer: Callable[[Any], str] | None = None, enabled: bool | None = None) -> FunctionTool@@ -60,7 +60,7 @@ from_function(fn: Callable[..., Any], name: str | None = None, title: str | NoneCreate a Tool from a function.-#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L170" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L178" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun(self, arguments: dict[str, Any]) -> ToolResult@@ -75,17 +75,17 @@ implemented by subclasses.(list of ContentBlocks, dict of structured output).-#### `from_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L183" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L191" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_tool(cls, tool: Tool, transform_fn: Callable[..., Any] | None = None, name: str | None = None, title: str | None | NotSetT = NotSet, transform_args: dict[str, ArgTransform] | None = None, description: str | None | NotSetT = NotSet, tags: set[str] | None = None, annotations: ToolAnnotations | None = None, output_schema: dict[str, Any] | None | Literal[False] = None, serializer: Callable[[Any], str] | None = None, enabled: bool | None = None) -> TransformedTool```-### `FunctionTool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L214" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `FunctionTool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L222" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>**Methods:**-#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L218" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L226" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_function(cls, fn: Callable[..., Any], name: str | None = None, title: str | None = None, description: str | None = None, tags: set[str] | None = None, annotations: ToolAnnotations | None = None, exclude_args: list[str] | None = None, output_schema: dict[str, Any] | None | NotSetT | Literal[False] = NotSet, serializer: Callable[[Any], str] | None = None, enabled: bool | None = None) -> FunctionTool@@ -94,7 +94,7 @@ from_function(cls, fn: Callable[..., Any], name: str | None = None, title: str |Create a Tool from a function.-#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L264" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L272" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun(self, arguments: dict[str, Any]) -> ToolResult@@ -103,11 +103,11 @@ run(self, arguments: dict[str, Any]) -> ToolResultRun the tool with arguments.-### `ParsedFunction` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L310" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ParsedFunction` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L318" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>**Methods:**-#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L318" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_function` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool.py#L326" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_function(cls, fn: Callable[..., Any], exclude_args: list[str] | None = None, validate: bool = True, wrap_non_object_output_schema: bool = True) -> ParsedFunctiondiff --git a/docs/python-sdk/fastmcp-tools-tool_manager.mdx b/docs/python-sdk/fastmcp-tools-tool_manager.mdxindex f9b6b61f7..3b94ee85e 100644--- a/docs/python-sdk/fastmcp-tools-tool_manager.mdx+++ b/docs/python-sdk/fastmcp-tools-tool_manager.mdx@@ -7,7 +7,7 @@ sidebarTitle: tool_manager## Classes-### `ToolManager` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L21" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ToolManager` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L25" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Manages FastMCP tools.@@ -15,7 +15,7 @@ Manages FastMCP tools.**Methods:**-#### `mount` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L45" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `mount` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L51" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonmount(self, server: MountedServer) -> None@@ -24,7 +24,7 @@ mount(self, server: MountedServer) -> NoneAdds a mounted server as a source for tools.-#### `has_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L87" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `has_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L99" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonhas_tool(self, key: str) -> bool@@ -33,7 +33,7 @@ has_tool(self, key: str) -> boolCheck if a tool exists.-#### `get_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L92" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L104" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_tool(self, key: str) -> Tool@@ -42,7 +42,7 @@ get_tool(self, key: str) -> ToolGet tool by key.-#### `get_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L99" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L111" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_tools(self) -> dict[str, Tool]@@ -51,7 +51,7 @@ get_tools(self) -> dict[str, Tool]Gets the complete, unfiltered inventory of all tools.-#### `list_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L105" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `list_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L117" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonlist_tools(self) -> list[Tool]@@ -60,7 +60,7 @@ list_tools(self) -> list[Tool]Lists all tools, applying protocol filtering.-#### `add_tool_from_fn` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L112" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_tool_from_fn` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_tool_from_fn(self, fn: Callable[..., Any], name: str | None = None, description: str | None = None, tags: set[str] | None = None, annotations: ToolAnnotations | None = None, serializer: Callable[[Any], str] | None = None, exclude_args: list[str] | None = None) -> Tool@@ -69,7 +69,7 @@ add_tool_from_fn(self, fn: Callable[..., Any], name: str | None = None, descriptAdd a tool to the server.-#### `add_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L141" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L162" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonadd_tool(self, tool: Tool) -> Tool@@ -78,7 +78,34 @@ add_tool(self, tool: Tool) -> ToolRegister a tool with the server.-#### `remove_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L158" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `add_tool_transformation` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L179" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+add_tool_transformation(self, tool_name: str, transformation: ToolTransformConfig) -> None+```++Add a tool transformation.+++#### `get_tool_transformation` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L185" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+get_tool_transformation(self, tool_name: str) -> ToolTransformConfig | None+```++Get a tool transformation.+++#### `remove_tool_transformation` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L189" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+remove_tool_transformation(self, tool_name: str) -> None+```++Remove a tool transformation.+++#### `remove_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L194" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonremove_tool(self, key: str) -> None@@ -93,7 +120,7 @@ Remove a tool from the server.- `NotFoundError`: If the tool is not found-#### `call_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L172" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `call_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_manager.py#L208" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncall_tool(self, key: str, arguments: dict[str, Any]) -> ToolResultdiff --git a/docs/python-sdk/fastmcp-tools-tool_transform.mdx b/docs/python-sdk/fastmcp-tools-tool_transform.mdxindex f39ece8f4..b2ad153fb 100644--- a/docs/python-sdk/fastmcp-tools-tool_transform.mdx+++ b/docs/python-sdk/fastmcp-tools-tool_transform.mdx@@ -7,7 +7,7 @@ sidebarTitle: tool_transform## Functions-### `forward` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L25" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `forward` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L33" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonforward(**kwargs) -> ToolResult@@ -36,7 +36,7 @@ tool has args `a` and `b`, and an `transform_args` was provided that maps `x` to- `TypeError`: If provided arguments don't match the transformed schema.-### `forward_raw` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `forward_raw` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L63" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonforward_raw(**kwargs) -> ToolResult@@ -62,9 +62,20 @@ y=2)` will call the parent tool with `x=1` and `y=2`.- `RuntimeError`: If called outside a transformed tool context.+### `apply_transformations_to_tools` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L875" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+apply_transformations_to_tools(tools: dict[str, Tool], transformations: dict[str, ToolTransformConfig]) -> dict[str, Tool]+```+++Apply a list of transformations to a list of tools. Tools that do not have any transforamtions+are left unchanged.++## Classes-### `ArgTransform` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L82" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ArgTransform` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L90" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Configuration for transforming a parent tool's argument.@@ -126,7 +137,24 @@ ArgTransform(name="new_name", description="New desc", default=None, type=int)```-### `TransformedTool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L196" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ArgTransformConfig` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L204" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+++A model for requesting a single argument transform.+++**Methods:**++#### `to_arg_transform` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L222" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+to_arg_transform(self) -> ArgTransform+```++Convert the argument transform to a FastMCP argument transform.+++### `TransformedTool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L228" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>A tool that is transformed from another tool.@@ -143,7 +171,7 @@ inherited from the parent tool but can be overridden or disabled.**Methods:**-#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L223" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `run` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L255" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun(self, arguments: dict[str, Any]) -> ToolResult@@ -162,7 +190,7 @@ functions.- ToolResult object containing content and optional structured output.-#### `from_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L324" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `from_tool` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L356" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfrom_tool(cls, tool: Tool, name: str | None = None, title: str | None | NotSetT = NotSet, description: str | None | NotSetT = NotSet, tags: set[str] | None = None, transform_fn: Callable[..., Any] | None = None, transform_args: dict[str, ArgTransform] | None = None, annotations: ToolAnnotations | None = None, output_schema: dict[str, Any] | None | Literal[False] = None, serializer: Callable[[Any], str] | None = None, enabled: bool | None = None) -> TransformedTool@@ -239,3 +267,20 @@ async def custom_output(**kwargs) -> ToolResult:)```++### `ToolTransformConfig` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L835" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+++Provides a way to transform a tool.+++**Methods:**++#### `apply` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/tools/tool_transform.py#L863" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>++```python+apply(self, tool: Tool) -> TransformedTool+```++Create a TransformedTool from a provided tool and this transformation configuration.+diff --git a/docs/python-sdk/fastmcp-utilities-json_schema.mdx b/docs/python-sdk/fastmcp-utilities-json_schema.mdxindex 451b3dbff..b782a2668 100644--- a/docs/python-sdk/fastmcp-utilities-json_schema.mdx+++ b/docs/python-sdk/fastmcp-utilities-json_schema.mdx@@ -7,7 +7,7 @@ sidebarTitle: json_schema## Functions-### `compress_schema` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/json_schema.py#L141" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `compress_schema` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/json_schema.py#L183" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncompress_schema(schema: dict, prune_params: list[str] | None = None, prune_defs: bool = True, prune_additional_properties: bool = True, prune_titles: bool = False) -> dictdiff --git a/docs/python-sdk/fastmcp-utilities-mcp_config.mdx b/docs/python-sdk/fastmcp-utilities-mcp_config.mdxindex fe1d6f156..eac19c909 100644--- a/docs/python-sdk/fastmcp-utilities-mcp_config.mdx+++ b/docs/python-sdk/fastmcp-utilities-mcp_config.mdx@@ -7,44 +7,22 @@ sidebarTitle: mcp_config## Functions-### `infer_transport_type_from_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L20"><Icon icon="github" size="14" /></a></sup>+### `composite_server_from_mcp_config` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L5" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-infer_transport_type_from_url(url: str | AnyUrl) -> Literal['http', 'sse']+composite_server_from_mcp_config(config: MCPConfig, name_as_prefix: bool = True) -> FastMCP```-Infer the appropriate transport type from the given URL.+A utility function to create a composite server from an MCPConfig.-## Classes--### `StdioMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L40"><Icon icon="github" size="14" /></a></sup>--**Methods:**--#### `to_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L47"><Icon icon="github" size="14" /></a></sup>--```python-to_transport(self) -> StdioTransport-```--### `RemoteMCPServer` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L58"><Icon icon="github" size="14" /></a></sup>--**Methods:**--#### `to_transport` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L71"><Icon icon="github" size="14" /></a></sup>+### `mount_mcp_config_into_server` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L16" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```python-to_transport(self) -> StreamableHttpTransport | SSETransport+mount_mcp_config_into_server(config: MCPConfig, server: FastMCP, name_as_prefix: bool = True) -> None```-### `MCPConfig` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L88"><Icon icon="github" size="14" /></a></sup>-**Methods:**+A utility function to mount the servers from an MCPConfig into a FastMCP server.-#### `from_dict` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/mcp_config.py#L92"><Icon icon="github" size="14" /></a></sup>--```python-from_dict(cls, config: dict[str, Any]) -> MCPConfig-```diff --git a/docs/python-sdk/fastmcp-utilities-openapi.mdx b/docs/python-sdk/fastmcp-utilities-openapi.mdxindex 4cb84f5f4..970ebaaf1 100644--- a/docs/python-sdk/fastmcp-utilities-openapi.mdx+++ b/docs/python-sdk/fastmcp-utilities-openapi.mdx@@ -7,7 +7,7 @@ sidebarTitle: openapi## Functions-### `format_array_parameter` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L42" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `format_array_parameter` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L41" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonformat_array_parameter(values: list, parameter_name: str, is_query_parameter: bool = False) -> str | list@@ -25,7 +25,7 @@ Format an array parameter according to OpenAPI specifications.- String (comma-separated) or list (for query params with explode=True)-### `format_deep_object_parameter` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L96" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `format_deep_object_parameter` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L95" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonformat_deep_object_parameter(param_value: dict, parameter_name: str) -> dict[str, str]@@ -37,8 +37,7 @@ Format a dictionary parameter for deepObject style serialization.According to OpenAPI 3.0 spec, deepObject style with explode=true serializesobject properties as separate query parameters with bracket notation.-For example: {"id": "123", "type": "user"} becomes:-param[id]=123¶m[type]=user+For example: `{"id": "123", "type": "user"}` becomes `param[id]=123¶m[type]=user`.**Args:**- `param_value`: Dictionary value to format@@ -48,7 +47,7 @@ param[id]=123¶m[type]=user- Dictionary with bracketed parameter names as keys-### `parse_openapi_to_http_routes` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L205" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `parse_openapi_to_http_routes` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L203" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonparse_openapi_to_http_routes(openapi_dict: dict[str, Any]) -> list[HTTPRoute]@@ -61,7 +60,7 @@ using the openapi-pydantic library.Supports both OpenAPI 3.0.x and 3.1.x versions.-### `clean_schema_for_display` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L740" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `clean_schema_for_display` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L738" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclean_schema_for_display(schema: JsonSchema | None) -> JsonSchema | None@@ -71,7 +70,7 @@ clean_schema_for_display(schema: JsonSchema | None) -> JsonSchema | NoneClean up a schema dictionary for display by removing internal/complex fields.-### `generate_example_from_schema` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L800" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `generate_example_from_schema` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L798" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythongenerate_example_from_schema(schema: JsonSchema | None) -> Any@@ -82,7 +81,7 @@ Generate a simple example value from a JSON schema dictionary.Very basic implementation focusing on types.-### `format_json_for_description` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L883" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `format_json_for_description` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L881" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonformat_json_for_description(data: Any, indent: int = 2) -> str@@ -92,7 +91,7 @@ format_json_for_description(data: Any, indent: int = 2) -> strFormats Python data as a JSON string block for markdown.-### `format_description_with_responses` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L892" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `format_description_with_responses` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L890" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonformat_description_with_responses(base_description: str, responses: dict[str, Any], parameters: list[ParameterInfo] | None = None, request_body: RequestBodyInfo | None = None) -> str@@ -115,7 +114,7 @@ including its description, whether it is required, and its content schema.- and the request body.-### `extract_output_schema_from_responses` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L1291" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `extract_output_schema_from_responses` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L1322" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonextract_output_schema_from_responses(responses: dict[str, ResponseInfo], schema_definitions: dict[str, Any] | None = None) -> dict[str, Any] | None@@ -138,31 +137,31 @@ object type, it wraps it to comply with MCP requirements.## Classes-### `ParameterInfo` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L130" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ParameterInfo` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L128" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Represents a single parameter for an HTTP operation in our IR.-### `RequestBodyInfo` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L142" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `RequestBodyInfo` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L140" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Represents the request body for an HTTP operation in our IR.-### `ResponseInfo` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L152" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ResponseInfo` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L150" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Represents response information in our IR.-### `HTTPRoute` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L160" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `HTTPRoute` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L158" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Intermediate Representation for a single OpenAPI operation.-### `OpenAPIParser` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L257" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `OpenAPIParser` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L255" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Unified parser for OpenAPI schemas with generic type parameters to handle both 3.0 and 3.1.@@ -170,7 +169,7 @@ Unified parser for OpenAPI schemas with generic type parameters to handle both 3**Methods:**-#### `parse` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L619" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `parse` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/openapi.py#L617" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonparse(self) -> list[HTTPRoute]diff --git a/docs/python-sdk/fastmcp-utilities-tests.mdx b/docs/python-sdk/fastmcp-utilities-tests.mdxindex f8f1d8fb8..5766b4d02 100644--- a/docs/python-sdk/fastmcp-utilities-tests.mdx+++ b/docs/python-sdk/fastmcp-utilities-tests.mdx@@ -20,7 +20,7 @@ Temporarily override FastMCP setting values.- `**kwargs`: The settings to override, including nested settings.-### `run_server_in_process` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/tests.py#L75" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `run_server_in_process` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/tests.py#L72" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrun_server_in_process(server_fn: Callable[..., None], *args, **kwargs) -> Generator[str, None, None]@@ -41,7 +41,7 @@ not pickleable, so we need a function that creates and runs one.- The server URL.-### `caplog_for_fastmcp` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/tests.py#L136" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `caplog_for_fastmcp` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/tests.py#L133" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncaplog_for_fastmcp(caplog)diff --git a/docs/python-sdk/fastmcp-utilities-types.mdx b/docs/python-sdk/fastmcp-utilities-types.mdxindex 378e0e076..4d08be539 100644--- a/docs/python-sdk/fastmcp-utilities-types.mdx+++ b/docs/python-sdk/fastmcp-utilities-types.mdx@@ -10,7 +10,7 @@ Common types used across FastMCP.## Functions-### `get_cached_typeadapter` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L31" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `get_cached_typeadapter` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L39" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_cached_typeadapter(cls: T) -> TypeAdapter[T]@@ -23,7 +23,7 @@ However, this isn't feasible for user-generated functions. Instead, we use acache to minimize the cost of creating them as much as possible.-### `issubclass_safe` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L41" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `issubclass_safe` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L97" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonissubclass_safe(cls: type, base: type) -> bool@@ -33,7 +33,7 @@ issubclass_safe(cls: type, base: type) -> boolCheck if cls is a subclass of base, even if cls is a type variable.-### `is_class_member_of_type` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L51" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `is_class_member_of_type` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L107" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonis_class_member_of_type(cls: type, base: type) -> bool@@ -46,7 +46,7 @@ Base can be a type, a UnionType, or an Annotated type. Generic types are notconsidered members (e.g. T is not a member of list\[T]).-### `find_kwarg_by_type` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L73" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `find_kwarg_by_type` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L129" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonfind_kwarg_by_type(fn: Callable, kwarg_type: type) -> str | None@@ -58,7 +58,7 @@ Find the name of the kwarg that is of type kwarg_type.Includes union types that contain the kwarg_type, as well as Annotated types.-### `replace_type` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L293" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `replace_type` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L358" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonreplace_type(type_, type_map: dict[type, type])@@ -75,23 +75,25 @@ This is useful for transforming types when creating tools.- `old_type`: The type to replace.- `new_type`: The type to replace old_type with.-**Examples:**+Examples:+```python+>>> replace_type(list[int | bool], {int: str})+list[str | bool]->>> replace_type(list\[int | bool], {int: str})-list\[str | bool]->>> replace_type(list\[list\[int]], {int: str})-list\[list\[str]]+>>> replace_type(list[list[int]], {int: str})+list[list[str]]+```## Classes-### `FastMCPBaseModel` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L24" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `FastMCPBaseModel` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L32" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Base model for FastMCP models.-### `Image` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L90" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `Image` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L155" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Helper class for returning images from tools.@@ -99,7 +101,7 @@ Helper class for returning images from tools.**Methods:**-#### `to_image_content` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L127" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `to_image_content` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L192" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonto_image_content(self, mime_type: str | None = None, annotations: Annotations | None = None) -> mcp.types.ImageContent@@ -108,7 +110,7 @@ to_image_content(self, mime_type: str | None = None, annotations: Annotations |Convert to MCP ImageContent.-### `Audio` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L149" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `Audio` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L214" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Helper class for returning audio from tools.@@ -116,13 +118,13 @@ Helper class for returning audio from tools.**Methods:**-#### `to_audio_content` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L186" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `to_audio_content` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L251" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonto_audio_content(self, mime_type: str | None = None, annotations: Annotations | None = None) -> mcp.types.AudioContent```-### `File` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L207" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `File` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L272" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Helper class for returning audio from tools.@@ -130,7 +132,7 @@ Helper class for returning audio from tools.**Methods:**-#### `to_resource_content` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L246" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `to_resource_content` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/utilities/types.py#L311" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonto_resource_content(self, mime_type: str | None = None, annotations: Annotations | None = None) -> mcp.types.EmbeddedResourcediff --git a/src/fastmcp/mcp_config.py b/src/fastmcp/mcp_config.pyindex e6758e0c7..a534fac38 100644--- a/src/fastmcp/mcp_config.py+++ b/src/fastmcp/mcp_config.py@@ -7,17 +7,19 @@ The configuration format supports both stdio and remote (HTTP/SSE) transports, wfield definitions for server metadata, authentication, and execution parameters.Example configuration:- {- "mcpServers": {- "my-server": {- "command": "npx",- "args": ["-y", "@my/mcp-server"],- "env": {"API_KEY": "secret"},- "timeout": 30000,- "description": "My MCP server"- }+```json+{+ "mcpServers": {+ "my-server": {+ "command": "npx",+ "args": ["-y", "@my/mcp-server"],+ "env": {"API_KEY": "secret"},+ "timeout": 30000,+ "description": "My MCP server"}}+}+```"""from __future__ import annotationsdiff --git a/src/fastmcp/utilities/openapi.py b/src/fastmcp/utilities/openapi.pyindex a636e815c..ef7ae874f 100644--- a/src/fastmcp/utilities/openapi.py+++ b/src/fastmcp/utilities/openapi.py@@ -101,8 +101,7 @@ def format_deep_object_parameter(According to OpenAPI 3.0 spec, deepObject style with explode=true serializesobject properties as separate query parameters with bracket notation.- For example: {"id": "123", "type": "user"} becomes:- param[id]=123¶m[type]=user+ For example: `{"id": "123", "type": "user"}` becomes `param[id]=123¶m[type]=user`.Args:param_value: Dictionary value to formatdiff --git a/src/fastmcp/utilities/types.py b/src/fastmcp/utilities/types.pyindex d309f2af9..815e1faba 100644--- a/src/fastmcp/utilities/types.py+++ b/src/fastmcp/utilities/types.py@@ -368,12 +368,13 @@ def replace_type(type_, type_map: dict[type, type]):new_type: The type to replace old_type with.Examples:- >>> replace_type(list[int | bool], {int: str})- list[str | bool]-- >>> replace_type(list[list[int]], {int: str})- list[list[str]]+ ```python+ >>> replace_type(list[int | bool], {int: str})+ list[str | bool]+ >>> replace_type(list[list[int]], {int: str})+ list[list[str]]+ ```"""if type_ in type_map:return type_map[type_]