> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.flockx.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.flockx.io/_mcp/server.

# Connect Flockx to OpenCode

> Configure the Flockx MCP server in OpenCode with a remote server entry in opencode.json, then authenticate with opencode mcp auth. Manage brand content, media, images, video, and social posts from the OpenCode terminal agent.

OpenCode connects to Flockx as a **remote MCP server**. OAuth is on by default for remote servers, so the only setup is the server address and a sign-in.

## 1. Add Flockx to your configuration

Add Flockx to your global configuration at `~/.config/opencode/opencode.json` to use it everywhere, or to `opencode.json` in a project to share it with the team:

```jsonc
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "flockx": {
        "type": "remote",
        "url": "https://mcp.flockx.io/mcp"
      }
    }
  }
}
```

> **Info**
>
> Older OpenCode releases list servers directly under `mcp` (`"mcp": { "flockx": { "type": "remote", "url": "..." } }`). Use the shape your version's [MCP servers documentation](https://opencode.ai/docs/mcp-servers) shows.

## 2. Sign in

```bash
opencode mcp auth flockx
```

OpenCode opens a browser for the Flockx sign-in. You can also start the sign-in from inside OpenCode with `/mcps`.

## 3. Check that it works

Start OpenCode and ask: "Which Flockx organizations can I use?" OpenCode calls `list-organizations` and shows each organization and the one in use.

## Pin an organization (optional)

If you belong to several Flockx organizations and want every call in a project to use one of them, send the `X-Organization` header:

```jsonc
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "flockx": {
        "type": "remote",
        "url": "https://mcp.flockx.io/mcp",
        "headers": {
          "X-Organization": "your-organization-id"
        }
      }
    }
  }
}
```

Ask "which Flockx organizations can I use?" to get the ids. See [Organizations and permissions](/documentation/flockx-mcp/organizations-and-permissions).

## Next steps

* [Capabilities](/documentation/flockx-mcp/capabilities)
* [How AI assistants use Flockx](/documentation/flockx-mcp/how-ai-assistants-use-flockx)
* [Troubleshooting](/documentation/flockx-mcp/troubleshooting)