Add authenticated remote MCP HTTP entrypoint (#10)

Add a bearer-protected streamable HTTP MCP ASGI entrypoint for production deployment.

Includes remote host/origin configuration, health checks, fallback token handling, documentation, and tests covering authentication behavior.

Verified with full local pytest suite and GitHub CI. Copilot review feedback addressed before merge.
This commit is contained in:
Christian Krakau-Louis
2026-05-21 19:06:43 +02:00
committed by GitHub
parent 74e5e5b531
commit ed57d84199
3 changed files with 171 additions and 0 deletions
+10
View File
@@ -13,6 +13,16 @@ pip install -r requirements.txt
python -m musicround.mcp_server
```
For a production streamable HTTP endpoint, run the authenticated ASGI entrypoint:
```bash
MCP_BEARER_TOKEN=... uvicorn musicround.mcp_http:app --host 0.0.0.0 --port 8000
```
If `MCP_BEARER_TOKEN` is not set, the HTTP entrypoint falls back to
`AUTOMATION_TOKEN`. Set `MCP_ALLOWED_HOSTS` and `MCP_ALLOWED_ORIGINS` when the
server is exposed behind a reverse proxy or ingress.
The server uses the normal Quizzical Beats Flask configuration. Set the same
environment variables you use for the web app, including `SECRET_KEY`,
`AUTOMATION_TOKEN`, database configuration, mail settings, and any Spotify,