Source checked: 2026-06-19 Official source: https://opencode.ai/docs/mcp-servers/
OpenCode supports remote MCP server configuration and OAuth flows. Use the current OpenCode docs before changing commands. OpenCode can prompt for OAuth automatically when the server is first used; opencode mcp auth <server-name> is a manual auth/recovery command, not a mandatory install step.
Recommended setup path:
- Use OpenCode native MCP setup first:
opencode mcp add core https://core.gradien.ai/mcp. - If the user wants a guided CLI walkthrough, run the setup CLI with
--harness opencode --yes. - Prefer remote MCP plus OAuth. Do not paste long-lived connector keys into OpenCode config unless OAuth is impossible and the user explicitly approves that fallback.
- After registration, verify with
opencode mcp listor the current OpenCode MCP status command. - Only run
opencode mcp auth coreif OpenCode says Core is unauthenticated, auth is stale, or verification cannot load tools. - If
opencode mcp auth corepromptscore already has valid credentials. Re-authenticate?, choose No unless you intentionally need to replace credentials. Then return to verification withopencode mcp listoropencode mcp debug core. - If OpenCode still reports
needs_authafter valid credentials, runopencode mcp logout core, thenopencode mcp auth coreonce, and check the protected-resource metadata/scopes before retrying loops. - Verify Core tools after auth completes. If tools are missing, restart OpenCode or start a fresh OpenCode session.
