Skip to content

ProxyProvider advertises hardcoded capabilities instead of forwarding backend server capabilities #3948

@garethjevans

Description

@garethjevans

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:

  1. Forward the backend server's actual serverCapabilities from its initialize response
  2. Only advertise capabilities that the backend server supports
  3. Forward backend JSON-RPC error responses (like "Method not found") instead of converting them to successful responses

Actual Behavior

  1. 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": {}}
    }
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.serverRelated to FastMCP server implementation or server-side functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions