Skip to main content

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 individual application pages.

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 relevant application page for what to collect)

Create an MCP server

Find the API in the catalog

  1. Sign in to AI Gateway and select MCP Servers from the left navigation.
  2. Select New MCP Server.
  3. Search for the application you want to connect, then select it from the catalog.

Configure the server

  1. Enter a Name for your server — something descriptive that identifies both the application and its purpose (for example, "Zendesk Support — Prod").
  2. Enter a Description so your team knows what the server is for.
  3. Set the Timeout value. 30 seconds works for most APIs; increase to 60 seconds for APIs that return large payloads.
  4. Toggle Production mode on if this server will be used in a live workflow.
  5. Select Next.

Configure authentication

Enter the authentication details for the application. This varies by service — see the Authentication section of the relevant application page for the specific credentials, OAuth URLs, and scopes to use.

Configure security

  1. Set any Rate limits appropriate for your use case and the API's own limits.
  2. Enable Logging if you want AI Gateway to record requests and responses for auditing.
  3. Select Next.

Deploy

Review the summary, then select 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.
  • You can edit a server's name, description, timeout, and security settings after deployment without redeploying.

Authentication

Cost Explorer uses AWS Signature V4 authentication via IAM credentials. Configure an IAM user or role with Cost Explorer and Budgets permissions.

  • Service: ce (Cost Explorer) and 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.

ToolPurpose
Cost & Usage QueryAnalyze historical costs; filter by service, region, tags; drill down by dimensions
ForecastingProject future costs based on historical trends; get monthly forecasts
BudgetsCreate cost and usage budgets; set thresholds; configure budget alerts and actions
Savings RecommendationsGet Reserved Instance purchase recommendations; analyze Savings Plans opportunities
Anomaly DetectionIdentify unusual spending patterns; get alerts for cost anomalies
Cost AllocationTag-based cost tracking; apply custom cost categories; allocate costs to teams
ReportsExport 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.