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

  1. 01Start riftsh remote --server https://riftsh.com on the remote host you want OpenCode to control.
  2. 02Create a scoped rft_live_... API key in the Riftsh Console.
  3. 03Open ~/.config/opencode/opencode.jsonc and add the mcp.riftsh block shown above.
  4. 04Launch opencode—your agent can now call list_devices and pass _device to 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"].

Ready to connect your first machine?