Files
Kenneth Sinder 604eef99dd Add per-request Notion token passthrough for HTTP transport (#315)
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>
2026-06-17 15:09:25 -07:00
..
2025-04-03 09:24:00 -07:00