MCP client doesn't follow specification for Authentication #1038

Open
opened 2026-02-16 17:29:09 -05:00 by yindo · 6 comments
Owner

Originally created by @paoloricciuti on GitHub (Aug 1, 2025).

Originally assigned to: @thdxr on GitHub.

When opencode tries to connect to a remote MCP if the POST request to the endpoint returns 401 an authentication flow should start opening a browser allowing the user to authenticate with the mcp server.

Currently it just hangs, even preventing the chat from start (possibly related to #1001 #854 )

Originally created by @paoloricciuti on GitHub (Aug 1, 2025). Originally assigned to: @thdxr on GitHub. When `opencode` tries to connect to a remote MCP if the POST request to the endpoint returns `401` an authentication flow should start opening a browser allowing the user to authenticate with the mcp server. Currently it just hangs, even preventing the chat from start (possibly related to #1001 #854 )
Author
Owner

@clouatre commented on GitHub (Sep 14, 2025):

Enterprise MCP Testing: Authentication Gap Confirmed

We've conducted extensive enterprise MCP testing and can confirm this authentication gap has significant real-world impact.

Our Finding: When connecting to Atlassian MCP servers (https://mcp.atlassian.com/v1/sse), OpenCode hangs exactly as described instead of initiating OAuth flow.

Workaround Required: Had to deploy mcp-remote as a local proxy to bridge the authentication gap:

{
  "atlassian_server": {
    "type": "local",
    "command": ["mcp-remote", "https://mcp.atlassian.com/v1/sse"],
    "enabled": true
  }
}

Reference Implementation: Claude Code handles this correctly with native SSE transport + OAuth flows, providing seamless multi-instance enterprise authentication.

Impact: This gap forces enterprise users to rely on third-party proxy solutions, creating additional complexity and potential coordination issues for multi-tenant scenarios.

Technical details: Our comprehensive testing documented at OpenCode MCP Feasibility Report

@clouatre commented on GitHub (Sep 14, 2025): ## Enterprise MCP Testing: Authentication Gap Confirmed We've conducted extensive enterprise MCP testing and can confirm this authentication gap has significant real-world impact. **Our Finding**: When connecting to Atlassian MCP servers (`https://mcp.atlassian.com/v1/sse`), OpenCode hangs exactly as described instead of initiating OAuth flow. **Workaround Required**: Had to deploy mcp-remote as a local proxy to bridge the authentication gap: ```json { "atlassian_server": { "type": "local", "command": ["mcp-remote", "https://mcp.atlassian.com/v1/sse"], "enabled": true } } ``` **Reference Implementation**: Claude Code handles this correctly with native SSE transport + OAuth flows, providing seamless multi-instance enterprise authentication. **Impact**: This gap forces enterprise users to rely on third-party proxy solutions, creating additional complexity and potential coordination issues for multi-tenant scenarios. Technical details: Our comprehensive testing documented at [OpenCode MCP Feasibility Report](https://slalom.atlassian.net/wiki/spaces/AED/pages/5244420102/OpenCode+MCP+Feasibility+Report+Reproducing+Claude+Code+Setup)
Author
Owner

@the-vampiire commented on GitHub (Oct 4, 2025):

experiencing this issue with the cloudflare MCP. it briefly shows an error then does nothing (chat continues but MCP is locked out).

ran with --print-logs and got this

cloudflare-bindings-mcp url=https://bindings.mcp.cloudflare.com/sse error=SSE error: Non-200 status code (401) remote mcp connection failed

minimal reproduction opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "cloudflare-docs-mcp": {
      "type": "remote",
      "url": "https://docs.mcp.cloudflare.com/sse",
      "enabled": true
    },
    "cloudflare-bindings-mcp": {
      "type": "remote",
      "url": "https://bindings.mcp.cloudflare.com/sse",
      "enabled": true
    }
  }
}

then issue this command

opencode run 'please try using the cloudflare MCP tools' --print-logs

error occurs even if you are authenticated through wrangler login

@the-vampiire commented on GitHub (Oct 4, 2025): experiencing this issue with the cloudflare MCP. it briefly shows an error then does nothing (chat continues but MCP is locked out). ran with `--print-logs` and got this ```sh cloudflare-bindings-mcp url=https://bindings.mcp.cloudflare.com/sse error=SSE error: Non-200 status code (401) remote mcp connection failed ``` minimal reproduction `opencode.json` ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "cloudflare-docs-mcp": { "type": "remote", "url": "https://docs.mcp.cloudflare.com/sse", "enabled": true }, "cloudflare-bindings-mcp": { "type": "remote", "url": "https://bindings.mcp.cloudflare.com/sse", "enabled": true } } } ``` then issue this command ```sh opencode run 'please try using the cloudflare MCP tools' --print-logs ``` error occurs even if you are authenticated through `wrangler login`
Author
Owner

@rekram1-node commented on GitHub (Oct 4, 2025):

Yeah @thdxr has been working on remote mcp support, should be here soon.

@rekram1-node commented on GitHub (Oct 4, 2025): Yeah @thdxr has been working on remote mcp support, should be here soon.
Author
Owner

@the-vampiire commented on GitHub (Oct 5, 2025):

if it helps i'm also experiencing an issue when using the remote-mcp package (that cloudflare suggests as a fallback).

@the-vampiire commented on GitHub (Oct 5, 2025): if it helps i'm also experiencing an issue when using the remote-mcp package (that cloudflare suggests as a fallback).
Author
Owner

@rekram1-node commented on GitHub (Oct 6, 2025):

@the-vampiire is it a separate issue or same issue

@rekram1-node commented on GitHub (Oct 6, 2025): @the-vampiire is it a separate issue or same issue
Author
Owner

@the-vampiire commented on GitHub (Oct 7, 2025):

same one. just wanted to let you know if it helps with debugging.

i tried:

  • remote
  • local (w mcp remote package)
  • with kimi k2 (zen)
  • with sonnet 4.5 (anthropic)

testing in claude code w 4.5 it worked fine.

@the-vampiire commented on GitHub (Oct 7, 2025): same one. just wanted to let you know if it helps with debugging. i tried: - remote - local (w mcp remote package) - with kimi k2 (zen) - with sonnet 4.5 (anthropic) testing in claude code w 4.5 it worked fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1038