[BUG] MCP OAuth Integration Fails on Production Deployments with step=start_error
Claude Desktop MCP OAuth Integration Issue Report
Issue Summary
Claude Desktop fails to complete OAuth authentication flow with a production MCP server deployment, despite the same code working correctly on a preview deployment. The OAuth flow starts but immediately fails with step=start_error before reaching the MCP server's OAuth endpoints.
Environment Details
- Date: July 14, 2025
- Claude Desktop Version: (Please add your version)
- Operating System: macOS 15.5.0
- Browser: Google Chrome 137.0.0.0
- MCP Server: @vercel/mcp-adapter on Vercel
Working vs Non-Working Deployments
✅ WORKING - Preview Deployment
- URL:
https://lifetrack-intervention-hub-git-mcp-amandeep-khuranas-projects.vercel.app/api/mcp - Branch: mcp (now deleted)
- OAuth Flow: Completes successfully
❌ NOT WORKING - Production Deployments
- Custom Domain:
https://healthtracker.amandeep.app/api/mcp - Vercel Domain:
https://lifetrack-intervention-hub.vercel.app/api/mcp
- OAuth Flow: Fails with
step=start_error
Technical Implementation
OAuth Configuration
All deployments use identical OAuth configuration:
// OAuth endpoints discovered via .well-known
{
"authorization_endpoint": "https://[domain]/api/oauth/authorize",
"token_endpoint": "https://[domain]/api/oauth/token",
"scopes_supported": ["profile", "health_data"],
"response_types_supported": ["code"],
"grant_types_supported": ["authorization_code", "refresh_token"]
}
OAuth Flow Architecture
- Claude Desktop → Claude.ai proxy (
/api/organizations/.../mcp/start-auth/...) - Claude.ai proxy → MCP server OAuth authorize endpoint
- MCP server → Frontend auth page with Supabase OAuth
- Supabase OAuth → Google authentication
- Return flow back to Claude Desktop with authorization code
Evidence of the Issue
1. Vercel Logs - Production Attempts
Jul 14 17:48:17.66 GET 401 healthtracker.amandeep.app /api/mcp - No bearer token provided
Jul 14 17:48:15.54 GET 200 healthtracker.amandeep.app /.well-known/oauth-authorization-server
Jul 14 17:48:15.36 GET 200 healthtracker.amandeep.app /.well-known/oauth-authorization-server
Jul 14 17:48:15.22 GET 200 healthtracker.amandeep.app /.well-known/oauth-protected-resource
Jul 14 17:48:15.00 GET 401 healthtracker.amandeep.app /api/mcp - No bearer token provided
Key observation: Claude successfully discovers OAuth endpoints but NEVER makes a request to /api/oauth/authorize
2. Chrome Network Logs - OAuth Start Error
Request URL: https://claude.ai/api/organizations/407923f3-0ecd-4792-bb13-e253d1b30e67/mcp/start-auth/5213f762-b394-48db-99b9-0da07f1a900f
Response: HTTP/1.1 307
Location: claude://claude.ai/new?&server=5213f762-b394-48db-99b9-0da07f1a900f&step=start_error
Key observation: Claude's OAuth proxy returns step=start_error before attempting to redirect to the MCP server
3. Direct OAuth Test - Works Correctly
When testing the OAuth flow directly (bypassing Claude's proxy):
GET https://healthtracker.amandeep.app/api/oauth/authorize?client_id=claude-desktop-test&redirect_uri=http://localhost:3000/callback&state=cs6chg4hz4b&response_type=code&scope=profile+health_data
Vercel Logs:
18:32:02.30 GET 302 /api/oauth/authorize
→ Redirecting to frontend auth with OAuth params
18:32:06.62 GET 302 /api/oauth/callback
→ Redirecting to Claude Desktop with authorization code
Final redirect URL:
http://localhost:3000/callback?code=eyJhY2Nlc3NfdG9rZW4i...[valid JWT]...&state=cs6chg4hz4b
Result: Complete OAuth flow works perfectly, returns valid authorization code containing Supabase JWT tokens
Reproduction Steps
- Open Claude Desktop
- Go to Settings → Integrations → Add Custom Integration
- Enter MCP server URL:
https://healthtracker.amandeep.app/api/mcp - Click Add/Connect
- Browser window opens briefly and immediately closes
- OAuth flow fails with no authorization attempt logged on server
What We've Verified
- ✅ OAuth endpoints are accessible and return correct metadata
- ✅ OAuth flow works when tested directly (not through Claude proxy)
- ✅ Supabase OAuth redirect URLs are configured correctly
- ✅ Same code works on preview deployment
- ✅ All environment variables are set correctly
- ✅ No CORS issues with the endpoints
- ✅ No OAuth attempts appear in Supabase authentication logs
- ✅ Issue persists after clearing Claude cache and restarting
- ✅ Both Vercel domain and custom domain exhibit same failure
Hypothesis
The issue appears to be within Claude's OAuth proxy (claude.ai/api/organizations/.../mcp/start-auth/) when handling production deployments. The proxy:
- Successfully discovers OAuth configuration
- Attempts to start the OAuth flow
- Encounters an internal error (
step=start_error) - Never redirects to the MCP server's authorize endpoint
Request for Anthropic
Please investigate why Claude's OAuth proxy fails with step=start_error for production MCP server deployments while working correctly for preview deployments. The MCP server implementation is identical in both cases.
Testing Performed
A standalone test page was created to simulate Claude Desktop's OAuth flow:
- OAuth Discovery Test: Successfully retrieved metadata from both
.well-knownendpoints - Full OAuth Flow Test: Successfully completed entire OAuth flow returning valid authorization code
- MCP Endpoint Test: Confirmed endpoint is accessible and returns expected 401 without authentication
All tests confirm the implementation is working correctly when accessed directly.
---
Report generated: July 14, 2025 with Claude Code
13 Comments
Same experience.
Any update here? Anyone able to suggest a workaround? Thanks in advance!
We are seeing this as well. Strangely claude cli works flawlessly and only claude desktop/web have the issue.
I'm also hitting this error. It's really frustrating since there's no detail on where it's going sideways. It's working fine with MCP Inspector but not in Claude Desktop
I'd highly recommend testing with Cloudflare's AI Playground if you're running into issues with Claude Desktop and Web not working when the CLI is. I was in this situation a few weeks ago, and there were several things I think were causing issues with Claude desktop which I was able to also encounter in Cloudflare's playground, but Cloudflare gave significantly more helpful error messages. Once I got it working in the playground, the remaining error I ran into at least had to do with how Claude was calling the registration endpoint for Dynamic Client Registration. It was always sending the registration call with token_endpoint_auth_method set to client_secret_post, which was failing, and since I was using a third-party IDP, I wasn't seeing that call at all, so it just looked like it failed to complete the OAuth flow.
Thanks Michelle -^ I wasn't able to use AI Playground, but I did run it through MCP-Remote again and was able to identify the problem - Entra was throwing an error based on how my callback was setup. I reclassified the callback URL and then it connected fine in MCP-Remote and on Claude Desktop.
Hi guys, I successfully got Claude Desktop (Custom Connectors) to connect to a remote MCP server with Entra OAuth authentication. The key was implementing RFC 8414 OAuth discovery endpoints (/.well-known/oauth-authorization-server, etc.) directly in my FastAPI server alongside the FastMCP endpoints. (I have a FastAPI handling Oauth on the same server as the MCP.)
I'm not an OAuth expert, so I can't vouch for the security, but it's working for my own personal MCP.
🤞can you share your endpoints on here with sanitized info? I tried this with no success a while back when I was trying to get this to work. Hoping I am missing something you have. Greatly appreciated!
I'm hesitant to be excited bc I had the full flow working with mcp inspector. I had to hard code a client id for the DCR endpoint to fit our security posture.
@cwise89 this is what i tested with
I will sanitise my server both (oauth and mcp ) over the weekend and share - my great frustration (Claude and I very nearly have gone out separate ways ) was the discovery end points - they were not as I expected - my nginx logs proved to be a life saver -
This worked! Thank you so much!!
Closing this because it's related to Claude Desktop, this repo is for Claude Code!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.