Setting Official Notion MCP in n8n

Hey everyone,

I’m trying to configure the Official Notion MCP server but having issues with credentials. I’m not sure how to properly set environment variables (I already have my ntn_… token created and used in the different ways I attached).

Could anyone clarify me the way I need to introduce/format env parameters?

Note: While this configuration works properly in Claude Desktop when set in the JSON, in n8n credentials appear to be different🤔.

Thanks in advance!

My n8n setup

  • n8n version: 1.86.1
  • Running n8n via Coolify:
  • Operating system: MacOS




2 Likes

Hi @dimasph,
I have the same issue, … not sure about the syntaxe we should use in the “Environments” section.
The other (non official) Notion MCP server works.
Let me know if you find the solution
Thank you

1 Like

Same issue here. Anyone able to get the official Notion MCP working in n8n? I’m able to list tools but when trying to execute I get:
{
“response”: [
{
“result”: {
“content”: [
{
“type”: “text”,
“text”: “{"status":401,"object":"error","code":"unauthorized","message":"API token is invalid.","request_id":"4e2159f5-…"}”
}
]
}
}
]
}

It works like a charm in Claude Desktop.

Hi all,

Below is the syntax for the env:

OPENAPI_MCP_HEADERS={“Authorization”:“Bearer ntn_********”, “Notion-Version”: “2022-06-28” }

Thank you

Best regards,
Steven

I have the same issue. After inserting the above environment in the credentials

(aka, after inserting:

OPENAPI_MCP_HEADERS={“Authorization”:“Bearer ntn_********”, “Notion-Version”: “2022-06-28” }

^exactly like that)

It just changes it to __n8n_BLANK_VALUE_xxxxxxxxxxxxxxxxxxxxxxx

Then, when trying to execute the MCP ExecuteNode, it gives that the API Key is invalid and it cannot access it.

Tried literally everything I could think of, but not the faintest clue what’s going wrong or why it doesn’t work.

Anyone got some ideas or tips?

same here :confused:

Same, won’t work

Same … Nobody found a solution :confused: ?

SAME!

Let’s start a club.

1 Like

I use n8n self-hosted on Docker and I managed to make it work by adding the Environment variable into my docker-compose.yml file instead of setting it into the n8n interface.

In the “environement” section of your docker-compose.yml file :

MCP_OPENAPI_MCP_HEADERS={“Authorization”:“Bearer ntn_***”, “Notion-Version”:“2022-06-28”}

Note that it did’nt work when there was a space around the “:”

When back to n8n interface I filled “Command” , “Aguments” and leave the “Environment” field empty.

Hope it can help but I am quite new to n8n and I still wonder why it didn’t work when I filled “Environment” in n8n interface.
I think Notion MCP server is one of the few MCP server that use a KEY equal to a JSON format.

nice going to try this thanks :slight_smile:

I have the same problem.

Just not sure if adding it to the dock compose file will fix it, please if someone tried it let us know.

has anyone been able to run mcp of notion?

I tried something similar to what @robin_7 suggested and it worked. I passed the env variable when launching my docker container (and kept the env empty on the credentials). I’ve made a template that details the setup a bit more Create a Notion AI Assistant with Google Gemini for Managing Tasks & Content | n8n workflow template

2 Likes

Thanks Laura

It seems that Env can’t be empty on the credentials though. Didn’t work for me :confused:

I’ve let them empty and it worked (even if n8n filled something automatically such as n8n_blank_value_ …). Well, it was working…

Since my last comment, Notion has made some changes to their MCP. The env variable has changed a little bit (and I’ve adapted my template accordingly). But, since then, I can’t make it work. I’m unable to authenticate myself. Others users reported similar issues on the forum so I’m not sure if the issue comes from a change on n8n or on Notion MCP server. Back to step 1 it seems :expressionless_face:

Notion is also releasing a beta self-hosted MCP server but I also couldn’t make it work (again, unable to authenticate myself). Let me know if you find something.

1 Like