Skip to main content
Glama

Food MCP Server

MCP_INSPECTOR_READY.mdโ€ข2.5 kB
# ๐ŸŽ‰ **MCP Inspector Compatible Server Ready!** ## โœ… **Successfully Fixed for MCP Inspector** Your Food MCP Server now uses the **proper StreamableHTTP pattern** that works with the MCP Inspector! ### ๐Ÿ”ง **Key Changes Made** 1. **Proper Endpoint Structure**: - โœ… **MCP Endpoint**: `http://localhost:8000/mcp` - โœ… **Mount Point**: Using Starlette's `Mount("/mcp", ...)` - โœ… **CORS Headers**: Added proper CORS middleware 2. **Inspector-Compatible Configuration**: - โœ… **Stateless Mode**: `stateless=True` for inspector compatibility - โœ… **JSON Response**: Configurable via `JSON_RESPONSE` env var - โœ… **Session Management**: Proper session manager lifecycle 3. **ASGI Application Structure**: ```python # Create Starlette app with /mcp mount starlette_app = Starlette( routes=[Mount("/mcp", app=handle_streamable_http)], lifespan=lifespan, ) # Add CORS for browser/inspector access starlette_app = CORSMiddleware( starlette_app, allow_origins=["*"], allow_methods=["GET", "POST", "DELETE"], expose_headers=["Mcp-Session-Id"], ) ``` ### ๐Ÿš€ **Verified Working** Server logs show successful MCP communication: ``` INFO:server:Application started with StreamableHTTP session manager! INFO:server:Initializing Food MCP Server... INFO:server:Successfully initialized food services ``` The server properly responds to MCP requests at the `/mcp/` endpoint. ### ๐ŸŒ **How to Use with Inspector** ```bash # Start the server python run_server.py # Test with MCP Inspector npx @modelcontextprotocol/inspector http://localhost:8000/mcp ``` ### ๐Ÿ“Š **Technical Details** - **Transport**: StreamableHTTPSessionManager - **Endpoint**: `http://localhost:8000/mcp` - **CORS**: Enabled for browser access - **Session Mode**: Stateless (inspector compatible) - **Content Types**: Supports both JSON and streaming responses - **Headers**: Proper `Mcp-Session-Id` exposure ### ๐ŸŽฏ **Inspector Compatibility Features** 1. **Stateless Mode**: Creates fresh transport for each request 2. **CORS Headers**: Allows browser-based inspector access 3. **Proper Mount Point**: Uses `/mcp` endpoint as expected 4. **Content Negotiation**: Handles both JSON and streaming 5. **Session Headers**: Exposes `Mcp-Session-Id` for debugging Your server is now **fully compatible with the MCP Inspector**! ๐ŸŽ‰ The inspector should be able to connect and discover all 11 tools with structured output schemas.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MacroSense-AI/dietician-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server