claude-code
claude-code copied to clipboard
[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:
- Claude CLI version: 0.2.122
- Operating System: macOS 15.4.1
- Terminal: Iterm2
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.
Steps to Reproduce
- Connect to a remote server using ssh
- Add an MCP that requires OAuth Authentication
- Run claude
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
Actual Behavior
It returned 401
Additional Context
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
{
"mcpServers": {
"linear": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.linear.app/sse"]
}
}
errors
[info] near: Starting new stdio process with command: npx -y mcp-remote https://mcp.linear.app/sse
[info] near: Client closed for command
[info] near: Handling ListOfferings action
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 cached- Setup mcp in claude
claude mcp add linear mcp-remote https://mcp.linear.app/sse - Start
claude --debugcode up and should see success logs
When 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
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>"