markaDocs
Agent setup

Connect OpenCode to Marka's MCP server

Connect OpenCode to Marka's MCP server at https://joinmarka.com/api/mcp with one remote entry in your user-level opencode.json. The key never lands in a commit.

To connect OpenCode to Marka's MCP server, add a remote entry with the URL https://joinmarka.com/api/mcp and your API key in an x-api-key header to ~/.config/opencode/opencode.json, then restart OpenCode.

  1. Create an API key and set it as MARKA_API_KEY (see Before you start).
  2. Merge the entry under Connect into ~/.config/opencode/opencode.json.
  3. Restart OpenCode, then check that it worked.

OpenCode talks to Marka's hosted gateway as a remote MCP server, so there is nothing to install. You need an API key in MARKA_API_KEY (see Before you start).

Connect

Merge this entry into ~/.config/opencode/opencode.json. Create the file if it does not exist, and keep everything already in it.

{
  "mcp": {
    "marka": {
      "type": "remote",
      "url": "https://joinmarka.com/api/mcp",
      "enabled": true,
      "headers": {
        "x-api-key": "{env:MARKA_API_KEY}"
      }
    }
  }
}

Use the user-level file

A project's own opencode.json is usually checked in. The file under ~/.config never is.

OpenCode fills in {env:MARKA_API_KEY} from its environment when it starts, so the key itself stays out of the file. Restart OpenCode to load the Marka tools.

Check it worked

Check the key first. A good key prints your user and plan as JSON.

curl -sS https://joinmarka.com/api/v1/me -H "x-api-key: $MARKA_API_KEY"

Then ask OpenCode to search Marka. An answer drawn from the live catalogue proves the MCP connection.

Sign in with your browser instead of an API key

OpenCode handles OAuth for remote MCP servers itself: it notices when the server asks for sign-in and registers itself as a client, so the entry needs no key. Use this in place of the key entry above, then run the second command to sign in (OpenCode also prompts you the first time you use the server):

{
  "mcp": {
    "marka": {
      "type": "remote",
      "url": "https://joinmarka.com/api/mcp"
    }
  }
}
opencode mcp auth marka

Your browser opens Marka's consent page, which names the client and the address it will return to. Sign in if asked, check both, and press Allow.

To disconnect, open Settings → Connected apps on Marka and disconnect the client there. That ends its access immediately and revokes every token it holds.

On this page