OpenCode registers MCP servers under its own mcp key and reads AGENTS.md
for instructions. Repowise writes both, at project and user scope.
Install
Local, with your agent. Paste this into OpenCode:
Read https://docs.repowise.dev/setup.md and set up Repowise in this repository.
Local, by hand. repowise init wires OpenCode when it is installed. To
wire it later:
repowise agents add --target=opencodeThe default writes the project pair and the user pair. Pass
--scope=project or --scope=user for one.
Hosted. Run in the repository, then sign in:
repowise agents add --target=opencode --hosted
opencode mcp auth repowiseWhat gets written where
| File | Scope | What repowise writes |
|---|---|---|
opencode.jsonc | project | mcp.repowise: {"type": "local", "command": ["repowise", "mcp", ...]} |
AGENTS.md | project | The managed Repowise block, shared with Codex and Hermes |
~/.config/opencode/opencode.jsonc | user | The same server entry |
~/.config/opencode/AGENTS.md | user | The managed block |
The user directory is $XDG_CONFIG_HOME/opencode when that is set, else
~/.config/opencode, on Windows too: OpenCode does not read %APPDATA%. An
existing opencode.json is updated in place. command is one array holding
the binary and its arguments, unlike the command plus args shape other
hosts use. The hosted entry is "type": "remote" with a url, named
repowise-hosted when a local repowise exists.
Restart
Quit and start OpenCode again in the repository. For a hosted entry, run
opencode mcp auth repowise (or repowise-hosted) and approve Repowise in
the browser.
Verify
opencode mcp list
repowise agentsYou should see repowise in OpenCode's list and opencode with status
configured.
Uninstall
repowise agents remove --target=opencodeThis removes the repowise entry and the managed AGENTS.md block, keeping
your own content and other servers. The block stays while Codex or Hermes
still uses it.
Troubleshooting
| Symptom | Fix |
|---|---|
opencode.jsonc left unchanged | OpenCode accepts comments in this file and repowise does not rewrite one it cannot parse as strict JSON. Run repowise agents print-config opencode and paste the entry under mcp. |
| The user entry never loads on Windows | Check it is in ~/.config/opencode, not %APPDATA%\opencode. |
AGENTS.md left unchanged | Its Repowise markers are unpaired or duplicated. Fix them by hand and re-run. |
| Only five Repowise tools are listed | OpenCode gets the core profile by default. See Tool profiles. |
Next
- Codex, which shares
AGENTS.md. - Tool profiles to list all ten tools.
- repowise agents for every flag.