What happened?
Description
create_proxy() / ProxyProvider advertises a hardcoded set of MCP capabilities (tools, resources, prompts) during initialization, regardless of what the backend server actually supports. This causes clients to make requests for unsupported features and receive incorrect responses.
Expected Behavior
The proxy should:
- Forward the backend server's actual
serverCapabilities from its initialize response
- Only advertise capabilities that the backend server supports
- Forward backend JSON-RPC error responses (like "Method not found") instead of converting them to successful responses
Actual Behavior
-
Hardcoded capabilities: Proxy always advertises full MCP capabilities:
"capabilities": {
"experimental": {},
"logging": {},
"prompts": {"listChanged": true},
"resources": {"subscribe": false, "listChanged": true},
"tools": {"listChanged": true},
"extensions": {"io.modelcontextprotocol/ui": {}}
}
-
Backend capabilities ignored: When backend server only supports tools (no prompts/resources), proxy still advertises all capabilities
Example Code
from fastmcp.server.server import create_proxy
from fastmcp.client.transports import StreamableHttpTransport
from fastmcp import Client
# Create proxy to backend server that only supports tools
transport = StreamableHttpTransport(url="http://tools-only-server/mcp")
proxy = create_proxy(transport, name="proxy")
async with Client(proxy) as client:
# Bug 1: Initialize returns full capabilities even though backend only supports tools
result = await client.initialize()
print(result.capabilities) # Shows prompts/resources support incorrectly
# Bug 2: resources/list returns empty list instead of "Method not found" error
resources = await client.list_resources() # Should error, but returns []
Version Information
- FastMCP version: 3.2.4
- Python version: 3.13.12
- MCP protocol version: 2024-11-05
- OS: macOS
What happened?
Description
create_proxy()/ProxyProvideradvertises a hardcoded set of MCP capabilities (tools, resources, prompts) during initialization, regardless of what the backend server actually supports. This causes clients to make requests for unsupported features and receive incorrect responses.Expected Behavior
The proxy should:
serverCapabilitiesfrom itsinitializeresponseActual Behavior
Hardcoded capabilities: Proxy always advertises full MCP capabilities:
Backend capabilities ignored: When backend server only supports tools (no prompts/resources), proxy still advertises all capabilities
Example Code
Version Information