# Connect Claude Code to looot

looot connects to Claude Code as a single MCP server: discover, inspect, run, runs_get, runs_list, balance, scoped to one tenant, backed by an audit log.

## Setup

Setup installs the looot CLI and shows you the REST API directly, so any agent that can run a shell command or an HTTP request can use it.

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.

### add the MCP server

```bash
claude mcp add coset https://api.looot.ai/mcp --transport http --header "Authorization: Bearer <YOUR_AGENT_TOKEN>"
```

### prove it works

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