MCP with oauth doesn't work #3504

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

Originally created by @klaudworks on GitHub (Dec 12, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Configured MCP like this inside my project:

"mcp": {
  "jira": {
    "type": "remote",
    "url": "https://mcp.atlassian.com/v1/sse"
  }
},

opencode mcp auth jira shows:

opencode mcp auth jira

┌  MCP OAuth Authentication
│
▲  No OAuth-enabled MCP servers configured
│
●  Add OAuth config to a remote MCP server in opencode.json:
│
●
│    "mcp": {
│      "my-server": {
│        "type": "remote",
│        "url": "https://example.com/mcp",
│        "oauth": {
│          "scope": "tools:read"
│        }
│      }
│    }
│
└  Done
Image

I thought it may also help to try to invoke the tools and then the Oauth process will start but the agent doesn't know the tools.

OpenCode version

1.0.150

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macOS 26.1

Terminal

iTerm 2

Originally created by @klaudworks on GitHub (Dec 12, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Configured MCP like this inside my project: ``` "mcp": { "jira": { "type": "remote", "url": "https://mcp.atlassian.com/v1/sse" } }, ``` opencode mcp auth jira shows: ``` opencode mcp auth jira ┌ MCP OAuth Authentication │ ▲ No OAuth-enabled MCP servers configured │ ● Add OAuth config to a remote MCP server in opencode.json: │ ● │ "mcp": { │ "my-server": { │ "type": "remote", │ "url": "https://example.com/mcp", │ "oauth": { │ "scope": "tools:read" │ } │ } │ } │ └ Done ``` <img width="1051" height="385" alt="Image" src="https://github.com/user-attachments/assets/32059d3a-fe91-4a2b-8486-97bef2ac84fc" /> I thought it may also help to try to invoke the tools and then the Oauth process will start but the agent doesn't know the tools. ### OpenCode version 1.0.150 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System macOS 26.1 ### Terminal iTerm 2
yindo added the bug label 2026-02-16 17:40:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 12, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #5373: [FEATURE]: Allow to enable MCP on a per-agent basis (related MCP configuration challenges)
  • #5371: [FEATURE]: Support MCP servers that require POST-based or non-standard SSE handshake (related MCP server compatibility)
  • #5328: Remote MCPs with auth header broke in latest update (related to MCP authentication in recent versions)
  • #5299: {env:...} variable substitution inconsistently fails for specific MCP server URLs (related to MCP configuration and environment variables)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 12, 2025): This issue might be a duplicate of existing issues. Please check: - #5373: [FEATURE]: Allow to enable MCP on a per-agent basis (related MCP configuration challenges) - #5371: [FEATURE]: Support MCP servers that require POST-based or non-standard SSE handshake (related MCP server compatibility) - #5328: Remote MCPs with auth header broke in latest update (related to MCP authentication in recent versions) - #5299: `{env:...}` variable substitution inconsistently fails for specific MCP server URLs (related to MCP configuration and environment variables) Feel free to ignore if none of these address your specific case.
Author
Owner

@jmhill commented on GitHub (Dec 18, 2025):

I got the same issue (opencode mcp auth atlassian failed with the same message about No Oauth-enabled MCP servers configured), but when I set up opencode.json to use the local proxy instead, I was able to use Atlassian MCP. Not a solution, but hopefully a workaround that could help.

{
	"$schema": "https://opencode.ai/config.json",
	"mcp": {
		"atlassian": {
			"type": "local",
			"command": ["npx", "-y", "mcp-remote", "https://mcp.atlassian.com/v1/sse"]
		}
	}
}
@jmhill commented on GitHub (Dec 18, 2025): I got the same issue (`opencode mcp auth atlassian` failed with the same message about No Oauth-enabled MCP servers configured), but when I set up opencode.json to use the local proxy instead, I was able to use Atlassian MCP. Not a solution, but hopefully a workaround that could help. ``` { "$schema": "https://opencode.ai/config.json", "mcp": { "atlassian": { "type": "local", "command": ["npx", "-y", "mcp-remote", "https://mcp.atlassian.com/v1/sse"] } } } ```
Author
Owner

@daraghscopey commented on GitHub (Dec 19, 2025):

I got a similar issue in trying to connect the linear remote mcp server.

I had to add this "oauth": {} to the config, and then when I ran opencode mcp auth linear it properly kicked off the auth flow.

{
    "$schema": "https://opencode.ai/config.json",
    "mcp": {
        "linear": {
            "type": "remote",
            "url": "https://mcp.linear.app/mcp",
            "enabled": true,
           "oauth": {}
        }
    }
}
@daraghscopey commented on GitHub (Dec 19, 2025): I got a similar issue in trying to connect the linear remote mcp server. I had to add this `"oauth": {}` to the config, and then when I ran `opencode mcp auth linear` it properly kicked off the auth flow. ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "linear": { "type": "remote", "url": "https://mcp.linear.app/mcp", "enabled": true, "oauth": {} } } } ```
Author
Owner

@klaudworks commented on GitHub (Dec 19, 2025):

thank you. adding "oauth": {} actually fixed it.

@klaudworks commented on GitHub (Dec 19, 2025): thank you. adding `"oauth": {}` actually fixed it.
Author
Owner

@tedmahsun commented on GitHub (Feb 1, 2026):

For me what worked was changing the http://127.0.0.1 url (on the page that failed) to http://localhost. :/

@tedmahsun commented on GitHub (Feb 1, 2026): For me what worked was changing the `http://127.0.0.1` url (on the page that failed) to `http://localhost`. :/
Author
Owner

@seannetlife commented on GitHub (Feb 10, 2026):

fyi. sometimes i have to explicitly logout and log back in to reauthenticate

opencode mcp logout atlassian
opencode mcp auth atlassian
@seannetlife commented on GitHub (Feb 10, 2026): fyi. sometimes i have to explicitly logout and log back in to reauthenticate ``` opencode mcp logout atlassian opencode mcp auth atlassian ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3504