> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Read usage from an MCP client

[`ast mcp`](/cli/top-level#mcp) runs the CLI as a local [MCP](https://modelcontextprotocol.io) server. Each [`ast insights`](/cli/insights) command becomes a tool, so an agent such as Claude Code or Cursor can read the numbers on the [Insights](https://astropods.com/insights) page: total spend, each day's spend, and spend by agent and by person.

The tools run as you, with your `ast login`, and see what you see on the Insights page.

## Before you start

* The [CLI](/install-cli), signed in with [`ast login`](/cli/top-level#login).
* An MCP client that can start a local server over stdio.

## Add the server

Add `ast mcp --read-only` to your client. `--read-only` serves only the tools that read, so the agent can't change anything in your account.

#### Claude Code

```bash
claude mcp add astropods -- ast mcp --read-only
```

#### Other clients

Add a stdio server whose command is `ast` and whose arguments are `mcp` and `--read-only`. Most clients take it as JSON:

```json
{
  "mcpServers": {
    "astropods": {
      "command": "ast",
      "args": ["mcp", "--read-only"]
    }
  }
}
```

The tools read your current account, the one [`ast account switch`](/cli/account#account-switch) sets. To pin one, add `--account <name>`.

## Ask about spend

Ask the agent a question, such as "What did our agents spend in the last 7 days, and which one spent the most?" It calls these tools:

| Tool               | Returns                                                                            |
| ------------------ | ---------------------------------------------------------------------------------- |
| `insights_summary` | Spend, requests, tokens, and active agents, with the change from the period before |
| `insights_daily`   | Each day's spend for the five agents that spent the most                           |
| `insights_agents`  | Agents and dev tools by spend, a page at a time                                    |
| `insights_people`  | People by spend, a page at a time                                                  |

Each tool takes `days` (`7`, `14`, `30`, or `90`), and the two list tools take `limit` and `offset`. [`ast insights`](/cli/insights) describes each one.

The other read tools, such as [`ast agent usage`](/cli/agent) and `ast billing agents`, are served too.

## Next steps

* [ast insights](/cli/insights): run the same commands yourself
* [Monitor agents](/monitor-agents): what Insights measures