OpenCode

OpenCode + WordPress: MCP setup for the free, open-source coding agent

OpenCode reads its MCP servers from opencode.json. Add Respira there and the agent can read and edit a live WordPress site across 17 page builders, on one of OpenCode's free models or on a paid one. One block of JSON, tested end to end.

OpenCode is free and open source and runs on your machine. Respira is the paid part and runs on your hosting. 340+ tools, snapshots on every write path.

What OpenCode is

OpenCode is an open-source AI coding agent for the terminal, built by SST, with its home at opencode.ai. It speaks the Model Context Protocol, which is the part that matters here: every server listed under mcp in its config becomes a set of tools it can call. Respira is one of those servers, and the site it acts on is your own WordPress install.

Two things set it apart from the other agents on this site. It ships free models through OpenCode Zen, with ids such as opencode/big-pickle, next to paid provider models such as anthropic/…. And its config shape is its own, which is where most first attempts go wrong. Both are covered below.

Looking for the no-key, no-subscription version? freecode runs the OpenCode engine and reads the same file, so the block on this page works there too.

The setup, in five steps

  1. Install OpenCode.

    Get it from opencode.ai. It runs in the terminal and its free models need no API key, so the only value you have to find is the Respira one in the next step.

  2. Open the Respira setup page and choose OpenCode.

    The page reads the sites on your account and builds an opencode.json with all of them inside. If you would rather write the file yourself, copy the RESPIRA_CONFIG_B64 value and paste it into the block below. Either way one entry covers every connected site, and you move between them by naming the site in chat.

  3. Save it where OpenCode looks.

    opencode.json at the root of the project you open OpenCode in, or ~/.config/opencode/opencode.json for every project. If OpenCode is already running, start it again so it reads the file.

  4. Check the connection.
    terminal
    opencode mcp list

    The respira-wordpress entry should report connected. If it does not, the shape section below is the first place to look.

  5. Run a first task.
    terminal
    opencode run "using respira-wordpress, list my connected WordPress sites and which page builder each one runs"

    Real site names coming back is the test. A tool list that looks right but returns nothing is usually an access level set to read-only when you wanted content.

The config

This is the block that was tested. Replace the placeholder with the base64 value from your dashboard and keep everything else as it is.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "respira-wordpress": {
      "type": "local",
      "command": ["npx", "-y", "@respira/wordpress-mcp-server"],
      "environment": {
        "RESPIRA_CONFIG_B64": "<paste from the Respira dashboard>"
      },
      "enabled": true
    }
  }
}

The file at the project root travels with the project. If the project is in git, add opencode.json to .gitignore, or use the global file under ~/.config/opencode/ instead, so the credential never sits in a repository.

The shape is not the Claude or Cursor shape

If you have connected Respira to Claude Code or Cursor before, the block you remember will not work here. OpenCode reads a different structure, and a file in the old shape is silently ignored. Three differences account for almost every failed first attempt:

The key is mcp, not mcpServers.
Servers sit under a top-level mcp object, and each one carries a type. For the Respira bridge that is "local".
command is one array that includes the binary.
Claude and Cursor split command: "npx" from args: [...]. OpenCode wants ["npx", "-y", "@respira/wordpress-mcp-server"] in a single list.
Env vars go under environment, not env.
The RESPIRA_CONFIG_B64 value lives in an environment object. An env key is dropped without a warning.

"enabled": true is optional but explicit, and it makes a server easy to switch off later without deleting the block.

Free models, and what one did on a real run

OpenCode Zen carries a set of free models next to the paid providers. On the day this page was written the ids included:

  • opencode/nemotron-3.5-lightning-free
  • opencode/mimo-v2.5-free
  • opencode/big-pickle

On a real machine, with the block above in place, a free model was asked to list the connected sites. It called respira_list_sites and listed five WordPress sites correctly. A second run called respira_get_site_context and respira_get_builder_info. The tool calls worked every time; the model itself wandered between calls and needed a retry or two before it settled.

That is the honest picture of a small free model against a live site. It is fine for a look around, a text change, a page duplicate, or a scan. For a multi-page build, a paid model inside OpenCode holds the thread better. Whatever the model, three habits keep the result clean:

Keep each task small and specific.
Name the site, name the page, describe one change. "On site A, duplicate the pricing page and change the headline to X" gets done. "Improve the site" does not.
Read the duplicate before you approve it.
Every structural write lands on a copy. The Approvals and Undo screen in wp-admin shows what changed. Publish from there, not from the chat.
Let the agent retry, and stop it when it loops.
A free model that repeats a call is not a broken server. Restate the task with the page name in it, or move the task to a paid model.

What the agent can do once it is connected

  • using respira-wordpress, list my connected sites and which page builder each one runs
  • on site A, open the pricing page and show me every heading with its styling
  • duplicate the about page on site B, rewrite the hero, and hold it for my approval
  • find every page on site A that still says 2025 and change it to 2026
  • run the accessibility scan on the homepage and list the WCAG failures
  • add a testimonial section under the hero on the services page, on a copy
  • show me the last five snapshots on this page and restore the one from Tuesday

340+ tools across posts, pages, menus, media, taxonomies, users, plugins, ACF, the WooCommerce catalog and every supported builder. See how Respira writes Elementor pages, Divi 4 and Divi 5 layouts and Bricks Builder elements in their native format. Page and element writes take a snapshot first, and structural page work is built on a duplicate.

Before you point it at a client site

The config value is a live credential.
RESPIRA_CONFIG_B64 carries access to every site in it. Keep the file out of git and off shared machines. Rotating a site token in the Respira dashboard cuts off every client holding the old one, OpenCode included.
Pick the access level per site.
Read-only for a look around, content for text, builder for layouts, full only when you mean it. The level is set on the Sites page in your dashboard, and a free model cannot exceed it however it wanders.
Nothing goes live from the chat.
Duplicates and drafts wait in the Approvals and Undo screen in wp-admin until you publish them. If the agent got it wrong, throw the copy away and the client never sees it.

Questions people ask

Is OpenCode free to use with WordPress?

OpenCode is free and open source, and it ships free models through OpenCode Zen. The WordPress side is Respira, which is paid: it needs an account with at least one connected site, on a trial or a plan, and the plans are on the pricing page. There is no separate OpenCode fee and no per-client pricing. The same account works in OpenCode, freecode, Claude Code, Cursor and Codex at once.

Do i need an API key?

Not for OpenCode's free models. A paid provider such as Anthropic needs that provider's key, added inside OpenCode. Respira does not put an API key in this config either: the RESPIRA_CONFIG_B64 value from the dashboard carries the connection for every site on the account. It is a credential all the same, so treat the file like a password.

Does it work with Elementor, Divi and Bricks?

Yes, plus 14 more. Respira reads and writes each builder in its own native storage format, so an Elementor page stays editable in Elementor and a Bricks page stays editable in Bricks. Nothing is flattened into HTML on the way through.

Can OpenCode break my live WordPress site?

Page and element writes take a snapshot first, and structural page work is built on a duplicate rather than the live page. The Approvals and Undo screen in wp-admin is where a duplicate gets published or thrown away, and where a snapshot gets restored, for 90 days. You also pick an access level per site when you connect: read-only, content, builder or full. Read-only is a real read-only.

Does it work on a live site, or do i need staging?

It works on the live site. That is what the duplicate-first design is for: the agent builds on a copy, and the live page changes only when you approve. A staging site is still a fine habit for a first session with a small free model, while you learn how it behaves.

Is OpenCode a free alternative to Claude Code for WordPress?

For the agent, yes: OpenCode is open source and its free models cost nothing, where Claude Code needs a Claude plan or API credit. Both connect to the same Respira MCP server and get the same tools, so a site set up for one works with the other. The honest trade is model strength. On a free model, keep each task small and specific and read the result before publishing. For a long build, a paid model inside OpenCode, or Claude Code, does better.

What is the difference between freecode and OpenCode?

freecode is a free wrapper around the OpenCode engine: no API key, no subscription, sponsor cards inside the interface pay for the models, with a daily usage limit and an alpha label. It reads the same opencode.json, so the block on this page works there too. OpenCode is the engine itself, with free and paid models and its own mcp commands.

Why does OpenCode not see the server?

Almost always the shape of the file. OpenCode wants a top-level mcp key, not mcpServers; one command array that includes the binary; and env vars under environment, not env. Fix those three, run opencode mcp list, and respira-wordpress should report connected.

Why OpenCode plus Respira fits

A free, open-source agent against a production-safe backend.
OpenCode runs on your machine on models that cost nothing. Respira runs on your hosting. Neither side asks you to move the site anywhere.
Native builder writes.
Elementor stays Elementor, Bricks stays Bricks, Divi stays Divi, across 17 builders. Nothing is flattened to HTML in transit.
Snapshots and duplicates on every write path.
A small model moves fast and sometimes sideways. Undo has to be faster.
The same account everywhere.
One Respira account works in OpenCode, freecode, Claude Code, Cursor and Codex. OpenCode can also shell out to the Respira CLI for JSON output, and when you would rather not open a terminal at all, Respira AER is the same builder intelligence in a chat in your dashboard.