[BUG] Title: Atlassian remote MCP OAuth token always has empty scope, causing connection failure
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
After completing the OAuth flow for the Atlassian remote MCP server (https://mcp.atlassian.com/v1/sse), the stored token in .credentials.json always has "scope": "" (empty string). As a result, the MCP server rejects the
connection despite authentication appearing to succeed.
Steps to Reproduce
- Add the Atlassian MCP server at user level:
claude mcp add --transport http --user atlassian https://mcp.atlassian.com/v1/sse
- Run /mcp → select Atlassian → authenticate
- Browser OAuth flow completes successfully
- Claude Code reports "Authentication successful, but server reconnection failed"
- Inspect ~/.claude/.credentials.json → mcpOAuth entry has "scope": ""
- Restart Claude Code → /mcp still shows connection failure
Expected Behavior
OAuth scopes should be captured and stored after the authorization flow. The MCP connection should succeed after authentication.
Actual Behavior
- "scope": "" in stored token after every auth attempt
- /mcp shows "Authentication successful, but server reconnection failed"
- After restart: "Failed to reconnect to atlassian"
- Re-authenticating multiple times does not fix the issue
Environment
- Claude Code version: 2.1.71
- OS: Ubuntu (Linux 6.8.0)
- MCP config (~/.claude.json):
{
"type": "http",
"url": "https://mcp.atlassian.com/v1/sse"
}
- Stored token (redacted, ~/.claude/.credentials.json):
{
"serverName": "atlassian",
"serverUrl": "https://mcp.atlassian.com/v1/sse",
"accessToken": "...",
"expiresAt": 1773068958380,
"scope": "",
"clientId": "...",
"refreshToken": "..."
}
Additional Notes
The Atlassian server is reachable (returns HTTP 401 without auth). The issue is that the OAuth callback is not extracting or storing the granted scopes, so the token has no permissions when used against the MCP endpoint.
Clearing the token and re-authenticating multiple times does not resolve the issue.
What Should Happen?
MCP server authenticated and working.
Error Messages/Logs
Steps to Reproduce
- Add the Atlassian MCP server at user level:
claude mcp add --transport http --user atlassian https://mcp.atlassian.com/v1/sse
- Run /mcp → select Atlassian → authenticate
- Browser OAuth flow completes successfully
- Claude Code reports "Authentication successful, but server reconnection failed"
- Inspect ~/.claude/.credentials.json → mcpOAuth entry has "scope": ""
- Restart Claude Code → /mcp still shows connection failure
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.71
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
PyCharm terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗