OpenCode Remote MCP Setup & opencode.jsonc Configuration Guide
Connect OpenCode (opencode.jsonc) to Riftsh's Streamable HTTP MCP gateway so coding agents and subagent workflows run commands and surgical edits across remote hosts.
~/.config/opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"riftsh": {
"type": "remote",
"url": "https://riftsh.com/mcp",
"enabled": true,
"headers": {
"Authorization": "Bearer rft_live_YOUR_SECRET_KEY"
}
}
}
}Need custom _device host routing or directory guardrails?Open Interactive MCP Config Generator
1. Install & pair host
$ curl -fsSL https://riftsh.com/install.sh | sh
$ riftsh remote
2. Configure OpenCode CLI
- 01Start
riftsh remote --server https://riftsh.comon the remote host you want OpenCode to control. - 02Create a scoped
rft_live_...API key in the Riftsh Console. - 03Open
~/.config/opencode/opencode.jsoncand add themcp.riftshblock shown above. - 04Launch
opencode—your agent can now calllist_devicesand pass_deviceto target any online machine.
FAQ
Should I set type to local or remote in opencode.jsonc?
Use "type": "remote" with url and headers to orchestrate your cloud-paired fleet over HTTPS. For local-only execution on the same machine, set "type": "local" with "command": ["riftsh"].
Other clients