Connect an Agent

OpenCode

Configure MoraWP for OpenCode 1.x or 2.x and complete browser authorization.

OpenCode connects to MoraWP as a remote MCP server with OAuth. Check your version before choosing a configuration: 1.x and 2.x use different JSON structures.

Before you begin

Connect a WordPress website. In your terminal:

Terminal
opencode --version

The 2.x command syntax was checked with 2.0.18. The 1.x configuration below follows OpenCode's 1.x MCP reference. For 2.x, see the 2.x MCP reference.

Desktop and browser interface

OpenCode is available as a terminal client, desktop app, and web app. The remote server must be configured on the OpenCode backend running your session. Select the intended project before using the version-specific configuration below.

If your installed graphical interface exposes MCP management, inspect MoraWP there and follow its authorization prompt. Otherwise configure and authenticate through the matching CLI on that backend, then open a new graphical session. A browser tab connected to another backend does not inherit your local login.

The official MCP reference documents the configuration and OAuth commands; this guide does not invent a desktop-only menu path. See OpenCode's available interfaces.

OpenCode 2.x

From the project that should use MoraWP, run:

Terminal
opencode mcp add morawp --url https://api.morawp.com/mcp
opencode mcp auth morawp
opencode mcp list

The add command writes project configuration. To add it globally instead, include --global in the add command. If you edit configuration by hand, merge this entry into your existing file without replacing other servers:

JSON
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "morawp": {
        "type": "remote",
        "url": "https://api.morawp.com/mcp"
      }
    }
  }
}

OpenCode 1.x

Merge the following into the OpenCode configuration used by your project:

JSON
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "morawp": {
      "type": "remote",
      "url": "https://api.morawp.com/mcp",
      "enabled": true
    }
  }
}

Then run:

Terminal
opencode mcp auth morawp
opencode mcp list

Do not copy mcp.servers into a 1.x configuration, or the 1.x enabled setting into a 2.x server entry. OAuth is automatic; do not set oauth to false for MoraWP.

Approve and verify

The authentication command starts browser sign-in. Review and approve access in MoraWP, then return to OpenCode. The server list should show a connected MoraWP server.

Ask OpenCode to list the websites allowed for this connection without changing anything. The intended website should appear. Continue with Read one page.

If it does not work

ProblemNext step
Configuration is rejectedCheck the major version and the corresponding JSON structure.
MoraWP appears in one project onlyCheck whether you used project or global configuration.
Authentication is requiredRun opencode mcp auth morawp and complete the new browser request.
A website or action is missingUse Missing Abilities.

To stop access, disconnect the Agent in MoraWP. For local cleanup, run opencode mcp logout morawp and remove only MoraWP's entry from the configuration where you added it. Do not replace the entire MCP configuration.

References and CLI help were reviewed on October 9, 2026.

MoraWP documentation