Skip to content

MCP client doesn't follow specification for Authentication #1492

Closed as not planned

Description

@paoloricciuti

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 )

Activity

  1. self-assigned this
    on Aug 4, 2025
  2. clouatre commented on Sep 14, 2025

    @clouatre

    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

  3. the-vampiire commented on Oct 4, 2025

    @the-vampiire

    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

  4. rekram1-node commented on Oct 4, 2025

    @rekram1-node
    Contributor

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

  5. the-vampiire commented on Oct 5, 2025

    @the-vampiire

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

  6. rekram1-node commented on Oct 6, 2025

    @rekram1-node
    Contributor

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

  7. the-vampiire commented on Oct 7, 2025

    @the-vampiire

    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.

  8. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions