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
{{ message }}
Repository navigation
Remote MCP OAuth browser flow never triggered - Datadog MCP silently fails to authenticate #18130
When a remote MCP server requiring OAuth 2.1 + PKCE is configured (Datadog), OpenCode registers a client ID successfully and writes it to mcp-auth.json, but never initiates the browser-based authorization flow.
The MCP toggles to "loading" then "failed" with:
No auth URL surfaced to the user.
No browser window opened.
No error logged.
The mcp-auth.json entry is left with a clientId but no tokens. For comparison, the Atlassian remote MCP (same type: remote config) completes OAuth successfully and logs transport=StreamableHTTP connected with a full token set.
If your issue is distinct (i.e., the browser flow never triggered even on the very first attempt, not just after a restart), please add a note clarifying that difference so this can be tracked separately.
I am working on this issue and now it initiate the browser-based authorization flow and saving the codeId and token in mcp-auth.json file as well but the screen is showing the flow is done but the terminal showing invalid_grant - Invalid authorization code or code verifier. idk why it is happening but /mcp showing the connected to datadog mcp. Should I raise PR?
Okay so I tried reproducing and immediately hit the same issue as u, I made a pr to make our error handling better but even when it's better their error isnt rlly enough.
I did end up figuring out it was because the mcp urls need to be very specific even if u select a different region when doing the oauth flow.
"datadog": {
"type": "remote",
// The url I copied from the docs:
// "url": "https://mcp.datadoghq.com/v1/mcp",
"url": "https://mcp.us5.datadoghq.com/v1/mcp",
"enabled": true,
},
I copied that first url from docs and kept hitting the issue, but I changed to the second one (where my account is based) and it fixed it
Activity
github-actions commentedon Mar 18, 2026
This issue might be a duplicate of existing issues. Please check:
mcp-auth.jsonhasclientIdbut no tokens. That issue focuses on re-authentication after session loss, but the root cause may be the same.If your issue is distinct (i.e., the browser flow never triggered even on the very first attempt, not just after a restart), please add a note clarifying that difference so this can be tracked separately.
Vishal2002 commentedon Mar 25, 2026
I am working on this issue and now it initiate the browser-based authorization flow and saving the codeId and token in mcp-auth.json file as well but the screen is showing the flow is done but the terminal showing
invalid_grant - Invalid authorization code or code verifier.idk why it is happening but /mcp showing the connected to datadog mcp. Should I raise PR?rekram1-node commentedon Jun 27, 2026
Okay so I tried reproducing and immediately hit the same issue as u, I made a pr to make our error handling better but even when it's better their error isnt rlly enough.
I did end up figuring out it was because the mcp urls need to be very specific even if u select a different region when doing the oauth flow.
I copied that first url from docs and kept hitting the issue, but I changed to the second one (where my account is based) and it fixed it
Hope this helps