# Product Brain MCP (`@productbrain/mcp`)

Give your AI agent your product's memory. Read the Chain, capture decisions, and write back — from Claude Code, Claude Desktop, Cursor, or any MCP client.

**Requirements:** Node 18+, and an API key from Product Brain → Settings → API Keys (starts with `pb_sk_`).

## Install

Pre-GA, always pin the `beta` tag:

```bash
npx -y @productbrain/mcp@beta
```

## Connect your client

### Claude Code

```bash
claude mcp add productbrain \
  -e PRODUCTBRAIN_API_KEY=pb_sk_your_key_here \
  -- npx -y @productbrain/mcp@beta
```

### Claude Desktop

`claude_desktop_config.json`:

```jsonc
{
  "mcpServers": {
    "productbrain": {
      "command": "npx",
      "args": ["-y", "@productbrain/mcp@beta"],
      "env": {
        "PRODUCTBRAIN_API_KEY": "pb_sk_your_key_here"
      }
    }
  }
}
```

### Cursor

`~/.cursor/mcp.json` — same `command` / `args` / `env` block as above.

## Configuration

| Variable | Required | Default |
|---|---|---|
| `PRODUCTBRAIN_API_KEY` | yes | — your `pb_sk_` key. Workspace, user, and scope are all derived server-side from the key. |
| `CONVEX_SITE_URL` | no | Product Brain Cloud. Point at another deployment (a `*.convex.site` URL, not `*.convex.cloud`). |
| `PRODUCTBRAIN_URL` | no | Alias for `CONVEX_SITE_URL`. |
| `MCP_DEBUG` | no | Set to `1` for verbose logs on stderr. |

See `.env.mcp.example` in this package for the annotated list.

## What your agent gets

Tools for orientation, search, capture, entry and relation management, collections, labels, workflows, and session tracking. The agent reads what governs the work before it acts, and writes decisions and tensions back as it learns them.

Prefer the terminal? [`@productbrain/cli`](https://www.npmjs.com/package/@productbrain/cli) exposes the same Chain as `pb`.

## Links

- Product Brain — https://work.productbrain.io
- Issues — https://github.com/synergyai-os/Product-OS/issues
