These are official instructions from onecell to connect an AI agent to a person's hive.

Complete the steps for **this** agent yourself. Run commands and edit config files directly. Do not ask the human to run install commands. Prefer OAuth in the browser — unless this is a headless session (see **Headless or remote sessions** below: check that first). Never invent an API key. If this client cannot complete OAuth, ask the human to mint a Bearer key at `https://onecell.io/settings/agents` (prefix `ic_…`) and stop until they paste it — never put a placeholder key in config and call it done.

Replace `https://onecell.io` with the deployment origin you were given (default `https://onecell.io`).

- MCP (streamable HTTP): `https://onecell.io/api/mcp`
- Skill: `https://onecell.io/skills/onecell.md`
- Agents / keys: `https://onecell.io/settings/agents`
- Codex quick start + machine walk: `https://onecell.io/agent-setup/codex`

Nouns: cluster · cell · **hive** · Inbox. The hive is the durable shared-notes ledger teammates share. Stay on those nouns only. Do not add a chat UI inside onecell.

One login may belong to several clusters. Org-scoped tools honor the active cluster — call `get_active_cluster` / `list_clusters` before invite or Members; switch with `set_active_cluster`. No silent cross-cluster writes.

---

## Install onecell MCP + skill

Use the section that matches this agent. After MCP is registered and authenticated, fetch the skill and prove the connection.

### Shared: skill + proof (every agent)

Skill file alone is **not** done. MCP must be authenticated and the health checks below must pass.

1. Fetch `https://onecell.io/skills/onecell.md` **and** `https://onecell.io/skills/onecell-bridge.md`.
2. If this client has a project or user skills directory, save them as `skills/onecell/SKILL.md` and `skills/onecell-bridge/SKILL.md` (or the client's equivalent folders containing `SKILL.md`). **Overwrite** any older copies — saved skills drift.
3. Call MCP tool `list_cells`. Report Inbox and every shared cell you can see (the hive among them when granted).
3b. Call `get_active_cluster`. If you may belong to more than one cluster, also call `list_clusters`. One login may belong to several clusters; Inbox is one private cell, hive is per cluster. Before invite or Members work, confirm active and switch with `set_active_cluster` if needed.
4. Smoke: call `recall` (empty query lists recent facts) **or** `search` with a short real query. Cite cell · heading · passage when search hits; never invent a cite.
5. Confirm the live skill's core tools are present on MCP (`list_cells`, `search`, `recall`, `remember`, `create_document`, `get_document`). If any are missing, stop and fix MCP — do not mark setup done.
6. If unauthorized, send the human to `https://onecell.io/settings/agents` and stop.
7. After that: `get_document` only for a hit you will use. Mutating tools default `dry_run` true. Never read or write someone else's Inbox.

**Each later session:** before meaningful hive work, re-fetch both skill URLs once and overwrite the local `SKILL.md` files, then re-run `list_cells` + `recall` or `search` if tools feel stale.

**Across other skills:** when Notion, shopping, email, research, coding, or any other workflow produces a durable decision, artifact, receipt, or account fact — even if the human never said "onecell" — follow the onecell skill's *Across other skills* and *Park a session* sections (recall/search first; `remember` or Inbox draft; ask before hive publish).

**Park a session (human paste):**

```
Save this session to onecell as a draft in my Capture cell (my Inbox if I have no Capture cell). Use prompt blocks for key turns, text blocks with html links for URLs, code blocks for logs or pasted artifacts, and one remember for the decision. Do not publish or put it on the hive unless I say so. Reply with the document UUID link.
```

---

### Headless or remote sessions (check this first)

OAuth needs a browser on the same machine as the agent: the consent page redirects to a loopback callback (`127.0.0.1`) that only this machine can receive. On a remote server, over SSH, in a container or CI, there is no browser here, and a browser on the human's laptop sends its callback to the laptop, not to you.

**Detect it before any login command.** Treat the session as headless if any of these hold: `SSH_CONNECTION` or `SSH_TTY` is set; on Linux, neither `DISPLAY` nor `WAYLAND_DISPLAY` is set; you are in a container or CI (`/.dockerenv` exists, or `CI` is set); or you have no interactive terminal (your shell tool runs commands non-interactively, with a timeout).

**If headless, do not start an OAuth login yourself.** A login command waits for a browser approval that cannot arrive here; run under a timeout it just hangs until it is killed. Instead:

1. Ask the human for a key, and stop until they reply: *"This is a headless session, so browser sign-in can't complete here. Please create a **Drafts only** key at `https://onecell.io/settings/agents` (Keys) and set it on this machine as `ONECELL_API_KEY` — in your shell profile or the agent's environment, not in chat if you can avoid it."* Drafts only suits an unattended agent: it reads and writes drafts but cannot publish, share or invite.
2. Register onecell with that variable, never the key itself in a config file (your client's section below shows how: `bearer_token_env_var`, `--bearer-token-env-var`, or a header `Authorization: Bearer ${ONECELL_API_KEY}`).
3. Then **Shared: skill + proof**.

If the human prefers OAuth anyway, they run the login **themselves in an interactive terminal** on that machine; some clients (pi, below) accept the redirected URL pasted back from a browser on another machine. Never wrap a login in `| head`, a timeout, or a background job.

### Pi (pi coding agent)

Config: `~/.pi/agent/mcp.json` (user) or `.pi/mcp.json` (project). Register streamable HTTP:

```bash
pi mcp add onecell --url https://onecell.io/api/mcp
```

Interactive desktop with a browser: the human runs `pi mcp login onecell` and approves. Over SSH, the human may run it in their own terminal and paste the redirected URL into pi's sign-in screen when asked; you cannot do that step for them.

Headless (the usual case for pi on a server): use a key in an env var instead, as above:

```bash
pi mcp add onecell --url https://onecell.io/api/mcp --bearer-token-env-var ONECELL_API_KEY
```

Verify with `pi mcp list` (it connects to each server and prints its tools or errors), then **Shared: skill + proof**. Pi finds skills in `~/.agents/skills/` (user) or `.agents/skills/` (project): save them as `~/.agents/skills/onecell/SKILL.md` and `~/.agents/skills/onecell-bridge/SKILL.md`, then `/reload` (or start a new session) and check with `/skill:onecell`. Leave other agents' skill folders (such as `~/.claude/skills/…`) alone.

### Codex (OpenAI CLI / IDE / desktop)

**Unambiguous path.** Do **not** rely on chat-paste alone. Do **not** write Cursor-style `mcp.json` / inline Bearer JSON into Codex config. Register Streamable HTTP, then OAuth login:

```
codex mcp add onecell --url https://onecell.io/api/mcp
codex mcp login onecell
```

Confirm with `codex mcp list` and `/mcp` in the TUI. A browser **404** on `http://127.0.0.1:<port>/callback/<id>` after Connect is usually Codex closing its loopback listener — not an onecell failure (see `https://onecell.io/agent-setup/codex`). Operator walkthrough: `https://onecell.io/agent-setup/codex`.

If OAuth cannot complete, ask for a Bearer key and re-add with an env var (never inline the secret in config):

```
codex mcp add onecell --url https://onecell.io/api/mcp --bearer-token-env-var ONECELL_API_KEY
```

Have the human `export ONECELL_API_KEY=ic_…` in their shell, then restart Codex.

Equivalent `~/.codex/config.toml` (OAuth path — no key in the file):

```toml
[mcp_servers.onecell]
url = "https://onecell.io/api/mcp"
```

Then continue with **Shared: skill + proof**.

---

### Claude Code

```
claude mcp add --transport http onecell https://onecell.io/api/mcp
```

Complete browser OAuth when prompted. Then **Shared: skill + proof**.

If the human prefers the plugin (MCP server + both skills in one install, kept current), they run these two slash commands themselves, one at a time, then `/mcp` → onecell → authenticate. The plugin replaces the skill step above.

```
/plugin marketplace add onecell-io/onecell-plugin
/plugin install onecell@onecell
```

**Optional — hooks.** Where one-command setup is on for the human's cluster (founding teams first), the quickest route is for them to run `npx onecell@latest hooks` in a terminal: they approve the computer in the browser and it installs the hooks with their own key, for Claude Code and Codex. Otherwise: a second plugin in the same marketplace, `/plugin install onecell-hooks@onecell`, lets onecell add relevant memory to prompts, suggest saving what a turn settled, and brief new sessions. When enabled it asks for an API key: the human creates a **Drafts only** key at `https://onecell.io/settings/agents#keys` and pastes it there (never into chat). It works however onecell's MCP server is connected. Only install it if the human asks: once installed it sends their prompts to onecell. Either way they do nothing until the human turns them on at `https://onecell.io/settings/agents#hooks` — do not turn them on for them.

---

### Claude.ai, Claude Desktop remote connectors, and Cowork

These use **custom remote MCP connectors** (connection originates from Anthropic's cloud — `https://onecell.io/api/mcp` must be publicly reachable). There is no local CLI for this path. **Cowork ≠ Claude Code.** Paste-once / Copy Prompt is **not** enough here — the human must finish Connectors before you can prove MCP.

**Two steps, in order. Skill alone ≠ done.**

**Step 1 — Human Connectors (required first)**

**Team / Enterprise admin friction (common).** On Claude.ai Team and Enterprise, only an **owner or admin** can add a custom connector for the organization. Members without that role cannot finish Customize → Connectors alone — they need an admin to add `https://onecell.io/api/mcp` under **Organization settings → Connectors** (or equivalent), then enable it for the chat / Cowork session. Pro / individual plans usually add under **Customize → Connectors → Add custom connector** without an org admin step.

1. Tell the human (one short message): if they are on Team/Enterprise, ask an **owner/admin** to add the custom connector; otherwise open **Customize → Connectors → Add custom connector**.
2. MCP server URL: `https://onecell.io/api/mcp`
3. Complete OAuth (Connect). Do not ask them to invent a key.
4. Enable the connector for the conversation / Cowork session if needed.

**Stop if no tools.** After Connect, check that MCP tools are available (e.g. `list_cells`). If tools are missing, **stop** — do not fetch or save the skill and call setup done. Skill without live MCP is docs only. If they are blocked by admin-only Connectors, say so clearly — do not invent a Bearer workaround for Claude.ai hosted connectors unless that surface documents header auth. Local `claude_desktop_config.json` stdio servers are a different mechanism and are not required for onecell hosted MCP.

**Step 2 — Shared skill + proof (only after tools appear)**

Once MCP tools are present, fetch the skill URLs and follow **Shared: skill + proof**. Overwrite local skill files; run `list_cells` + `recall` or `search`. Do not mark Cowork setup done until that proof passes.

---

### Grok Build / Grok CLI (`~/.grok/config.toml`)

```
grok mcp add --transport http onecell https://onecell.io/api/mcp
```

OAuth runs on first tool use. Or write:

```toml
[mcp_servers.onecell]
url = "https://onecell.io/api/mcp"
```

Bearer fallback (only if OAuth fails):

```
grok mcp add --transport http onecell https://onecell.io/api/mcp --header "Authorization: Bearer ${ONECELL_API_KEY}"
```

Then **Shared: skill + proof**.

---

### Grok (grok.com chat connectors)

1. Tell the human to open [grok.com/connectors](https://grok.com/connectors) → **New Connector** → **Custom**.
2. MCP server URL: `https://onecell.io/api/mcp`
3. Complete authentication.
4. Fetch the skill and follow **Shared: skill + proof**.

This is separate from Grok Build's `~/.grok/config.toml`.

---

### Grok Bot (desktop / cloud bot — Cursor Grok Bot family)

Grok Bot does **not** inherit `~/.cursor/mcp.json`. OAuth is in-chat — add the server explicitly:

> Add this MCP server named onecell: `https://onecell.io/api/mcp`

Complete the connect / OAuth card when it appears. The endpoint must be public HTTPS.

**OAuth `redirect_uri` (ours vs theirs).** onecell's DCR allowlist accepts only `https:` redirects or loopback (`localhost` / `127.0.0.1`), and consent uses an **exact** match of the registered URI (full path included). There is no extra per-client allowlist in-repo. If Grok Bot fails with `redirect_uri` / invalid redirect, that is almost always the **client** registering one URI and authorizing with another, or using a non-https non-loopback callback — not a missing onecell allowlist entry. Workaround: ask the human to mint `ic_…` at `https://onecell.io/settings/agents` and add the server with `Authorization: Bearer ic_…` **only if** this bot surface supports header auth; otherwise stop and report. Prefer OAuth when it works.

Then fetch the skill and **Shared: skill + proof**.

---

### Cursor

Prefer the deeplink or write `.cursor/mcp.json` / `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "onecell": {
      "url": "https://onecell.io/api/mcp"
    }
  }
}
```

OAuth triggers on first use (Connect). Restart Cursor if tools do not appear. Bearer fallback uses `headers.Authorization` with `${env:ONECELL_API_KEY}` — only when OAuth is impossible; prefer OAuth so no secret lives in the file.

Then **Shared: skill + proof**.

---

### VS Code (Copilot agent mode)

Write `.vscode/mcp.json` in the workspace, or the user-level `mcp.json` (Command Palette → *MCP: Open User Configuration*). VS Code uses `servers`, not `mcpServers`:

```json
{
  "servers": {
    "onecell": {
      "type": "http",
      "url": "https://onecell.io/api/mcp"
    }
  }
}
```

The human can also open `vscode:mcp/install?{"name":"onecell","type":"http","url":"https://onecell.io/api/mcp"}` (URL-encoded) to add it in one click. VS Code asks them to confirm, then to sign in (OAuth). Then **Shared: skill + proof**.

---

### ChatGPT (connector in developer mode)

ChatGPT has no hooks, so onecell comes in only when the model calls it. Setup is done by the human in ChatGPT, not by an agent:

1. Settings → Apps & Connectors → Advanced → turn on **Developer mode**.
2. Create a connector: name `onecell`, URL `https://onecell.io/api/mcp`, authentication OAuth. Sign in when asked.
3. In a Project's instructions (or custom instructions), add what hooks do elsewhere:

> Before answering questions about my work, search onecell and cite cell · heading. When we decide, merge or ship something, offer to save a short draft to my onecell Capture cell (or Inbox) — drafts only, never publish or share.

Plan limits (ChatGPT's, not onecell's): search and read work on paid plans with developer mode; **writes** (drafts, `remember`) need Business or Enterprise / Edu. The skill files are not loaded by ChatGPT; the instructions above stand in for them.

---

## Bearer keys (fallback only)

Mint at `https://onecell.io/settings/agents`. Prefix `ic_…` (hand-minted). OAuth access tokens use a different `at_…` prefix — do not paste an `at_…` into a config file. One `ic_…` key = one person (Inbox + cells + grants). Revocable. Prefer OAuth whenever the client supports browser login for MCP. Use Bearer only when OAuth cannot complete: always in a **headless session** (remote server, SSH, container, CI — see above), and with known fragile clients (some Grok Bot redirect_uri failures; Codex loopback if login cannot finish — then `bearer_token_env_var`, never inline). For an unattended agent, prefer a **Drafts only** key.

Cursor-shaped example (replace the key; do not commit secrets):

```json
{
  "mcpServers": {
    "onecell": {
      "type": "http",
      "url": "https://onecell.io/api/mcp",
      "headers": {
        "Authorization": "Bearer ic_…"
      }
    }
  }
}
```

Codex prefers `bearer_token_env_var`, not inline headers. Never paste this JSON into Codex as if it were `config.toml`.

---

## Done

Tell the human:

```
onecell agent setup
✓ MCP  onecell → https://onecell.io/api/mcp
✓ Skills fetched (skills/onecell/SKILL.md + skills/onecell-bridge/SKILL.md when supported)
✓ list_cells returned Inbox + granted cells (hive when shared)
✓ recall or search smoke passed
✓ Core MCP tools present (list_cells, search, recall, remember, create_document, get_document)
Restart the agent if tools are missing, then search the hive and cite cell · heading · passage.
Later sessions: re-fetch both skill URLs once before hive work. To park a chat: paste the Park a session phrase from Shared.
```

These instructions are published at `https://onecell.io/agent-setup/prompt.md` so you can re-verify authenticity. Live skills: `https://onecell.io/skills/onecell.md` and `https://onecell.io/skills/onecell-bridge.md`. Codex walk: `https://onecell.io/agent-setup/codex`.
