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)
  • CORS middleware exposing Mcp-Session-Id for HTTP transport
  • 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.

…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>
@patelchaitany patelchaitany force-pushed the enh/mcp-sdk-migration branch from 6c098d6 to 092a808 Compare April 10, 2026 12:07
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

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