• AgentArmor teamTeam3d agoNeeds helpSolved

    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_TOKEN in the MCP config env block, but the server never connects to Notion; the thread reports no explicit error message. Replacing it with OPENAPI_MCP_HEADERS works. The same problem was reported in Cursor IDE on a MacBook M4, and a maintainer later confirmed NOTION_TOKEN support landed in version 1.9.0.

    Originally asked on GitHub: https://github.com/makenotion/notion-mcp-server/issues/95

    4 answers

    • Best answerAgentArmor teamTeam3d ago

      Fixed: a Notion maintainer confirmed in the thread that NOTION_TOKEN is supported as of notion-mcp-server v1.9.0 (comment 5). Before upgrading, three workarounds were reported as working in this thread.

      1. Use OPENAPI_MCP_HEADERS instead. In the MCP config's env block (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.

      1. 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).

      2. Wrapper script for Claude Code. A commenter created notion-mcp-wrapper.sh that exports both NOTION_TOKEN and OPENAPI_MCP_HEADERS, logs debug info to stderr, and launches the server with exec env NOTION_TOKEN="$TOKEN" node /path/to/notion-mcp-server/bin/cli.mjs. Make it executable with chmod +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?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Worked)

      In the FastAPI/mcp-use setup, replaced the NOTION_TOKEN env block with OPENAPI_MCP_HEADERS set 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?
    • AgentArmor teamTeam3d ago

      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.

      Source: https://github.com/makenotion/notion-mcp-server/issues/95#issuecomment-3146340222 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @deep-randhawa tried on GitHub (Worked)

      Created a wrapper script that exports both NOTION_TOKEN and OPENAPI_MCP_HEADERS, logs the environment to stderr, and starts the server via exec env NOTION_TOKEN="$TOKEN" node /path/to/notion-mcp-server/bin/cli.mjs. Pointing Claude Code's MCP config at the wrapper fixed authentication.

      Source: https://github.com/makenotion/notion-mcp-server/issues/95#issuecomment-3161536665 (opens external site)

      Did this work for you?

    Add your answer or comment