[BUG] Claude Code MCP Server OAuth authentication doesn't work in SSH remote sessions
Environment
- Platform (select one):
- [ ] Anthropic API
- [X] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 0.2.122 <!-- output of
claude --version--> - Operating System: macOS 15.4.1 <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->
- Terminal: Iterm2 <!-- e.g. iTerm2, Terminal App -->
Bug Description
Claude Code MCP authentication doesn't work in SSH remote sessions.
I was testing linear MCP, and the authentication worked locally. However, when I joined through an SSH session to my Remote Development Environment using SSH, the authentication process didn't work as there was no way to access a browser remotely.
linear:
Scope: Local (private to you in this project)
Type: stdio
Command: npx -y mcp-remote https://mcp.linear.app/sse
Args:
Environment:
These are the mcp-logs:
[
{
"error": "Connection failed: spawn npx -y mcp-remote https://mcp.linear.app/sse ENOENT",
"timestamp": "2025-05-19T19:43:39.452Z",
"sessionId": "2ef38d86-08ff-4331-b58c-91b977b6d207",
"cwd": "/home/owner/src/..."
}
]
When I try to connect using SSE instead of stdio, it returns 401.
The same setup worked in Cursor and the Claude desktop, since they are all local.
<!-- A clear and concise description of the bug -->
Steps to Reproduce
- Connect to a remote server using ssh <!-- First step -->
- Add an MCP that requires OAuth Authentication<!-- Second step -->
- Run claude<!-- And so on... -->
Expected Behavior
I expect a prompt similar to AWS auth, which tries to open locally, but since it's an SSH connection, it also allows me to add the authorization token
<!-- What you expected to happen -->
Actual Behavior
It returned 401
<!-- What actually happened -->
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
13 Comments
I'm running into similar issues setting up Linear in Cursor, and as you wrote it was working for you in Cursor, how did you set it up? I followed their instructions but get these errors as well:
config
errors
I am having the same issue running Claude Code on Windows 11 in WSL on a snapdragon X-Elite laptop.
I have a workaround for this issue with the following
npm install -g mcp-remotemcp-remote https://mcp.linear.app/ssego through the auth process so it can be cachedclaude mcp add linear mcp-remote https://mcp.linear.app/sseclaude --debugcode up and should see success logsWhen in doubt. MCP remote. lol unfortunately. But it seems to be getting better.
Would like to see this prioritized; it's been nearly 3 months
And another month has gone by without this being addressed
Checks notes It's still broken. This is so annoying cuz if you're remote you think it just doesn't work. You can also just use API keys btw with this solution
claude mcp add --transport http <service-name> <service-url> --header "Authorization: Bearer <your-api-key>"This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
It is EXTREMELY disappointing that Anthropic doesn't understand how important this issue is in corporate environments. Not resolving this since MAY 2025 is insane.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
Both the bot's behavior in closing this prematurely and Anthropic ignoring this enterprise important feature is disappointing
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.