claude-code - 💡(How to fix) Fix HTTP MCP server with OAuth: "Got new credentials, but reconnecting failed" — server never connects [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#56208Fetched 2026-05-06 06:34:17
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Code Example

"indeed": {
     "type": "http",
     "url": "https://mcp.indeed.com/claude/mcp"
   }
RAW_BUFFERClick to expand / collapse

Describe the bug

When an HTTP MCP server requires OAuth (using the standard WWW-Authenticate: Bearer + OAuth protected resource metadata flow), Claude Code successfully completes the OAuth authorization and reports "Got new credentials, but reconnecting to <server> failed. Restart Claude Code to retry." However, restarting does not help — the server remains disconnected and continues returning 401.

Steps to reproduce

  1. Add an HTTP MCP server that requires OAuth to a project in ~/.claude.json:
    "indeed": {
      "type": "http",
      "url": "https://mcp.indeed.com/claude/mcp"
    }
  2. Run /mcp and select "Authenticate" for the server
  3. Complete the OAuth flow in the browser (redirect to localhost callback succeeds)
  4. Claude Code shows: "Got new credentials, but reconnecting to indeed failed. Restart Claude Code to retry."
  5. Restart Claude Code — server still shows as unauthenticated / returns 401

Expected behavior

After completing OAuth, the server should connect successfully and its tools should be available.

Environment

  • Claude Code version: 2.1.128
  • OS: macOS 25.4.0
  • MCP server: https://mcp.indeed.com/claude/mcp (OAuth via https://secure.indeed.com/)

extent analysis

TL;DR

The issue may be resolved by re-examining the OAuth flow and ensuring that the obtained credentials are correctly stored and used for subsequent requests to the MCP server.

Guidance

  • Verify that the OAuth callback to localhost is correctly handled and that the authorization code is exchanged for an access token.
  • Check the ~/.claude.json configuration file to ensure that the indeed server settings are correct and that the OAuth credentials are properly stored.
  • Investigate the 401 error response from the server to determine if the issue is related to invalid or missing credentials.
  • Consider adding logging or debugging statements to the Claude Code OAuth flow to better understand the issue.

Example

No code example is provided as the issue does not contain sufficient information about the specific OAuth implementation.

Notes

The issue may be related to a misconfiguration of the OAuth flow or an issue with the MCP server's authentication mechanism. Further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Re-examine and reconfigure the OAuth flow to ensure correct handling of credentials and authentication with the MCP server. This is recommended as the issue seems to be related to the authentication mechanism, and reconfiguring the OAuth flow may resolve the issue.

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…

FAQ

Expected behavior

After completing OAuth, the server should connect successfully and its tools should be available.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix HTTP MCP server with OAuth: "Got new credentials, but reconnecting failed" — server never connects [1 comments, 2 participants]