fleet-memory/hindsight-api/hindsight_api/api
Anton Evseev 0da77ce2c9
feat(mcp): add Bearer token authentication and tenant auth propagation (#241)
* feat(mcp): add Bearer token authentication support

Add HINDSIGHT_API_MCP_AUTH_TOKEN environment variable to enable
authentication for MCP endpoint. When set, all requests must include
a valid Authorization header (Bearer token or direct token).

If not set, MCP endpoint remains open for backwards compatibility
with local development environments.

* fix: propagate Bearer token from MCP middleware to tools for tenant auth

MCP tools were creating RequestContext() without api_key, causing
"Invalid API key" errors when tenant extension validates requests.
Now the Bearer token is extracted in middleware, stored in a context
variable, and passed through to all MCP tool RequestContext instances.
2026-01-30 09:08:18 +01:00
..
__init__.py misc: add mcp integration tests and increase test coverage (#98) 2026-01-05 11:16:55 +01:00
http.py fix: /version endpoint return wrong version (#224) 2026-01-29 08:40:01 +01:00
mcp.py feat(mcp): add Bearer token authentication and tenant auth propagation (#241) 2026-01-30 09:08:18 +01:00