> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode

> Add PostChamp to OpenCode with one command, then sign in.

Add PostChamp to OpenCode with one command, then sign in. The connection URL is the same for every client:

```text
https://api.postchampai.com/api/v1/mcp
```

## Before you start

* OpenCode installed.
* A PostChamp account on a plan that includes assistants, with the owner or admin role in the workspace you want to share. See [Authentication](/mcp/authentication.md).

## Connect OpenCode

**Step 1**

Add the server with the first command below. It is added to the current project. Add `--global` to make it available everywhere.

**Step 2**

Run `opencode mcp list`. If it says `needs authentication`, run `/mcps` inside OpenCode, choose the server and sign in. Or run `opencode mcp auth postchamp`.

**Step 3**

Sign in to PostChamp in the browser, choose the workspaces to share and approve.

**Step 4**

Over SSH or in a container, copy the URL of the failed callback page from the address bar and paste it into the sign-in prompt.

## Command line

```bash
opencode mcp add postchamp --url https://api.postchampai.com/api/v1/mcp
opencode mcp list
opencode mcp auth postchamp
```

## Configuration file

Add this to `opencode.jsonc`:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "postchamp": {
        "type": "remote",
        "url": "https://api.postchampai.com/api/v1/mcp"
      }
    }
  }
}
```

## Check the connection

Ask:

```text
Use PostChamp to list my workspaces.
```

This reads your workspaces, costs nothing and changes nothing. Then try one of these:

* Plan next week: three posts, one on each of my main topics. Show me the plan before you schedule anything.
* Write a LinkedIn post about what I learned from my last client project, in my voice.
* Check my newest draft for filler and weak lines, then suggest fixes.
* How did my posts do over the last 30 days? What worked best?

## Disconnect

* Run `opencode mcp logout postchamp` to remove the stored sign-in, then delete the entry from the config.
* In PostChamp, open Settings and choose Assistants to disconnect it, so the sign-in is revoked.

## Troubleshooting

> [accordion] The list says the server needs authentication.
>
> Run `opencode mcp auth postchamp` and finish the sign-in.

> [accordion] The browser cannot reach the callback.
>
> Copy the URL of the failed callback page and paste it into the prompt in your terminal.

> [accordion] The browser sign-in says I cannot connect.
>
> Only owners and admins of a workspace can connect an assistant to it, and the plan must include assistants. Sign in with an account that has that role. Check the account in Settings, Members.

## FAQ

> [accordion] Is OAuth on by default?
>
> Yes. OpenCode uses OAuth for remote servers unless you turn it off, so you do not need to add anything for PostChamp.

## Related

> [card] [Authentication](/mcp/authentication.md)
>
> How sign-in, consent and revocation work.

> [card] [Tool reference](/mcp/tools/index.md)
>
> Every tool the assistant can call.
