Agent guide

OpenCode Setup

Paste this into your agent

Start with this visible request when you want the agent to help. It keeps the action coming from you, while the linked setup reference stays plain and non-recursive.

Use this in the app you are connecting, then approve only the browser login, app setting, or restart steps that the app requires.

Please help me set up Core for OpenCode. Core is a home base for AI agents: it keeps memory, files, decisions, tasks, and work context synced across tools, harnesses, and models.

Use this official setup reference:
https://gradien.ai/core/docs/reference.txt

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:

  1. Use OpenCode native MCP setup first: opencode mcp add core https://core.gradien.ai/mcp.
  2. If the user wants a guided CLI walkthrough, run the setup CLI with --harness opencode --yes.
  3. 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.
  4. After registration, verify with opencode mcp list or the current OpenCode MCP status command.
  5. Only run opencode mcp auth core if OpenCode says Core is unauthenticated, auth is stale, or verification cannot load tools.
  6. If opencode mcp auth core prompts core already has valid credentials. Re-authenticate?, choose No unless you intentionally need to replace credentials. Then return to verification with opencode mcp list or opencode mcp debug core.
  7. If OpenCode still reports needs_auth after valid credentials, run opencode mcp logout core, then opencode mcp auth core once, and check the protected-resource metadata/scopes before retrying loops.
  8. Verify Core tools after auth completes. If tools are missing, restart OpenCode or start a fresh OpenCode session.