π The fast, Pythonic way to build MCP servers and clients.
Docs cleanup
Jeremiah Lowin725f256a8f1c
diff --git a/docs/clients/client.mdx b/docs/clients/client.mdxindex 422bac4cf..7c1455712 100644--- a/docs/clients/client.mdx+++ b/docs/clients/client.mdx@@ -53,26 +53,38 @@ from fastmcp import Client, FastMCP# Example transports (more details in Transports page)server_instance = FastMCP(name="TestServer") # In-memory serverhttp_url = "https://example.com/mcp" # HTTP server URL-ws_url = "ws://localhost:9000" # WebSocket server URLserver_script = "my_mcp_server.py" # Path to a Python server file# Client automatically infers the transport typeclient_in_memory = Client(server_instance)client_http = Client(http_url)-client_ws = Client(ws_url)+client_stdio = Client(server_script)print(client_in_memory.transport)print(client_http.transport)-print(client_ws.transport)print(client_stdio.transport)# Expected Output (types may vary slightly based on environment):# <FastMCP(server='TestServer')># <StreamableHttp(url='https://example.com/mcp')>-# <WebSocket(url='ws://localhost:9000')># <PythonStdioTransport(command='python', args=['/path/to/your/my_mcp_server.py'])>```++You can also initialize a client from an MCP configuration dictionary or `MCPConfig` file:++```python+from fastmcp import Client++config = {+ "mcpServers": {+ "local": {"command": "python", "args": ["local_server.py"]},+ "remote": {"url": "https://example.com/mcp"},+ }+}++client_config = Client(config)+```<Tip>For more control over connection details (like headers for SSE, environment variables for Stdio), you can instantiate the specific `ClientTransport` class yourself and pass it to the `Client`. See the [Transports](/clients/transports) page for details.</Tip>diff --git a/docs/servers/proxy.mdx b/docs/servers/proxy.mdxindex c35a4a474..ef2899cd2 100644--- a/docs/servers/proxy.mdx+++ b/docs/servers/proxy.mdx@@ -10,7 +10,7 @@ import { VersionBadge } from '/snippets/version-badge.mdx'FastMCP provides a powerful proxying capability that allows one FastMCP server instance to act as a frontend for another MCP server (which could be remote, running on a different transport, or even another FastMCP instance). This is achieved using the `FastMCP.as_proxy()` class method.-`as_proxy()` accepts either an existing `Client` or any argument that can be passed to a `Client` as its `transport` parameter—such as another `FastMCP` instance or a URL to a remote server.+`as_proxy()` accepts either an existing `Client` or any argument that can be passed to a `Client` as its `transport` parameter—such as another `FastMCP` instance, a URL to a remote server, or an MCP configuration dictionary.## What is Proxying?@@ -46,7 +46,7 @@ from fastmcp import FastMCP# Provide the backend in any form accepted by Clientproxy_server = FastMCP.as_proxy(- "backend_server.py", # Could also be a FastMCP instance or a remote URL+ "backend_server.py", # Could also be a FastMCP instance, config dict, or a remote URLname="MyProxyServer" # Optional settings for the proxy)