mirror of
https://github.com/makenotion/notion-mcp-server.git
synced 2026-07-30 16:47:28 -04:00
In Streamable HTTP mode the Notion token was fixed at startup (NOTION_TOKEN / OPENAPI_MCP_HEADERS), locking one deployment to a single Notion integration. This adds an opt-in mode where each client supplies its own Notion integration token per connection, so one deployment can serve many integrations. - New `--enable-token-passthrough` flag / `ENABLE_TOKEN_PASSTHROUGH=true` env (default off; existing single-token behavior unchanged). - Token resolved per init request: dedicated `Notion-Token` header first, then `Authorization: Bearer ntn_...` when the server's own gateway auth is disabled, then the startup env token as fallback. - Token shape validated; bound per MCP session; never logged (redacted prefix only). Malformed explicit token returns 401. - MCPProxy/initProxy now accept explicit headers; env resolution is the default when none are passed. New token helper module is unit-tested; proxy tests cover the explicit header override. Full suite green; build passes. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>