AWS Cost Explorer MCP server
AWS Cost Explorer enables you to visualize, understand, and manage your AWS costs and usage over time with ML-powered forecasting and anomaly detection. With this MCP server, AI agents can analyze costs, forecast spending, identify optimization opportunities, and track budget health through natural language commands.
Setting up an MCP server
This article covers the standard steps for creating an MCP server in AI Gateway and connecting it to an AI client. The steps are the same for every integration — application-specific details (API credentials, OAuth endpoints, and scopes) are covered in the Authentication section on this page.
Before you begin
You'll need:
- Access to AI Gateway with permission to create MCP servers.
- API credentials for the application you're connecting (see the Authentication section on this page for what to collect).
Create an MCP server
Find the app in the catalog
- Sign in to AI Gateway and select App Catalog from the left navigation.
- Search for the application you want to connect, then select it from the catalog.
- Select Create MCP Server to start the wizard.
App Configuration
Confirm the Base URL for the API, then, under Tools, select the endpoints you want to expose. Select Next.
MCP Server Setup
- Enter a Name for your server — something descriptive that identifies both the application and its purpose.
- Enter a Description so your team knows what the server is for.
- Set the log level: choose Production Mode for terser logs, or Non-Production Mode for more verbose logs that can help with debugging.
- Select Next.
Authentication
Enter the authentication details for the application. This varies by service — see the Authentication section on this page for the specific credentials, OAuth URLs, and scopes to use.
Review
Look over the summary of your MCP server configuration, then select Create & Deploy. AI Gateway provisions the server and provides a server URL you'll use when configuring your AI client.
Connect to an AI client
Once your server is deployed, you'll need to add it to the AI client your team uses. Select your client for setup instructions:
Tips
- You can create multiple MCP servers for the same application — for example, a read-only server for reporting agents and a read-write server for automation workflows.
- If you're unsure which OAuth scopes to request, start with the minimum read-only set and add write scopes only when needed. Most application pages include scope recommendations.
Authentication
Cost Explorer uses AWS Signature V4 authentication through IAM credentials. Configure an IAM user or role with Cost Explorer and Budgets permissions. In the AWS Console, go to IAM > Users (or IAM > Roles), create a user or role with the required Cost Explorer and Budgets permissions, and generate access keys.
| Value | Setting |
|---|---|
| Service name | ce (Cost Explorer), budgets |
| Region | us-east-1 (Cost Explorer APIs are regional) |
| Required permissions | ce:* and budgets:* or specific actions |
| Credential types | IAM user access keys or assumed role credentials |
Available tools
The Cost Explorer MCP server exposes cost analysis, forecasting, budgets, recommendations, and anomaly detection APIs.
| Tool | Purpose |
|---|---|
| Cost & Usage Query | Analyze historical costs; filter by service, region, tags; drill down by dimensions |
| Forecasting | Project future costs based on historical trends; get monthly forecasts |
| Budgets | Create cost and usage budgets; set thresholds; configure budget alerts and actions |
| Savings Recommendations | Get Reserved Instance purchase recommendations; analyze Savings Plans opportunities |
| Anomaly Detection | Identify unusual spending patterns; get alerts for cost anomalies |
| Cost Allocation | Tag-based cost tracking; apply custom cost categories; allocate costs to teams |
| Reports | Export detailed cost reports; schedule recurring reports; customize report contents |
Tips
Implement consistent tagging across all resources (environment, team, project).
Use cost allocation tags to attribute costs to business units.
Regularly audit tag compliance and leverage tags for detailed cost analysis.
Set budgets by service, environment, or team based on your organizational structure.
Configure alerts at percentage thresholds (50%, 75%, 90%) to catch overages early.
Use budget notifications to email stakeholders.
Regularly review budgets.
Enable anomaly detection on high-spend services.
Set sensitivity thresholds appropriate for your baseline variance.
Use anomaly alerts to catch unexpected cost increases.
Investigate root causes promptly.
Review Reserved Instance recommendations quarterly.
Compare Savings Plans options against current usage patterns.
Analyze savings recommendations by service.
Consolidate smaller purchases for better discounts.
Generate monthly cost reports by service and team.
Track month-over-month cost trends.
Forecast quarterly and annual spending.
Share insights with business stakeholders to drive cost awareness.
Cequence AI Gateway