# AxiosError: Request failed with status code 401 (Notion MCP not sending the Authorization header)

**TL;DR:** Verify the token works with a direct curl to the Notion API first; that isolates the server as the culprit. Make sure the server version you run actually reads the token env var; older builds dropped the header. Upgrade the server and confirm the env var name matches the README.

## The error

```
Error in http client [AxiosError]: Request failed with status code 401
```

## Fix it

1. curl the Notion API's who-am-I endpoint with your token and Notion-Version header.
   Expected: It returns 200, proving the token.
2. Check the token env var name in your MCP config against the server README.
   Expected: You find a mismatch or an old server version.
3. Upgrade @notionhq/notion-mcp-server to the latest and set the token under the documented name.
   Expected: The config matches the README.
4. Restart the client and retry.
   Expected: Calls succeed; the header is now attached.

## When this applies

The Notion token works via curl but the MCP server's own requests go out without the Authorization header and 401.

## When this does NOT apply

If curl also 401s, the token is the problem. If headers are misquoted in Docker, see the n8n headers skill.

## Tool compatibility

makenotion/notion-mcp-server, older versions

## Also seen as

- notion MCP missing authorization header
- AxiosError 401 notion-mcp-server
- notion MCP server not passing token

## Why it happens

A bug in some server builds failed to read the token env var into the HTTP client, so requests left without Authorization. The token was valid; the server just never sent it.

## Edge cases

- Debug logs showing the outgoing request confirm the missing header.
- Wrapper scripts that inject headers are a workaround, not a fix.
- Pin the working version in your config after upgrading.