Skip to content

feat: expose schema generator for tool schemas - #2608

Closed
MukundaKatta wants to merge 1 commit into
modelcontextprotocol:mainfrom
MukundaKatta:codex/schema-generator-fastmcp
Closed

feat: expose schema generator for tool schemas#2608
MukundaKatta wants to merge 1 commit into
modelcontextprotocol:mainfrom
MukundaKatta:codex/schema-generator-fastmcp

Conversation

@MukundaKatta

Copy link
Copy Markdown

Summary

  • add an optional schema_generator parameter to MCPServer and pass it through tool registration
  • use the custom Pydantic JSON schema generator for tool input schemas and structured output schemas
  • add regression coverage for custom primitive union formatting and default anyOf behavior

Fixes #2582

Tests

  • uv run ruff check src/mcp/server/mcpserver/server.py src/mcp/server/mcpserver/tools/tool_manager.py src/mcp/server/mcpserver/tools/base.py src/mcp/server/mcpserver/utilities/func_metadata.py tests/server/mcpserver/test_server.py
  • uv run pytest tests/server/mcpserver/test_server.py tests/server/mcpserver/test_tool_manager.py tests/server/mcpserver/tools/test_base.py tests/server/mcpserver/test_func_metadata.py -q

@BossChaos

This comment was marked as abuse.

@maxisbey

Copy link
Copy Markdown
Contributor

Thanks for the PR. Per our CONTRIBUTING.md we ask that PRs start from a linked, triaged issue with maintainer buy-in, which this one doesn't have yet. I'm closing this out as part of a backlog cleanup around the v2 release. Feel free to reopen if this is still relevant.

AI Disclaimer

@maxisbey maxisbey closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose schema_generator on FastMCP for tool params schema generation

3 participants