Spaces:
Sleeping
Sleeping
MCP deployment fix
Root causes addressed
FastMCPwas created with its default host (127.0.0.1) even though the server is deployed behind the Hugging Face public proxy. Recent MCP SDK releases automatically apply DNS-rebinding host validation to localhost-bound servers, which can reject the public*.hf.spaceHost header.- The code comment claimed rebinding handling was configured, but no such configuration existed.
- The combined app used the mounted sub-application's private lifespan API. This is version-fragile. It now starts the documented
mcp.session_manager.run()context directly. - Browser MCP clients require CORS and exposure of
Mcp-Session-Id. mcp>=1.2had no upper bound. The project uses the v1 API, while MCP v2 is a breaking release. It is now pinned tomcp>=1.25,<2.json_response=Trueis enabled, which is the recommended mode with stateless Streamable HTTP.
Expected endpoint
https://razaali10-land-develop-mcp.hf.space/mcp
Basic verification
A plain browser GET is not a valid MCP handshake and may return 405/406. Test with an MCP client or send an MCP initialize POST with both application/json and text/event-stream accepted.