Description
When running opencode mcp auth gdrive to authenticate with the Google Drive MCP server, the command outputs "Authentication successful!" but the OAuth flow never completes. The browser never opens, and no tokens are saved.
- opencode mcp auth gdrive starts the OAuth flow but fails to open the browser (mcp.browser.open.failed in logs)
- Without the browser opening, the user can't authorize, so no tokens are received
- The command incorrectly says "Authentication successful!" even though it failed
- All GDrive operations return "Unauthorized"
Expected behavior:
- Browser should open with Google OAuth authorization URL
- After authorizing, tokens should be saved to ~/.local/share/opencode/mcp-auth.json
- opencode mcp auth list should show "authenticated"
Actual behavior:
- Logs show mcp.browser.open.failed event
- No browser window opens
- Command prints "Authentication successful!" incorrectly
- Tokens file ends up as {"gdrive": {}} (empty)
- All GDrive operations return "Unauthorized"
Environment:
Logs:
INFO service=mcp.oauth-callback port=19876 path=/mcp/oauth/callback oauth callback server started
...
INFO service=bus type=mcp.browser.open.failed subscribing
...
◇ Authentication successful!
Additional context:
The opencode mcp debug gdrive command reports "Server responded successfully (no auth required or already authenticated)" because the Drive MCP server returns HTTP 200 even without authentication, so OpenCode doesn't detect that OAuth is needed until tools are actually called.
Plugins
MCP server: Google Drive (https://drivemcp.googleapis.com/mcp/v1)
OpenCode version
1.14.39
Steps to reproduce
-
Configure Google Drive MCP in opencode.json:
{
mcp: {
gdrive: {
type: remote,
url: https://drivemcp.googleapis.com/mcp/v1,
oauth: {
clientId: ...,
clientSecret: ...,
scope: https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.file
}
}
}
}
-
Run opencode mcp auth gdrive --print-logs
Screenshot and/or share link
Operating System
Ubuntu 24.04.4 LTS (Noble Numbat)
Terminal
ps (bash)
Description
When running opencode mcp auth gdrive to authenticate with the Google Drive MCP server, the command outputs "Authentication successful!" but the OAuth flow never completes. The browser never opens, and no tokens are saved.
Expected behavior:
Actual behavior:
Environment:
Logs:
INFO service=mcp.oauth-callback port=19876 path=/mcp/oauth/callback oauth callback server started
...
INFO service=bus type=mcp.browser.open.failed subscribing
...
◇ Authentication successful!
Additional context:
The opencode mcp debug gdrive command reports "Server responded successfully (no auth required or already authenticated)" because the Drive MCP server returns HTTP 200 even without authentication, so OpenCode doesn't detect that OAuth is needed until tools are actually called.
Plugins
MCP server: Google Drive (https://drivemcp.googleapis.com/mcp/v1)
OpenCode version
1.14.39
Steps to reproduce
Configure Google Drive MCP in opencode.json:
{
mcp: {
gdrive: {
type: remote,
url: https://drivemcp.googleapis.com/mcp/v1,
oauth: {
clientId: ...,
clientSecret: ...,
scope: https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/drive.file
}
}
}
}
Run opencode mcp auth gdrive --print-logs
Screenshot and/or share link
Operating System
Ubuntu 24.04.4 LTS (Noble Numbat)
Terminal
ps (bash)