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

# Connect your AI to Brein

> Connect ChatGPT, Claude, OpenCode, Cursor, Hermes, OpenClaw, or another MCP client to your Brein workspace.

Brein is available through one remote MCP server:

```text theme={"theme":"github-light"}
https://api.trybrein.com/mcp
```

Your AI client chooses the model. Brein supplies the commercial data and actions that belong to the workspace you authorize.

## Choose your client

<CardGroup cols={3}>
  <Card title="ChatGPT" icon="message-circle" href="#chatgpt">
    Install or add the Brein connector and approve the workspace.
  </Card>

  <Card title="Claude" icon="bot" href="#claude">
    Add the remote Brein endpoint and sign in to the workspace you want to use.
  </Card>

  <Card title="OpenCode" icon="terminal" href="#opencode">
    Add the server with one command, then authorize it inside OpenCode.
  </Card>

  <Card title="Cursor" icon="mouse-pointer-2" href="#other-mcp-clients">
    Add the same remote URL to Cursor's MCP server settings.
  </Card>

  <Card title="Hermes" icon="radio" href="#hermes-and-openclaw">
    Use the remote endpoint with OAuth or a scoped API key.
  </Card>

  <Card title="OpenClaw" icon="terminal" href="#hermes-and-openclaw">
    Connect the hosted Brein server from a remote MCP configuration.
  </Card>
</CardGroup>

These are client surfaces, not a claim of a commercial partnership. The client owns its model and account. Brein owns workspace access, available tools, usage, and confirmation rules.

## ChatGPT

In the Brein app or your ChatGPT connector settings, add:

```text theme={"theme":"github-light"}
https://api.trybrein.com/mcp
```

Complete the Brein authorization screen and select the workspace you want the agent to use.

Start with a small read:

```text theme={"theme":"github-light"}
Show me the Brein workspaces I can use and the current commercial usage.
```

Do not ask the agent to reveal a contact or activate a campaign until it has shown you the audience, price, or approval request.

## Claude

Add the endpoint as a remote MCP connector:

```text theme={"theme":"github-light"}
https://api.trybrein.com/mcp
```

Use OAuth when Claude offers the connector flow. If your organization only supports header authentication, use the API-key fallback below.

After signing in, select the authorized Brein workspace before asking for market, CRM, or campaign actions.

## OpenCode

Add Brein globally:

```bash theme={"theme":"github-light"}
opencode mcp add brein --global \
  --url https://api.trybrein.com/mcp
```

Inside OpenCode, run:

```text theme={"theme":"github-light"}
/mcps
```

Select Brein and complete the browser authorization. When the status is `connected`, the agent can discover the available tools.

You can also configure it in `opencode.jsonc`:

```jsonc theme={"theme":"github-light"}
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "brein": {
        "type": "remote",
        "url": "https://api.trybrein.com/mcp"
      }
    }
  }
}
```

OAuth credentials stay outside the project configuration. OpenCode may add a local `brein_` prefix to tool names; that prefix is not a different Brein API.

## Other MCP clients

The setup is the same for a standard remote MCP client:

1. Add a remote server.
2. Paste the Brein URL.
3. Complete OAuth or use a scoped API key if OAuth is unavailable.
4. Select the authorized workspace.
5. Verify the connection with a small read.

The client can use any model it already supports. Brein does not require a particular model provider.

## Hermes and OpenClaw

For a client that supports remote MCP OAuth, use the normal Brein authorization flow. For a client that requires headers, keep the key in the client's secret or environment store:

```jsonc theme={"theme":"github-light"}
{
  "mcp": {
    "servers": {
      "brein": {
        "type": "remote",
        "url": "https://api.trybrein.com/mcp",
        "oauth": false,
        "headers": {
          "X-API-Key": "${BREIN_API_KEY}"
        }
      }
    }
  }
}
```

Do not commit the raw key to a repository. A key only gives access to the workspaces and roles it was authorized for.

## What the connection can do

A connected client can work with the Brein workspace:

* read and update Cerebro documents;
* search published market information;
* find companies and masked people;
* quote and reveal selected people;
* read and update contact records in Prospectos;
* prepare and review campaigns;
* inspect commercial usage;
* run durable research.

Reading is not the same as acting. Contact lookups, CRM writes, and campaign activation have their own cost, permission, and confirmation requirements.

## Troubleshooting

| Symptom                     | What to check                                                      |
| --------------------------- | ------------------------------------------------------------------ |
| `401 Unauthorized`          | Reconnect OAuth or replace the scoped API key.                     |
| `403 Forbidden`             | Check workspace membership, role, and client permissions.          |
| Tools are missing           | Reconnect the client; clients refresh their tool list per session. |
| Wrong workspace             | Switch the active workspace or authorize again.                    |
| A contact action is refused | Run the current price and confirmation flow.                       |

For the complete tool contract, see [MCP and OAuth](/mcp/overview). For software that is not an AI client, use the [REST API](/api/overview).
