Notion MCP server ignores NOTION_TOKEN but OPENAPI_MCP_HEADERS works – fixed in v1.9.0?
In a FastAPI-based mcp-use setup with makenotion/notion-mcp-server, I set
NOTION_TOKENin the MCP configenvblock, but the server never connects to Notion; the thread reports no explicit error message. Replacing it withOPENAPI_MCP_HEADERSworks. The same problem was reported in Cursor IDE on a MacBook M4, and a maintainer later confirmedNOTION_TOKENsupport landed in version 1.9.0.Originally asked on GitHub: https://github.com/makenotion/notion-mcp-server/issues/95
4 answers
Fixed: a Notion maintainer confirmed in the thread that
NOTION_TOKENis supported as of notion-mcp-server v1.9.0 (comment 5). Before upgrading, three workarounds were reported as working in this thread.- Use
OPENAPI_MCP_HEADERSinstead. In the MCP config'senvblock (the reporter's FastAPI/mcp-use setup):
json"env": { "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_***\", \"Notion-Version\": \"2022-06-28\"}" }This connected correctly, even though the docs recommend
NOTION_TOKEN.-
Build from source. One commenter cloned
makenotion/notion-mcp-server, built the project locally, and pointed the MCP config at that local build. Authentication worked; they suspected the published package was behind the source (unconfirmed). -
Wrapper script for Claude Code. A commenter created
notion-mcp-wrapper.shthat exports bothNOTION_TOKENandOPENAPI_MCP_HEADERS, logs debug info to stderr, and launches the server withexec env NOTION_TOKEN="$TOKEN" node /path/to/notion-mcp-server/bin/cli.mjs. Make it executable withchmod +x, then point the MCP config at the wrapper instead of the server directly.
The thread doesn't state the reporter's package version. General advice, not from the thread: if you're on a build older than 1.9.0, upgrading first is the cleanest move; the wrapper approach depends on your local install path. Note: the token sits in plaintext in the config and wrapper, and the wrapper prints part of it to stderr, so keep those files and logs private.
Did this work for you?- Use
What a GitHub user tried on GitHub (Worked)
In the FastAPI/mcp-use setup, replaced the
NOTION_TOKENenv block withOPENAPI_MCP_HEADERSset to{"Authorization": "Bearer ntn_***", "Notion-Version": "2022-06-28"}. The server connected to Notion successfully.Source: https://github.com/makenotion/notion-mcp-server/issues/95 (opens external site)
Did this work for you?What @bjh3311 tried on GitHub (Worked)
Cloned
makenotion/notion-mcp-server, built the project locally, and used that local build instead of the published package. The server worked; the commenter guessed the published package had not been updated yet.Did this work for you?What @deep-randhawa tried on GitHub (Worked)
Created a wrapper script that exports both
NOTION_TOKENandOPENAPI_MCP_HEADERS, logs the environment to stderr, and starts the server viaexec env NOTION_TOKEN="$TOKEN" node /path/to/notion-mcp-server/bin/cli.mjs. Pointing Claude Code's MCP config at the wrapper fixed authentication.Did this work for you?