Skip to content

[Bug] Proxy components lose version metadata, breaking VersionFilter on proxies #5864

Open

Description

@BlueX888

Summary

Proxy components lose their version metadata. A proxy in front of a versioned backend reports every proxied tool/resource/template/prompt as unversioned, so the documented VersionFilter transform behaves incorrectly on proxies:

  • VersionFilter(version_gte="2.0", include_unversioned=False) exposes no proxied components — tools/list is empty and tools/call raises ToolError: Unknown tool: 'calc' even though the backend version is in range.
  • With the default include_unversioned=True, ranges cannot exclude out-of-range proxied versions either: version_lt="1.0" cannot hide a proxied v2 tool, because it looks unversioned.

The backend control with the same filter lists [('calc', '2.0')] and executes correctly.

Reproduction (current main adf90b6, offline)

backend = FastMCP("backend")
@backend.tool(name="calc", version="2.0")
async def calc_v2() -> str: return "v2"

proxy = FastMCP("proxy")
proxy.add_provider(ProxyProvider(lambda: ProxyClient(backend)))
proxy.add_transform(VersionFilter(version_gte="2.0", include_unversioned=False))

await proxy.list_tools()                    # []  (expected [calc])
await Client(proxy).call_tool("calc", {})   # ToolError: Unknown tool: 'calc'

The wire metadata carries the value (meta.fastmcp.version == "2.0"), but ProxyTool.version is None; same for resources, templates and prompts (each individually verified).

Root cause

fastmcp_slim/fastmcp/server/providers/proxy.py: ProxyTool.from_mcp_tool (~363), ProxyResource.from_mcp_resource (~509), ProxyTemplate.from_mcp_template (~615), and ProxyPrompt.from_mcp_prompt (~752) deserialize tags from get_fastmcp_metadata(meta) but never pass version=metadata.get("version"), so the Pydantic version field defaults to None. ProxyTemplate.create_resource (~635) also constructs ProxyResource without version=self.version.

Suggested fix

In each from_mcp_* factory, compute the FastMCP metadata once and pass version=fastmcp_meta.get("version") alongside tags; in ProxyTemplate.create_resource, propagate version=self.version to both returned resources (normal and guard-ask). Namespacing via model_copy already preserves the field.

Tests

A fix with 12 tests is ready: unit coverage for all four factories and create_resource, plus end-to-end VersionFilter listing/calling through a proxy and negative-range hiding for tools, resources, templates and prompts. I'll open the linked PR with red/green evidence.

Activity

  1. added
    bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.
    serverRelated to FastMCP server implementation or server-side functionality.
    on Oct 19, 2026
  2. Paraphern commented on Oct 22, 2026

    @Paraphern

    The version metadata shouldn't have to survive the proxy chain at all — that's the lesson we encoded into a spec. Every hop is a chance to drop provenance, so we moved it into an artifact that travels with the contract itself: a pin record carrying {package, resolvedVersion, entryPath, url} bound by an identity hash, separate from the tool-contract hashes. Verifiers check identity first — same contracts served from a different build is its own finding, distinct from contract drift (PIN-SPEC §2.1).

    The reason it's a spec and not just a tool behavior: frameworks can emit it at the source. A fastmcp server exporting its own pin at build time hands every downstream proxy a versioned, hash-verified birth certificate, and VersionFilter-style consumers stop depending on headers surviving a chain.

    Reference CLI is rugsnare (Apache-2.0, zero deps, consumes the format end to end) — happy to sketch the fastmcp export if the direction interests you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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