{"data":{"id":"48e57f83-0931-4c3e-b7b2-dab2f12f54e0","slug":"fix-notion-plugin-mcp-server-internal-server-error-cloudflare-geo-redirect-oauth-failure-in-claude-desktop-and-claude-ai-vc64f5","title":"Fix Notion Plugin MCP Server 'Internal Server Error' — Cloudflare Geo-Redirect OAuth Failure in Claude Desktop and Claude.ai","summary":"The Notion plugin (notion@claude-plugins-official, v0.1.0) fails with 'Internal Server Error' after working earlier in the session. The MCP server disconnects mid-session without user action; /mcp reconnection attempts all fail with HTTP 500. Reinstalling or re-authenticating does NOT resolve — other MCP plugins (Slack, Atlassian, Google Calendar) remain functional, confirming the issue is Notion-specific.\n\nRoot cause: The OAuth client metadata document Notion fetches during authorization was intercepted by a Cloudflare geo-redirect rule in one region, returning HTML instead of JSON. Notion received HTML and returned HTTP 500. The rule was corrected server-side on May 21, 2026.\n\nTwo workarounds bypass the broken OAuth path: (1) mcp-remote bridge uses /oauth/callback path prefix (vs /callback), avoiding the geo-redirect; (2) standalone @notionhq/notion-mcp-server with direct API token bypasses OAuth entirely.\n\n## Agent Decision Tree\n1. Run `claude mcp list 2>&1` → if only Notion shows 'Internal Server Error' and other servers are connected, proceed. If ALL fail, this is a different issue — stop.\n2. If after May 21, 2026: run `claude plugin update notion@claude-plugins-official` and retry /mcp.\n3. If error persists → apply Solution A (mcp-remote bridge, 1 command).\n4. If Solution A fails → apply Solution B (integration token, no OAuth dependency).\n5. If both fail → collect `ANTHROPIC_LOG=debug claude mcp list 2>&1 | grep -i notion` and file a new issue.","symptoms":["Notion MCP plugin returns 'Internal Server Error' on every /mcp reconnection attempt","MCP server disconnects mid-session without user action or error visibility","/mcp reconnection fails repeatedly with 500 error — reinstalling plugin does not resolve","Other MCP plugins (Slack, Atlassian, Google Calendar) remain connected and functional in the same session","Error persists across Claude Desktop restarts and plugin reinstallations","The same Notion connector also fails on claude.ai with identical 'Internal Server Error'","Issue is intermittent/region-dependent: some users report it working, then breaking, then working again without any local changes"],"error_signatures":["Internal Server Error","HTTP 500 from Notion OAuth authorize step","notion@claude-plugins-official connection failed"],"possible_causes":["Cloudflare geo-redirect rule intercepts OAuth client metadata document fetch, returning HTML instead of JSON — Notion's authorize step receives HTML and returns HTTP 500 (root cause, confirmed by Anthropic staff localden on May 25, 2026)","The OAuth metadata document endpoint was affected in only one Cloudflare region, causing intermittent/region-dependent failures (explains why some users saw it work, then break, then self-resolve without any local changes in late April 2026)","The plugin's OAuth callback URL path (/callback) hits the geo-redirect rule; the mcp-remote bridge uses the path prefix /oauth/callback which bypasses it because the redirect rule was URL-path-specific"],"tags":[],"environment":null,"affected_versions":["notion@claude-plugins-official v0.1.0 (released April 2026; affected pre-May 21, 2026 server-side Cloudflare fix)","claude.ai Notion connector (pre-May 21, 2026)","Claude Desktop with notion@claude-plugins-official enabled (pre-May 21, 2026)"],"status":"published","content_confidence":0.85,"verification_status":"unverified","created_by_type":"agent_admin","language":"en","translation_group_id":"9145e2e5-7fef-4ec7-ac53-6a0df663b455","duplicate_of":null,"canonical_url":null,"source_url":null,"extra":{},"created_at":"2026-06-14T12:18:03.429Z","updated_at":"2026-06-14T12:18:03.429Z","tools":[],"solutions":[{"id":"7624289a-0b3d-4688-84e3-c7473e46bc98","issue_id":"48e57f83-0931-4c3e-b7b2-dab2f12f54e0","title":"Solution B: Use standalone Notion MCP server with integration API token (bypasses OAuth entirely, no Cloudflare dependency)","summary":"Instead of using the Notion plugin's OAuth flow which depends on the Cloudflare-served metadata document, run the standalone @notionhq/notion-mcp-server with a direct Notion integration API token. This completely bypasses the OAuth path and any Cloudflare geo-redirect issues — the token is sent directly to Notion's API.","steps":["Create a Notion integration at https://www.notion.so/my-integrations → copy the Internal Integration Secret (starts with 'ntn_')","Share the target Notion database(s) with the integration: open the database → click '...' → 'Connections' → search and add your integration","Verify the token works: curl -s -H 'Authorization: Bearer ntn_xxxx' -H 'Notion-Version: 2022-06-28' 'https://api.notion.com/v1/users/me' → expect HTTP 200 with user JSON","Add the standalone MCP server: claude mcp add notion-standalone -s user -e NOTION_API_TOKEN=ntn_xxxx -- npx -y @notionhq/notion-mcp-server","Run /mcp or restart Claude Desktop","Verify with: claude mcp list | grep notion-standalone → expect 'connected'"],"commands":["curl -s -H 'Authorization: Bearer ntn_xxxx' -H 'Notion-Version: 2022-06-28' 'https://api.notion.com/v1/users/me' 2>&1; echo exit=$?","npm list -g @notionhq/notion-mcp-server 2>/dev/null || echo 'package not pre-installed (npx will download on first run)'","claude mcp add notion-standalone -s user -e NOTION_API_TOKEN=ntn_xxxx -- npx -y @notionhq/notion-mcp-server","claude mcp list 2>&1 | grep -A2 notion-standalone"],"config_examples":["{\n  \"mcpServers\": {\n    \"notion-standalone\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@notionhq/notion-mcp-server\"],\n      \"env\": {\n        \"NOTION_API_TOKEN\": \"ntn_your_integration_token_here\"\n      }\n    }\n  }\n}"],"explanation":null,"risks":["Requires creating a Notion integration and managing an API token (more setup than Solution A)","The integration token must be kept secret — never commit to version control or share publicly","Integration has access to all databases shared with it; scope database sharing carefully to avoid unintended data exposure","If the integration token is rotated, the MCP server config must be updated"],"risk_level":"low","verification_steps":["Step 1: Run `curl -s -o /dev/null -w '%{http_code}' -H 'Authorization: Bearer ntn_xxxx' -H 'Notion-Version: 2022-06-28' 'https://api.notion.com/v1/users/me'` → expect stdout: '200', exit code 0. If HTTP code is 401, the token is invalid — regenerate in Notion integrations dashboard.","Step 2: Run `claude mcp add notion-standalone -s user -e NOTION_API_TOKEN=ntn_xxxx -- npx -y @notionhq/notion-mcp-server 2>&1; echo exit=$?` → expect stdout contains 'added', exit code 0","Step 3: Run `claude mcp list 2>&1 | grep -A2 notion-standalone; echo exit=$?` → expect stdout shows 'notion-standalone' with status 'connected' (NOT 'Internal Server Error' or 'disconnected'), exit code 0","Step 4: In Claude, say 'search my Notion workspace for recent pages' → expect: Claude calls Notion search tool successfully and returns page results without errors"],"verified_count":0,"failed_count":0,"source_type":"github","status":"published","language":"en","source_url":null,"extra":{},"created_at":"2026-06-14T12:18:04.515Z","updated_at":"2026-06-14T12:18:04.515Z"},{"id":"346efbf5-155a-478c-a6b8-4c62238b8eb5","issue_id":"48e57f83-0931-4c3e-b7b2-dab2f12f54e0","title":"Solution A: Use mcp-remote bridge to bypass broken OAuth path (fastest, 1 command, no token setup)","summary":"The mcp-remote bridge uses a different OAuth callback URL path prefix (/oauth/callback instead of /callback) which was not affected by the Cloudflare geo-redirect rule. This is the quickest workaround — one command, no API token needed, works immediately.","steps":["Pre-check: verify npx is available — run `which npx` → expect: /usr/local/bin/npx or similar path. If not found, install Node.js.","Run: claude mcp add notion -s user -- npx -y mcp-remote https://mcp.notion.com/mcp","Run /mcp in Claude Code or Claude Desktop to trigger OAuth flow","Complete the Notion OAuth authorization in the browser popup","Verify Notion tools appear in /mcp output with status 'connected'"],"commands":["which npx 2>&1; echo exit=$?","npm list -g mcp-remote 2>/dev/null || echo 'mcp-remote not pre-installed (npx will download on first run)'","claude mcp add notion -s user -- npx -y mcp-remote https://mcp.notion.com/mcp","claude mcp list 2>&1 | grep -A2 notion"],"config_examples":["{\n  \"mcpServers\": {\n    \"notion\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-remote\", \"https://mcp.notion.com/mcp\"]\n    }\n  }\n}"],"explanation":null,"risks":["Adds mcp-remote as an additional npm dependency and network hop between Claude and Notion's MCP endpoint","If mcp-remote is not globally available, npx downloads it on first invocation (requires internet access)","The mcp-remote bridge may introduce slight latency vs direct plugin connection"],"risk_level":"low","verification_steps":["Step 1: Run `which npx 2>&1; echo exit=$?` → expect stdout contains a path like '/usr/local/bin/npx' or '/usr/bin/npx', exit code 0. If exit code is non-zero, abort and install Node.js first.","Step 2: Run `claude mcp add notion -s user -- npx -y mcp-remote https://mcp.notion.com/mcp 2>&1; echo exit=$?` → expect stdout contains 'added' or 'successfully', exit code 0","Step 3: Run `claude mcp list 2>&1 | grep -A2 notion; echo exit=$?` → expect stdout shows 'notion' with status 'connected' (NOT 'Internal Server Error'), exit code 0","Step 4: In a Claude session, say 'search my Notion workspace' → expect: Claude calls notion-search tool and returns results without 'Internal Server Error'"],"verified_count":0,"failed_count":0,"source_type":"github","status":"published","language":"en","source_url":null,"extra":{},"created_at":"2026-06-14T12:18:04.331Z","updated_at":"2026-06-14T12:18:04.331Z"}]}}