Skip to content

Unauthenticated streamable HTTP MCP servers are reported as SSE errors instead of missing auth #16247

@jonahsnider

Description

@jonahsnider

Description

If you connect to a streamable HTTP MCP server that doesn't support SSE, running /status in the TUI will show you that OpenCode encountered an error when connecting. This is kinda true, but it should then try using streamable HTTP, which would then get a 401 and prompt the user to authenticate.

Plugins

N/A

OpenCode version

1.2.18

Steps to reproduce

  1. Add an MCP server that supports streamable HTTP, but not SSE (ex. the Sanity MCP)
    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "sanity": {
          "type": "remote",
          "url": "https://mcp.sanity.io",
          "oauth": {}
        }
      }
    }
  2. Run opencode and then /status
  3. Observe that the sanity MCP server says "SSE error: Non-200 status code (405)", instead of saying the server needs to be authenticated via OAuth

Screenshot and/or share link

Screenshot of /status in OpenCode TUI

Operating System

macOS 26.3

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions