[BUG] Claude Code MCP Server OAuth authentication doesn't work in SSH remote sessions

Status Closed — not planned
Maintainer reply None cached
Activity 13 comments · opened May 19, 2025 · closed Feb 9, 2026

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

  1. Connect to a remote server using ssh <!-- First step -->
  2. Add an MCP that requires OAuth Authentication<!-- Second step -->
  3. 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. -->

View original on GitHub ↗

13 Comments

denisyilmaz · 1 year ago

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
jmatser-reputable · 1 year ago

I am having the same issue running Claude Code on Windows 11 in WSL on a snapdragon X-Elite laptop.

linuxlewis · 1 year ago

I have a workaround for this issue with the following

  1. npm install -g mcp-remote
  2. mcp-remote https://mcp.linear.app/sse go through the auth process so it can be cached
  3. Setup mcp in claude claude mcp add linear mcp-remote https://mcp.linear.app/sse
  4. Start claude --debug code up and should see success logs
zackify · 1 year ago

When in doubt. MCP remote. lol unfortunately. But it seems to be getting better.

dcieslak19973 · 1 year ago

Would like to see this prioritized; it's been nearly 3 months

dcieslak19973 · 11 months ago

And another month has gone by without this being addressed

plappag · 9 months ago
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>"

github-actions[bot] · 8 months ago

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.

dcieslak19973 · 7 months ago

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.

github-actions[bot] · 6 months ago

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.

marcindulak · 6 months ago

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.

dcieslak19973 · 6 months ago

Both the bot's behavior in closing this prematurely and Anthropic ignoring this enterprise important feature is disappointing

github-actions[bot] · 6 months ago

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.