Read usage from an MCP client
ast mcp runs the CLI as a local MCP server. Each ast insights command becomes a tool, so an agent such as Claude Code or Cursor can read the numbers on the 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
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
Other clients
The tools read your current account, the one ast 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:
Each tool takes days (7, 14, 30, or 90), and the two list tools take limit and offset. ast insights describes each one.
The other read tools, such as ast agent usage and ast billing agents, are served too.
Next steps
- ast insights: run the same commands yourself
- Monitor agents: what Insights measures