Skip to content

stateless: tools/list leaks x-mcp-file to clients that did not declare fileInputs #1515

Closed

Description

@panyam

Problem

SEP-2356 says a client that did not declare the fileInputs capability MUST NOT see the x-mcp-file keyword in tool input schemas. The session wire strips it (server/dispatch.go:573, stripFileInputsFromTools). The stateless wire does not. server/stateless/handlers.go:19-31 returns d.Backend.Tools() unfiltered, and its comment says per-request stripping "lands when the example fixture starts exercising the path".

Reproduced on main at 88052be3. A stateless client with no fileInputs declaration calls tools/list against a server holding a tool with an x-mcp-file property, and gets:

{"name":"upload_report","inputSchema":{"properties":{"report":{"format":"uri","type":"string","x-mcp-file":{"accept":["application/pdf"]}}},"type":"object"}}

The same call on the session wire returns the property without x-mcp-file.

Why it matters now

experimental/ext/agents (#1393) must return tool definitions in agents/get that match the caller's tools/list field for field (agents-wg#22). It reads the per-request declaration via ctx.ClientCaps() and strips correctly on both wires, so on the stateless wire it now disagrees with tools/list for exactly this case. The agents parity test covers every other combination.

Work

  • Strip x-mcp-file in the stateless tools/list when the per-request _meta carries no fileInputs capability (core.RequestMetaFromContext, per the capability rule in CLAUDE.md).
  • Test on the 2026-07-28 wire, with and without the declaration.
  • Add the stateless no-fileInputs case to the agents parity test (experimental/ext/agents/stateless_test.go).

Activity

  1. added
    P2Low priority — periodic review
    protocolMCP protocol features and compliance
    P1Next up for an active mission (cap 5 per mission)
    mission_wire_2026_07_28Mission: 2026-07-28 wire correctness on both wires
    and removed
    P2Low priority — periodic review
    on Oct 14, 2026
  2. panyam commented on Oct 16, 2026

    @panyam
    OwnerAuthor

    P2 → P1: a SEP-2356 MUST NOT broken on the stateless wire; first wave of mission #1552.

  3. added a commit that references this issue on Oct 24, 2026
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

    P1Next up for an active mission (cap 5 per mission)mission_wire_2026_07_28Mission: 2026-07-28 wire correctness on both wiresprotocolMCP protocol features and compliance

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions