claude-code - 💡(How to fix) Fix [BUG] Can't Authenticate With Notion MCP [6 comments, 7 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52922Fetched 2026-04-25 06:17:09
View on GitHub
Comments
6
Participants
7
Timeline
14
Reactions
14
Author
Timeline (top)
commented ×6labeled ×4subscribed ×3cross-referenced ×1

Error Message

I start by running claude and doing /mcp. I think click on notion and click Authenticate. I get to the first Notion page for granting permissions, check the box for redirecting to localhost, and click continue. The browser goes to a new page that just says the redirect_uri is Invalid. In CC in the terminal, it has a message about, if there's a redirect error, to copy the URL and paste it there, so I copy the entire URL out of the URL bar on the page that says Invalid redirect_uri. When I paste that in CC, it goes back to the main Notion MCP page with the option to Authenticate or Disable, except above the options it says OAuth state mismatch - possible CSRF attack. Note that I also tried copying the redirect_uri query parameter, which is itself a whole URL pointing to localhost and opening it in a separate browser window. When I do that, it simply hangs and never does anything.

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

I start by running claude and doing /mcp. I think click on notion and click Authenticate. I get to the first Notion page for granting permissions, check the box for redirecting to localhost, and click continue. The browser goes to a new page that just says the redirect_uri is Invalid. In CC in the terminal, it has a message about, if there's a redirect error, to copy the URL and paste it there, so I copy the entire URL out of the URL bar on the page that says Invalid redirect_uri. When I paste that in CC, it goes back to the main Notion MCP page with the option to Authenticate or Disable, except above the options it says OAuth state mismatch - possible CSRF attack. Note that I also tried copying the redirect_uri query parameter, which is itself a whole URL pointing to localhost and opening it in a separate browser window. When I do that, it simply hangs and never does anything.

I've already confirmed that I'm using the correct Notion and Claude accounts...it's the same account for Claude in the browser and the terminal, updated Chrome, restarted CC, and cleared site data for notion.com and notion.so. I also tried it in an incognito window where I was not logged into Claude at all.

What Should Happen?

CC should authenticate with Notion MCP and be able to use it.

Error Messages/Logs

Steps to Reproduce

  1. Run claude
  2. Give prompt /mcp
  3. Select Authenticate
  4. In the browser tab that opens, select the checkbox to allow redirect and click continue
  5. See that it shows the Invalid redirect_uri page
  6. Copy the URL from the URL bar and paste it in CC in the terminal
  7. See that it goes back to the main Notion MCP Server page with the message OAuth state mismatch - possible CSRF attack

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

No response

extent analysis

TL;DR

The issue is likely due to an invalid redirect_uri in the OAuth flow, causing an "OAuth state mismatch - possible CSRF attack" error.

Guidance

  • Verify that the redirect_uri parameter in the URL is correctly formatted and points to the expected localhost URL.
  • Check the Claude Code documentation for any specific requirements or restrictions on the redirect_uri parameter.
  • Try resetting the OAuth state in Claude Code or clearing any cached authentication tokens to see if it resolves the issue.
  • If the issue persists, attempt to reproduce the problem with a different browser or incognito window to isolate the issue.

Notes

The issue may be related to a regression in the Claude Code version 2.1.119, as it worked in a previous version. However, without more information on the last working version, it's difficult to pinpoint the exact cause.

Recommendation

Apply workaround: Try resetting the OAuth state in Claude Code or clearing any cached authentication tokens to see if it resolves the issue. This is a safe and non-invasive step that may help resolve the issue without requiring a version upgrade or code changes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING