# Connect Codex to looot

Add looot as an MCP server to Codex so it can discover and run operations from the terminal.

## Setup

Setup adds looot as an MCP server in ~/.codex/config.toml, then installs the looot CLI so you can prove the connection with a real run.

Sign in, then /connect generates your actual prompt with a real token filled in -- this page shows the shape of that config, not a substitute for it.

## The six MCP tools

- `discover` -- Search the catalog by capability, not vendor name.
- `inspect` -- Read one operation's real contract, params, and version.
- `run` -- Execute an operation. Quoted, reserved, and settled once.
- `runs_get` -- Fetch one run's status and evidence by id.
- `runs_list` -- Page through this tenant's run history.
- `balance` -- Read remaining budget before spending it.

## For agents

The real per-tenant config comes from /connect after sign-in. This is the shape it fills in, with <YOUR_AGENT_TOKEN> standing in for the minted secret (`cs_ms_...`).

- **MCP endpoint**: https://api.looot.ai/mcp
- **Auth header**: Authorization: Bearer <token>
- **discover**: Search the catalog by capability, not vendor name.
- **inspect**: Read one operation's real contract, params, and version.
- **run**: Execute an operation. Quoted, reserved, and settled once.
- **runs_get**: Fetch one run's status and evidence by id.
- **runs_list**: Page through this tenant's run history.
- **balance**: Read remaining budget before spending it.

### ~/.codex/config.toml

```toml
[mcp_servers.coset]
url = "https://api.looot.ai/mcp"
bearer_token = "<YOUR_AGENT_TOKEN>"
```

### prove it works

```bash
coset run ipinfo-lite --input '{"ip":"8.8.8.8"}' --wait 60
```
