You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Reacted by Nico Duldhardt, Jeon Suyeol, Chindriș Mihai - Alexandru, AceLan Kao, Tim Dittler, Aleksandr Kirillov, ravshan-oxagile, Ted Mahsun, Andreas Ellwanger, Ivan Gavrilov and 1 more
The linear MCP server shows as "connected" in opencode mcp list, but all tool invocations fail with invalid_token — even immediately after successful OAuth authentication.
Configure Linear MCP in ~/.config/opencode/opencode.json with "oauth": {}
Run opencode mcp auth linear and complete OAuth flow successfully
Restart OpenCode to pick up config changes
Verify connection: opencode mcp list shows ✓ linear connected
Attempt to invoke any Linear MCP tool (e.g., linear_get_issue)
Expected Behavior
MCP tool should execute successfully using the authenticated OAuth token.
Actual Behavior
Failed to connect to MCP server "linear".
URL: https://mcp.linear.app/mcp
Reason: Streamable HTTP error: Error POSTing to endpoint:
{"error":"invalid_token","error_description":"Missing or invalid access token"}
Token IS obtained: debug shows valid access token and refresh token present
Auth flow succeeds: opencode mcp auth linear confirms "already has valid credentials"
Connection check passes: mcp list shows ✓ linear connected
HTTP test fails: The debug HTTP probe gets 401 Unauthorized from Linear's server
Native tools work fine: linear_get_issue (non-MCP) successfully fetches issue ACENOTE-1443
Tool execution fails: Only the actual tool invocation hits the auth error
Root Cause Analysis
The OAuth token acquisition works correctly (token is present, not expired, refresh token available), but OpenCode's MCP client is not properly attaching the token to HTTP requests when invoking tools. The 401 Unauthorized + WWW-Authenticate: Bearer response from Linear's server indicates the Authorization header is either:
Missing entirely from tool invocation requests
Malformed (wrong prefix, encoding, or format)
Not being sent through the Streamable HTTP transport layer
Closing because the original report is fixed: remote MCP OAuth is now enabled by default unless oauth: false, so an explicit oauth: {} block is no longer required. This thread has since accumulated unrelated callback, WSL, and Linear token symptoms. Please open a focused current-version issue for any remaining provider-specific failure; note that mcp debug intentionally performs an unauthenticated probe, so its 401 alone does not show that tool requests omit the OAuth token.
Activity
github-actions commentedon Dec 12, 2025
This issue might be a duplicate of existing issues. Please check:
{env:...}variable substitution inconsistently fails for specific MCP server URLs #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.
fix: MCP OAuth auth commands now recognize remote servers as OAuth-en…
jmhill commentedon Dec 19, 2025
I got the same issue (
opencode mcp auth atlassianfailed 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.daraghscopey commentedon 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 ranopencode mcp auth linearit 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": {} } } }klaudworks commentedon Dec 19, 2025
thank you. adding
"oauth": {}actually fixed it.tedmahsun commentedon Feb 1, 2026
For me what worked was changing the
http://127.0.0.1url (on the page that failed) tohttp://localhost. :/seannetlife commentedon Feb 11, 2026
fyi. sometimes i have to explicitly logout and log back in to reauthenticate
snarkipus commentedon Mar 8, 2026
This worked for me as well for linear ... I assumed it was a WSL'ism.
sghng commentedon Mar 11, 2026
This doesn't work for me. Here's what I did on Firefox:
GETrequest, double click.http://127.0.0.1:19876/mcp/oauth/callback?code=xxx&state=xxx127.0.0.1tolocalhost, and hit enterThis didn't work.
chendeshen commentedon Mar 28, 2026
solved my issue
gurvancampion commentedon Apr 23, 2026
This worked for me in my WSL environment setup
windseason commentedon May 29, 2026
this doesn't work for me.
Bug Report: Linear MCP Authentication Fails Despite Valid Credentials
Environment
Problem Summary
The
linearMCP server shows as "connected" inopencode mcp list, but all tool invocations fail withinvalid_token— even immediately after successful OAuth authentication.Configuration Used
{ "mcp": { "linear": { "type": "remote", "url": "https://mcp.linear.app/mcp", "enabled": true, "oauth": {} } } }Steps to Reproduce
~/.config/opencode/opencode.jsonwith"oauth": {}opencode mcp auth linearand complete OAuth flow successfullyopencode mcp listshows✓ linear connectedlinear_get_issue)Expected Behavior
MCP tool should execute successfully using the authenticated OAuth token.
Actual Behavior
Debug Output (
opencode mcp debug linear)Key Observations
debugshows valid access token and refresh token presentopencode mcp auth linearconfirms "already has valid credentials"mcp listshows✓ linear connected401 Unauthorizedfrom Linear's serverlinear_get_issue(non-MCP) successfully fetches issue ACENOTE-1443Root Cause Analysis
The OAuth token acquisition works correctly (token is present, not expired, refresh token available), but OpenCode's MCP client is not properly attaching the token to HTTP requests when invoking tools. The
401 Unauthorized+WWW-Authenticate: Bearerresponse from Linear's server indicates the Authorization header is either:rekram1-node commentedon Jun 24, 2026
Closing because the original report is fixed: remote MCP OAuth is now enabled by default unless
oauth: false, so an explicitoauth: {}block is no longer required. This thread has since accumulated unrelated callback, WSL, and Linear token symptoms. Please open a focused current-version issue for any remaining provider-specific failure; note thatmcp debugintentionally performs an unauthenticated probe, so its 401 alone does not show that tool requests omit the OAuth token.