Connect OpenCode to Niro
One command connects OpenCode to Niro:
niro mcp install --client opencode
Then restart OpenCode, because it reads its settings only when it starts.
You must have run niro start first, so that you are signed in. See Connect your coding agent to Niro.
What the install writes
- The connection, under
mcp(typelocal), in~/.config/opencode/opencode.json.
How OpenCode learns to use Niro
- A section in
~/.config/opencode/AGENTS.md.
Check that it works
Ask it a question about your code, such as "which routes does this project serve?". An answer from Niro starts with "Answered from the local graph on this machine (niro-local)."
Remove it
niro mcp uninstall --client opencode
If something goes wrong, see FAQ: coding agents and MCP.