Skip to content

mcp-asgi-http

Mount an MCP server on an ASGI app over Streamable HTTP. Optional request auth. Works when ASGI lifespan is off (Mangum on Lambda).

pip install mcp-asgi-http
from fastapi import FastAPI
from mcp_asgi_http import ApiKeyAuth, mount_mcp

api = FastAPI(redirect_slashes=False)
app = mount_mcp(api, server, auth=ApiKeyAuth(allowed_keys={"dev-secret"}))

Where to go

Source

github.com/johnny-rice/mcp-asgi-http