Skip to content

Validate x-mcp-header in tool input schema #1269

Open

Description

@Kehrlann

When adding a tool with an input schema to an SDK McpToolRepository, we must validate x-mcp-header as per spec rules.

Activity

  1. added
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    modernv3 covering the 2026-07-28 spec
    on Oct 23, 2026
  2. added this to the 2.2.0-M2 milestone on Oct 23, 2026
  3. pma1999 commented on Oct 24, 2026

    @pma1999

    I'd like to work on this once the registration API in #1200 is settled. Is this available for an external contribution? Could you confirm the intended validation hook and failure behavior for invalid tool definitions, and whether the validator should be shared with #1202?

  4. prathamgoyal787 commented on Oct 26, 2026

    @prathamgoyal787

    For context on the shared-validator question: #1202 (closes #1199) adds McpParamHeaders, which already parses x-mcp-header declarations from a tool's input schema (name rules, case-insensitive duplicates, allowed primitive types) to validate incoming Mcp-Param-* headers at call time. Invalid declarations are currently skipped with a debug log, which is the gap this issue covers at registration time.

    If it helps, I can expose that parsing as a reusable validator in #1202 so the registration-time check here builds on it, or adapt it to whatever hook you settle on in #1200.

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

    P2Moderate issues affecting some users, edge cases, potentially valuable featurearea/serverenhancementNew feature or requestmodernv3 covering the 2026-07-28 spec

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions