Agent Update

Harness guide

OpenCode → Agent Update

OpenCode has two config schemas in the wild and they are not compatible. Work out which one you are on before you paste anything. The wrong shape is accepted silently and the server never appears.

What you get

Once the server is added, the session has five more tools. send_message texts you. ask_question texts you a question and waits for the answer. check_replies picks up anything you have sent back. list_rooms names the group chats this agent is in and who else is in them, and send_room_message posts to one — the other agents and you all see it.

A group chat is one you made in the iPhone app, and it is yours: OpenCode cannot create one, cannot add anyone to one, and has no way to reach another agent except in a room you are in.

Nothing runs on your machine. The tools are calls to a remote server, so a session over SSH, in a container or on a cloud runner reaches your phone exactly like a local one.

OpenCode calls them like any other MCP tool, and AGENTS.md is where you tell it when to.

Add the server

Stable OpenCode puts servers directly under mcp and turns them on with enabled: true. The v2 line (opencode2) nests them under mcp.servers and uses disabled instead, which defaults to false. Config lives in opencode.json in the project, or ~/.config/opencode/opencode.json.

stable — opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "agent-update": {
      "type": "remote",
      "url": "https://api.tryagentupdate.com/v1/mcp",
      "enabled": true,
      "headers": { "Authorization": "Bearer {env:AGENT_UPDATE_TOKEN}" }
    }
  }
}
v2 — extra nesting, and oauth: false is required
{
  "mcp": { "servers": { "agent-update": {
    "type": "remote",
    "url": "https://api.tryagentupdate.com/v1/mcp",
    "oauth": false,
    "headers": { "Authorization": "Bearer {env:AGENT_UPDATE_TOKEN}" } } } }
}

On v2, leave out oauth: false and OpenCode tries an OAuth handshake instead of sending the header you configured.

Where the config lives

It is {env:AGENT_UPDATE_TOKEN}: one brace, no dollar sign. ${env:VAR} and ${VAR} are both wrong here and get passed through literally.

An unset variable resolves to an empty string instead of an error, giving a header of exactly Bearer and a 401 that looks like a rejected token. Hard-code the token for one run to rule the variable out.

Confirm it connected

Start OpenCode and check the five tools are listed. Do not diagnose with opencode mcp debug or mcp auth alone. Both have been reported not to forward configured headers (#20286), so they can fail against a server that works fine in a real session.

Making it text you unprompted

OpenCode reads AGENTS.md from the project root.

AGENTS.md
## Reaching me

Call `send_message` when a long task finishes — one sentence, result first.
Call `ask_question` with `wait_seconds: 45` when you need a decision I own.
Nothing under a minute is worth a notification.

Questions that wait

Read ask_question as an approval gate rather than a second way to send a message. Anything destructive, anything that spends money or reaches production, a requirement with two honest readings, a failure the agent cannot attribute — those are questions, and the options are the decision it would otherwise have made without you. Say what happens when a wait runs out, too: take the safe option and report it. An agent with no fallback invents one.

ask_question takes up to six tappable options and a wait_seconds between 0 and 60. Above zero, the tool call blocks until you answer or the window closes, so the run pauses instead of guessing. You can ignore the options and type a reply — the agent gets whatever you wrote.

At wait_seconds: 0 the question is sent and the run carries on. Use that for anything you want to see but do not need to gate on.

Before you file a bug

  • If you run stable and v2 on different machines, label which schema is which in your notes. Paste the stable shape into v2 and the server goes missing with no error.
  • A project opencode.json overrides the one in ~/.config/opencode. Two files, one of them stale, is a common cause of “it worked yesterday”.

Next

The five tools and their arguments are on the MCP page. The same tools over plain HTTP are on the REST page. Every other tool is on the docs index.