Skip to content

MCP server

AI Hub embeds a stateless FastMCP server at /mcp. Its streamable-HTTP path is /, relative to that mount.

Registration

At application startup, src/mcp_server/tools/ is scanned and every module with a callable register(mcp) function is loaded. The current modules register the health check and two agent wrappers documented under MCP tools.

Standalone development

python -m src.mcp_server.mcp_server

For normal AI Hub deployment, use src.main:app; it mounts the already-created FastMCP HTTP application and shares MongoDB, graph and the LangGraph checkpointer/store selected through DATABASE_URL.

Authentication

Agent-wrapper calls validate X-API-Key against AI_HUB_USER_API_KEY or AI_HUB_ADMIN_API_KEY. MongoDB fallback is available only when both variables are absent or empty and DATABASE_URL is not set; tenant routing then prefers the key's clientId and falls back to Client-ID. See MCP utilities. Transport configuration and client initialization depend on the MCP client; the server does not expose every internal LangGraph tool automatically.