Skip to content

Pre-validation hooks: document ordering, add a global hook, and report the server's versions in VERSION_UNSUPPORTED #2008

Backlog

Description

@bokelley
  1. Ordering is load-bearing but undocumented. Hooks receive dict(params), a shallow copy (server/mcp_tools.py:4080-4088), which is the only reason SkillMiddleware still sees the caller's original request. The SkillMiddleware docs (server/serve.py:470-473) don't say whether middleware runs before or after hooks. Please document "middleware receives the raw request; hooks receive a copy" and pin it with a test, or provide a response hook that receives the original request.
  2. pre_validation_hooks is keyed by tool name with no wildcard. Cross-cutting hooks (version bridging, unknown-field policy) must enumerate every tool, and a tool added later silently misses them. Ask: a "*" key or a global hook.
  3. The SDK's own VERSION_UNSUPPORTED fills details.supported_versions from exc.supported (server/mcp_tools.py:3960), so it omits versions the seller serves through a hook or alias. Ask: report the server's effective list.
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions