opencode

Add coree to opencode as an MCP server.

opencode does not have a distributable MCP plugin format. Installation requires two manual steps.

Install

Step 1 - MCP server

Edit ~/.config/opencode/opencode.json (global) or opencode.json in your project root (project-scoped), and add the coree server:

{
  "mcp": {
    "coree": {
      "type": "local",
      "command": ["npx", "--yes", "@coree-ai/coree@0.13.0", "serve"],
      "environment": {
        "COREE__MEMORY__REMOTE_AUTH_TOKEN": "{env:COREE__MEMORY__REMOTE_AUTH_TOKEN}",
        "COREE__MEMORY__REMOTE_URL": "{env:COREE__MEMORY__REMOTE_URL}",
        "COREE__INDEX__REMOTE_AUTH_TOKEN": "{env:COREE__INDEX__REMOTE_AUTH_TOKEN}",
        "COREE__INDEX__REMOTE_URL": "{env:COREE__INDEX__REMOTE_URL}"
      },
      "enabled": true,
      "timeout": 120000
    }
  }
}

Notes on the format:

Step 2 - Context file

Copy opencode.md to your project root so the agent loads coree usage instructions:

curl -fsSL https://raw.githubusercontent.com/coree-ai/opencode/main/opencode.md \
  -o opencode.md

opencode loads opencode.md from the project root as agent instructions. For a global context file that applies to all projects, add it to ~/.config/opencode/AGENTS.md instead.

Hooks

opencode does not expose lifecycle hooks for MCP integrations. Context injection is driven by the agent following the instructions in opencode.md.

Verify

After configuration, start an opencode session and run:

call the diagnose tool

The diagnose MCP tool reports server state, database status, and any initialisation errors.