fix: remove OutputBaseModel import and migrate to FastMCP 3.x#83
fix: remove OutputBaseModel import and migrate to FastMCP 3.x#83Snoyark wants to merge 4 commits into
Conversation
- Replace OutputBaseModel with GeminiBaseModel/BaseModel across all files - Upgrade fastmcp to 3.x and mercor-mcp-shared to v3.0.1 - Migrate get_tools() → list_tools() for FastMCP 3.x API - Apply ruff format/lint fixes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
The getattr fallback reads from tool.parameters but was writing to tool.inputSchema, which FastMCP 3.x never reads back. Now writes to the same attribute that was read from (matching the calendar server pattern that already worked correctly). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add GeminiBaseModel = FlatBaseModel alias to the local mcp_schema packages in chat, code, filesystem, and presentations sub-servers. This prevents ImportError when code imports GeminiBaseModel from the local package instead of from mercor-mcp-shared. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove output schema flattening from _flatten_tool_schemas across all MCP servers because flatten_schema strips anyOf patterns for nullable fields, which breaks jsonschema.validate() in the MCP SDK when tools return null values.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b44d62b. Configure here.
|
|
||
| # ============ Output Model ============ | ||
| class ChatOutput(OutputBaseModel): | ||
| class ChatOutput(GeminiBaseModel): |
There was a problem hiding this comment.
Output models use FlatBaseModel contradicting no-flatten comment
Medium Severity
Output models like ChatOutput, PdfOutput, and SchemaOutput now inherit from GeminiBaseModel (which is FlatBaseModel), causing their model_json_schema() to return flattened schemas that strip anyOf nullable patterns. This directly contradicts the comments added in the same PR stating "output schemas are NOT flattened because flatten_schema strips anyOf patterns for nullable fields, which breaks jsonschema.validate() in the MCP SDK when tools return null values." The spreadsheets server correctly uses PydanticBaseModel (plain BaseModel) for output models while using GeminiBaseModel only for inputs.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit b44d62b. Configure here.


Summary
OutputBaseModelimports that causeImportErrorat startup (class was removed frommcp_schema)GeminiBaseModel/BaseModel(which was already imported in most files)get_tools()→list_tools()for FastMCP 3.x API compatibilityFiles changed by sub-server:
Test plan
uv syncsucceeds for each sub-server🤖 Generated with Claude Code