Open-source agent · stdio MCP · setup guide 09

OpenCode
connects locally.

Set up OpenCode's local stdio MCP server and use its status command to verify the Agent Decision Kit tools.

01 / Build once

Prepare the source checkout

npm install
npm run build

Keep the absolute checkout path ready. The published npm package is not available yet; when it ships, this setup will be shorter.

02 / Add the server

opencode.json or ~/.config/opencode/opencode.json

Run `opencode mcp list` after saving the config and confirm the local server is connected.

OpenCode starts local server commands using an array, which avoids shell parsing in its JSON configuration. Project settings can override global entries.

Configuration option

Source-checkout server entry

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "agent-decision-kit": {
        "type": "local",
        "command": [
          "node",
          "/absolute/path/to/agent-decision-kit/dist/cli.js",
          "mcp"
        ]
      }
    }
  }
}

03 / Verify

Check the connection

Run `opencode mcp list` and check the server state. The current Code Mode may group MCP tools under the server name.

04 / Try a real workflow

Start with sample data

Call model_route for an authentication design task, then diff_risk_review on a fake patch and keep the outputs labeled as heuristic.

Client setup reference: OpenCode v2 MCP server docs ↗

← Browse all agent guides