# Connect VS Code to looot

Add looot to VS Code's GitHub Copilot agent mode with one click, or through .vscode/mcp.json. VS Code opens the browser to sign in.

## Setup

Add looot's MCP server (https://api.looot.ai/mcp) in .vscode/mcp.json, then sign in on looot.ai in the browser when VS Code asks. There is no token to paste.

On a machine with no browser, use the Headless block below and paste an agent token from looot.ai Settings when asked.

- VS Code registers its client with dynamic client registration and opens the browser to sign in.

## The 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

Browser sign-in (OAuth) comes first. The blocks marked Headless are the fallback for machines with no browser; their token placeholder stands for an agent token.

- **MCP endpoint**: https://api.looot.ai/mcp
- **Sign-in**: Browser sign-in (OAuth) on looot.ai, the first time the client connects
- **Headless fallback**: Authorization: Bearer <agent token>
- **Install in VS Code**: https://vscode.dev/redirect/mcp/install?name=looot&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.looot.ai%2Fmcp%22%7D
- **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.

### One-click link

```text
vscode:mcp/install?%7B%22name%22%3A%22looot%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.looot.ai%2Fmcp%22%7D
```

### Command line

```bash
code --add-mcp '{"name":"looot","type":"http","url":"https://api.looot.ai/mcp"}'
```

### .vscode/mcp.json

```json
{
  "servers": {
    "looot": {
      "type": "http",
      "url": "https://api.looot.ai/mcp"
    }
  }
}
```

### Headless: .vscode/mcp.json with a prompted secret

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "looot-token",
      "description": "looot agent token",
      "password": true
    }
  ],
  "servers": {
    "looot": {
      "type": "http",
      "url": "https://api.looot.ai/mcp",
      "headers": {
        "Authorization": "Bearer ${input:looot-token}"
      }
    }
  }
}
```

### prove it works

```text
Ask your agent: "Use looot to run ipinfo-lite with {"ip":"8.8.8.8"} and tell me the status and the cost."
```
