# AWS Billing — how to use (mcp.ai)

AWS Cost Explorer cost, forecast, and anomaly reporting through user-connected IAM credentials.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_aws_billing?ms=1781045340000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `aws_billing_anomalies`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/aws_billing`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/aws_billing/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/aws_billing/anomalies` — Get normalized AWS Cost Anomaly Detection anomalies for a date range. The adapter drains NextPageToken internally.
  - body: { days_back?: integer, start_date?: string, end_date?: string, limit?: integer, account?: string }
- `POST https://api.mcp.ai/api/aws_billing/cost` — Get normalized AWS Cost Explorer cost and usage with daily breakdown and top services. The adapter drains NextPageToken internally.
  - body: { days_back?: integer, start_date?: string, end_date?: string, granularity?: string, group_by?: string, account?: string }
- `POST https://api.mcp.ai/api/aws_billing/forecast` — Get normalized AWS Cost Explorer forecast for the next 30 days or an explicit date range.
  - body: { start_date?: string, end_date?: string, granularity?: string, metric?: string, account?: string }
- `POST https://api.mcp.ai/api/aws_billing/list/accounts` — List AWS Billing credential records linked to this install.
  - body: { account?: string }

## Example prompts
- "Show AWS cost by service for the last 30 days"
- "Forecast AWS spend for the next month"
- "List recent AWS cost anomalies"

## More
- Page: https://mcp.ai/aws_billing
- Agent spec (llms.txt): https://mcp.ai/aws_billing/llms.txt
- Postman collection: https://mcp.ai/aws_billing/postman.json
