Skip to content

feat: Migrate MCP server from fastapi_mcp to MCP Python SDK#6258

Open
patelchaitany wants to merge 1 commit intofeast-dev:masterfrom
patelchaitany:enh/mcp-sdk-migration
Open

feat: Migrate MCP server from fastapi_mcp to MCP Python SDK#6258
patelchaitany wants to merge 1 commit intofeast-dev:masterfrom
patelchaitany:enh/mcp-sdk-migration

Conversation

@patelchaitany
Copy link
Copy Markdown
Contributor

@patelchaitany patelchaitany commented Apr 10, 2026

Closes #6252

fastapi_mcp has no cycle detection in resolve_schema_references(). Any self-referencing Pydantic model in the OpenAPI schema (compound filters, nested FilterExpression, etc.) causes a RecursionError that takes down the whole MCP server. It also spits out $ref/$defs-heavy schemas that LLMs can't work with, and generates tool names from HTTP verbs (post_get_online_features).

This swaps fastapi_mcp for the MCP Python SDK (FastMCP). Tools are registered with @mcp.tool() and call FeatureStore directly, no internal HTTP round-trip.

What changed

  • mcp_server.py -- replaced FastApiMCP wrapper with a create_mcp_server() function that registers tools explicitly
  • New registry tools: list_feature_views, list_entities, list_feature_services, list_data_sources
  • New data access tools: get_online_features, search_documents
  • New materialization tools: materialize, materialize_incremental
  • SSE and streamable HTTP transports via mcp_transport config
  • Configurable mcp_base_path (default /mcp)
  • Session manager lifecycle tied to FastAPI lifespan
  • Elasticsearch timestamp parsing now handles microseconds
  • Unit and integration tests rewritten for the new SDK

Open with Devin

@patelchaitany patelchaitany requested a review from a team as a code owner April 10, 2026 11:40
@patelchaitany patelchaitany force-pushed the enh/mcp-sdk-migration branch from 3d6b581 to 6c098d6 Compare April 10, 2026 11:41
devin-ai-integration[bot]

This comment was marked as resolved.

@patelchaitany patelchaitany force-pushed the enh/mcp-sdk-migration branch from 6c098d6 to 092a808 Compare April 10, 2026 12:07
devin-ai-integration[bot]

This comment was marked as resolved.

@patelchaitany patelchaitany force-pushed the enh/mcp-sdk-migration branch 5 times, most recently from f0a5d8b to 86780be Compare April 13, 2026 10:59
devin-ai-integration[bot]

This comment was marked as resolved.

@patelchaitany patelchaitany force-pushed the enh/mcp-sdk-migration branch 5 times, most recently from 7accb30 to 8f2c53f Compare April 14, 2026 05:25
…nError on recursive Pydantic models, expose explicit @mcp.tool() handlers that call FeatureStore directly, and add registry discovery, data access, and materialization tools with flat LLM-friendly schemas.

Signed-off-by: Chaitany patel <patelchaitany93@gmail.com>
Rerun-CI: true
@patelchaitany patelchaitany force-pushed the enh/mcp-sdk-migration branch from 8f2c53f to b34109b Compare April 14, 2026 06:45
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.

Migrate MCP server from fastapi_mcp to MCP Python SDK

1 participant