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

Resolved 💬 13 comments Opened May 19, 2025 by herculesggimenes 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 ↗

This issue has 13 comments on GitHub. Read the full discussion on GitHub ↗