# Ways to connect to HeadSpacer

Start at https://headspacer.com/agents/. Pick your agent, then choose a method.

## CLI + skill

The setup command installs the self-contained CLI and a host-specific design
skill, then opens browser sign-in and scoped board consent. This is the simplest
route for a coding agent with shell access, including Pi without an MCP extension.
The installed command works from any project. See /agents/setup.md.
Scripts and custom harnesses can use the same CLI's JSON commands: `tools`,
`tools TOOL_NAME`, `boards`, and `call TOOL --input FILE` or `--input -`.

## MCP with browser sign-in (local stdio)

Add the local MCP configuration for your chosen client from the website. The
client launches `npx` with the first-party versioned package and selected agent
profile. It needs Node.js 22.13+ and npm in that client's execution environment.
This does not install a filesystem skill or edit the client's settings for you.
Merge the server entry with existing settings; keep unrelated servers intact.
Other MCP clients can use the same `command` and `args` with their own config
wrapper. The examples below do not establish support in every client version.

Enable the server, then ask the agent to connect HeadSpacer. It calls
`connect_account`, shows the approval URL if the browser cannot open, and waits
for the human to sign in and choose board access. It then calls
`connection_status` with `wait_seconds: 20, check_remote: true`. Never approve
consent for the human or request credentials in chat. Reload a client that caches
its original tool list. Before approval, the server exposes connection tools;
after approval it also exposes the board tools and app-design guide.

The bridge uses the same private profile as `setup --agent ID`. Existing
connections are reused. Independent jobs should set their own stable
`HEADSPACER_AGENT_ID`; preserve it when retrying uncertain writes. Remote
execution environments need their own setup/profile; their browser approval
link can be opened on the human's machine.

## Hosted MCP (Streamable HTTP)

URL: https://headspacer.com/mcp

Add the URL to a remote MCP client, then sign in and approve board access
when the client opens HeadSpacer. For unattended clients that support custom
headers, choose **Running on a server?** and **Create credential on HeadSpacer**.
Sign in, choose permissions and expiry, then explicitly create the
private token. The account dialog shows the token and connection settings once.
It never issues a token merely because the connection link was opened.

Set `Authorization: Bearer YOUR_PRIVATE_TOKEN` in the client's secret settings.
Use a different stable `X-Headspacer-Agent-ID` for each independent agent/job.
Do not put the token in a board URL, chat, command arguments or committed files.
Revoke either type of grant in https://headspacer.com/boards?view=agents.

To reuse a personal token with a stdio client, put it in the client’s private
environment as `HEADSPACER_PERSONAL_TOKEN` and launch `headspacer mcp`. The
same setting works with `headspacer status --check` and the repository’s
`canvas/mcp/index.ts` adapter. Remove the setting to disconnect locally.

## Portable design skill

Download /agents/downloads/headspacer-design.zip. Extract its `headspacer-design`
folder into your host's supported skills directory, or upload the ZIP if your
client accepts skills. Reload the agent. The skill guides shared board design
before implementation; it needs existing HeadSpacer MCP tools or the CLI to
read and edit boards. It is not an independent connection or credential.
CLI + skill installs a configured copy automatically.

## Native plugins

Existing Codex and Claude Code plugins include browser setup and selected-context
capture workflows. They are available through a local marketplace checkout, not
a public plugin-directory listing. See /agents/plugins.md. They do not replace
the full design workflow exposed by the CLI/board MCP tools.

## Configuration references

Verified against primary documentation on 7 November 2026:

- [Codex config.toml](https://learn.chatgpt.com/docs/extend/mcp#configure-with-configtoml)
- [Cursor mcp.json](https://cursor.com/docs/mcp)
- [Claude Code project .mcp.json](https://code.claude.com/docs/en/mcp)
- [Claude Desktop local servers](https://modelcontextprotocol.io/docs/develop/connect-local-servers)
- [OMP mcp.json and named profiles](https://github.com/can1357/oh-my-pi/blob/main/docs/mcp-config.md)
- [OpenCode 2.x mcp.servers](https://opencode.ai/docs/mcp-servers/)
- [Gemini CLI settings.json](https://geminicli.com/docs/tools/mcp-server/)

Pi examples use the generic `mcpServers` shape for an MCP-capable extension;
consult that extension's format. Core CLI + skill does not need an extension.

## Local MCP configurations

### Pi

Merge into your Pi MCP extension’s configuration.

```json
{
  "mcpServers": {
    "headspacer": {
      "command": "npx",
      "args": [
        "--yes",
        "--package=https://headspacer.com/agents/downloads/headspacer-cli-0.4.4.tgz",
        "headspacer",
        "--agent",
        "pi",
        "mcp"
      ]
    }
  }
}
```

### OMP

Merge into ~/.omp/agent/mcp.json (or your active profile).

```json
{
  "mcpServers": {
    "headspacer": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "--yes",
        "--package=https://headspacer.com/agents/downloads/headspacer-cli-0.4.4.tgz",
        "headspacer",
        "--agent",
        "omp",
        "mcp"
      ]
    }
  }
}
```

### Codex

Merge into ~/.codex/config.toml.

```toml
[mcp_servers.headspacer]
command = "npx"
args = ["--yes","--package=https://headspacer.com/agents/downloads/headspacer-cli-0.4.4.tgz","headspacer","--agent","codex","mcp"]
startup_timeout_sec = 30
```

### Claude Code

Merge into .mcp.json in your project.

```json
{
  "mcpServers": {
    "headspacer": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "--yes",
        "--package=https://headspacer.com/agents/downloads/headspacer-cli-0.4.4.tgz",
        "headspacer",
        "--agent",
        "claude",
        "mcp"
      ]
    }
  }
}
```

### Cursor

Merge into ~/.cursor/mcp.json.

```json
{
  "mcpServers": {
    "headspacer": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "--yes",
        "--package=https://headspacer.com/agents/downloads/headspacer-cli-0.4.4.tgz",
        "headspacer",
        "--agent",
        "cursor",
        "mcp"
      ]
    }
  }
}
```

### OpenCode

Merge into opencode.jsonc (OpenCode 2.x).

```json
{
  "mcp": {
    "servers": {
      "headspacer": {
        "type": "local",
        "command": [
          "npx",
          "--yes",
          "--package=https://headspacer.com/agents/downloads/headspacer-cli-0.4.4.tgz",
          "headspacer",
          "--agent",
          "opencode",
          "mcp"
        ]
      }
    }
  }
}
```

### Gemini CLI

Merge into ~/.gemini/settings.json.

```json
{
  "mcpServers": {
    "headspacer": {
      "command": "npx",
      "args": [
        "--yes",
        "--package=https://headspacer.com/agents/downloads/headspacer-cli-0.4.4.tgz",
        "headspacer",
        "--agent",
        "gemini",
        "mcp"
      ]
    }
  }
}
```

### Claude Desktop

Merge into Claude Desktop → Settings → Developer → Edit Config.

```json
{
  "mcpServers": {
    "headspacer": {
      "command": "npx",
      "args": [
        "--yes",
        "--package=https://headspacer.com/agents/downloads/headspacer-cli-0.4.4.tgz",
        "headspacer",
        "--agent",
        "claude-desktop",
        "mcp"
      ]
    }
  }
}
```
