runelay

runelay+OpenCodeGuide

Connect OpenCode to Runelay

Runelay, an open source MCP gateway, gives OpenCode one endpoint for every account you connected. Add it once and OpenCode sees the same tools, skills and memories as your other agents.

What OpenCode gets

Without a gateway, OpenCode connects to every MCP server on its own, loads each full tool list at connect and keeps its own logins.

With Runelay it connects to one endpoint, /v1/mcp. The gateway holds the credentials and exposes a small set of tools to search and call everything behind it. In our benchmark that was 1,045 context tokens at connect for 125 tools (Runelay 0.3.2, 14 Nov 2026, full numbers).

Set it up

  1. Run Runelay

    Use the desktop app, or install the server with Docker. Both serve the panel and the MCP endpoint on port 4312.

    $curl -fsSL runelay.com/install | sh
  2. Create a key

    In the panel, the agent setup guide creates a key that starts with rnl_. Each agent can have its own key, so you can revoke one without touching the others.

  3. Add it to ~/.config/opencode/opencode.json

    OpenCode reads MCP servers from the mcp key. A remote server is type: "remote", and oauth: false tells OpenCode to use the key in headers instead of starting a browser sign-in. An opencode.json inside a repo covers one project. Replace the URL and the key with yours. With the desktop app the URL is http://127.0.0.1:4312/v1/mcp.

    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "runelay": {
          "type": "remote",
          "url": "https://runelay.example.com/v1/mcp",
          "oauth": false,
          "headers": { "Authorization": "Bearer rnl_..." }
        }
      }
    }
  4. No CLI shortcut yet

    runelay connect writes Claude Code, Codex, Cursor and Grok, not OpenCode. Add Runelay by hand once; the key stays valid until you revoke it in the panel.

  5. Open a new session and check

    OpenCode connects to MCP servers when it starts. Open a new session, or run opencode mcp list to see Runelay connected.

    $opencode mcp list

Bring what you already have

runelay migrate reads the MCP servers in ~/.config/opencode/opencode.json, so the remote servers you already use there move to Runelay and every agent shares them.

runelay push sends ~/.config/opencode/skills and ~/.config/opencode/AGENTS.md, so Claude Code and Codex read the same skills and instructions.

Once connected, in OpenCode

  • search_tools and call_tool reach every connected account, such as Linear, GitHub and Notion.
  • execute chains several calls in a sandboxed JavaScript runtime.
  • search_context, read_memory and write_memory share memory with your other agents.
  • read_skill serves the same skills to every agent.

Questions

Do my account tokens reach OpenCode?

No. OpenCode only holds the Runelay key. OAuth tokens and API keys stay on your server, encrypted with AES-256-GCM using your RUNELAY_SECRET.

Do I need Docker?

No. The desktop app for Mac, Windows and Linux runs the same server on your computer. Docker is for a server that stays on.

Can I keep the MCP servers I already configured?

Yes. Runelay is one more MCP server in the config. If you migrate them, running runelay migrate --replace removes the migrated ones and leaves only Runelay.

Why oauth: false?

OpenCode tries OAuth on every remote server unless oauth is false. Runelay authenticates with the rnl_ key in the Authorization header, so there is nothing to sign in to.

Try it on your machineFree and open source. Runs on your computer or your server.
Download runelayInstall on your server