Skip to navigation

Read usage from an MCP client

Let an agent answer questions about your account's AI spend through ast mcp
View as Markdown

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

  • The CLI, signed in with ast 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 mcp add astropods -- ast mcp --read-only

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:

ToolReturns
insights_summarySpend, requests, tokens, and active agents, with the change from the period before
insights_dailyEach day’s spend for the five agents that spent the most
insights_agentsAgents and dev tools by spend, a page at a time
insights_peoplePeople 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 describes each one.

The other read tools, such as ast agent usage and ast billing agents, are served too.

Next steps