Problem
fastapi_mcp crashes with RecursionError on any self-referencing Pydantic model in the OpenAPI schema (no cycle detection in resolve_schema_references()). This is app-wide — one recursive route kills the entire MCP server. It also generates LLM-unfriendly schemas ($ref/$defs) and HTTP-derived tool names (post_get_online_features).
Solution
Replace fastapi_mcp with the MCP Python SDK (FastMCP). Define tools explicitly via @mcp.tool(), calling FeatureStore methods directly (no internal HTTP round-trip).
Benefits
- Unblocks recursive Pydantic models (compound filters, nested types) on HTTP routes without breaking MCP
- Flat, LLM-friendly tool schemas (no
$ref/$defs)
- Semantic tool names (
get_online_features, not post_get_online_features)
- New registry discovery tools (
list_feature_views, list_entities, list_feature_services, list_data_sources)
- No HTTP noise (health checks, static files, WebSocket routes not exposed)
- Direct
FeatureStore calls instead of internal HTTP round-trip
Problem
fastapi_mcpcrashes withRecursionErroron any self-referencing Pydantic model in the OpenAPI schema (no cycle detection inresolve_schema_references()). This is app-wide — one recursive route kills the entire MCP server. It also generates LLM-unfriendly schemas ($ref/$defs) and HTTP-derived tool names (post_get_online_features).Solution
Replace
fastapi_mcpwith the MCP Python SDK (FastMCP). Define tools explicitly via@mcp.tool(), callingFeatureStoremethods directly (no internal HTTP round-trip).Benefits
$ref/$defs)get_online_features, notpost_get_online_features)list_feature_views,list_entities,list_feature_services,list_data_sources)FeatureStorecalls instead of internal HTTP round-trip