# Set up Ignaru in your agent

## 1. A key, in an environment variable

The person makes a personal API key in Ignaru: Settings, You, API keys. It starts with ig_pk_ and is shown once. They export it in their shell profile (~/.zshrc or ~/.bashrc), not in a project file:

```sh
export IGNARU_TOKEN="ig_pk_..."
```

Never ask them to paste the key into chat. If IGNARU_TOKEN is empty (`test -n "$IGNARU_TOKEN" && echo set`), stop and ask them to set it, then restart the agent so it picks it up.

A key made for all of their teams picks one with the X-Ignaru-Team header (CLI: `ignaru teams switch <team>`); `list_teams` shows the ids.

## 2. Connect the MCP server

The server is https://ignaru.com/api/mcp/mcp (Streamable HTTP, Authorization: Bearer <key>). Each snippet reads the key from the environment, so no file holds it.

Claude Code, from the project folder (writes .mcp.json, which reads the variable when the server starts):

```sh
claude mcp add --transport http --scope project ignaru https://ignaru.com/api/mcp/mcp --header 'Authorization: Bearer ${IGNARU_TOKEN}'
```

Codex, in ~/.codex/config.toml:

```toml
[mcp_servers.ignaru]
url = "https://ignaru.com/api/mcp/mcp"
bearer_token_env_var = "IGNARU_TOKEN"
```

Cursor, in ~/.cursor/mcp.json or .cursor/mcp.json:

```json
{
  "mcpServers": {
    "ignaru": {
      "url": "https://ignaru.com/api/mcp/mcp",
      "headers": { "Authorization": "Bearer ${env:IGNARU_TOKEN}" }
    }
  }
}
```

Then restart the agent or reload its MCP servers.

## 3. Check it works

Call `context`. It should name the team and say the key acts as an Operator. `invalid_token` means the key is wrong or revoked; `team_required` means the key covers several teams and needs X-Ignaru-Team.

## The CLI (optional)

The ignaru CLI reads the same IGNARU_TOKEN. `ignaru context` starts, `ignaru help agents` prints the guide, and `--json` on any command prints the API's answer. `ignaru tools` lists every MCP tool and `ignaru call <tool> '<json>'` runs one.

Setup for every client, Claude Desktop included: https://ignaru.com/docs/cli-mcp
