# Connect an agent

> Connect Claude Code in five minutes and get the first words onto your desk, then what to know before you rely on it.

Connect an agent over **MCP** so it speaks, asks questions, and shows states in its own words.

> [!TIP]
> **Only want your coding agent's replies on the desk?**
> For automatic replies, permission prompts, wake on reply, and reactions in Claude Code, Codex, OpenCode, pi, DeepSeek Harness, or Antigravity CLI, install its [plugin](/docs/plugins/) instead. Plugins use only **CLI connection**, need no instructions in the agent, and share the same resident if you later add MCP.

## First words in five minutes

Turn on MCP, add Pixling to Claude Code, and ask for a hello. For Codex, other Streamable HTTP clients, bearer token protection, or CLI setup, see [Set up your agent](/docs/connect/agent-setup/).

1. **Turn on MCP connection in Studio**

   Open **Settings** › **Connect** in Studio and turn on **MCP connection** (it starts off).

2. **Add Pixling to Claude Code**

   Press **Copy** on **Claude Code setup** right below **MCP connection**, and run the copied command in Terminal. Without bearer token protection, it is:

```sh title="Terminal"
claude mcp add --transport http --scope user pixling http://127.0.0.1:48271/mcp
```

3. **Start a new session and ask for a hello**

   A session that is already running does not see the new server. Start a new Claude Code session and ask:

```text title="Prompt"
Put a Pixling resident on my desk and say hello through it.
```

A resident appears on your desk and its first words show above it. The agent picks the resident from your Field Guide and binds it with `pixling_resident_ensure`; see [Give your agent a resident](/docs/connect/own-a-resident/).

> [!CAUTION]
> **Nothing appeared?**
> - Confirm **MCP connection** is still turned on in Studio.
> - Confirm your Claude Code session started **after** step 2.

## Plugin, MCP, or CLI

All three work together. When an agent also uses a plugin, it uses the namespace and key the plugin names so both speak through the same resident.

| Goal | Use | Enable in **Settings** › **Connect** |
| --- | --- | --- |
| Mirror replies, permission prompts, wake on reply, and reactions (supported coding agents) | **[Plugins](/docs/plugins/)** *(recommended)* | **CLI connection** (plus `pixling` on `PATH`) |
| Let the agent call Pixling tools directly (custom speech, states, glows, sequences) | **MCP** | **MCP connection** |
| Drive a resident from a shell script, hook, or streaming watcher | **[CLI](/docs/connect/agent-setup/#scripts-and-hooks-the-cli)** (`pixling`) | **CLI connection** (plus `pixling` on `PATH`) |

For scripts and hooks, link the `pixling` binary and run `pixling doctor` to diagnose missing CLI or MCP parts ([Set up your agent](/docs/connect/agent-setup/#scripts-and-hooks-the-cli)).

## Know this first

1. **Your agent speaks only while working.** Pixling cannot start a turn in your agent. Use a [plugin](/docs/plugins/) to mirror replies, show permission prompts, and wake the session when you write to its resident ([Wake your agent](/docs/connect/wake/)).
2. **Replies wait in an inbox until checked.** You can type to a resident at any time. With MCP alone, the input area notes that messages wait until your session checks; holding a CLI receiver (`pixling inbox receive`) tells Pixling your agent hears them right away ([Read what comes back](/docs/connect/own-a-resident/#read-what-comes-back)).
3. **A bound resident starts stopped.** It shows **Play** in its menu and speaks or asks as usual. Turn motion on first if you want it to show states ([Show a state](/docs/connect/expression/#show-a-state)).
4. **Ending a session leaves the resident on the desk.** Each conversation can bind its own resident. Choose **Put away** from a resident's menu when you no longer need it ([What stays and what goes](/docs/use/what-stays/#when-an-agents-session-ends)).

> [!NOTE]
> **Local and isolated by default**
> Pixling listens only on your Mac, keeps every connection off until you turn it on, and exposes a closed set of operations that report accepted, refused, or current state. Bound residents accept writes only through their `client:` selector so writes meant for another resident cannot land by mistake; what to show and when is up to you and your agent.

## Next steps

- [Give your agent a resident](/docs/connect/own-a-resident/): Bind a namespace and key, send messages, read the inbox, and request close.
- [Build expression](/docs/connect/expression/): Speak, ask, show states, fire one-off signals, and plan motion.
- [Set up your agent](/docs/connect/agent-setup/): Codex, other MCP clients, bearer token protection, CLI linking, and agent instructions.
- [Reference](/docs/reference/): Every MCP tool, CLI command, limit, and failure code.
