AWS Pricing MCP Server
Analyzes Terraform projects to identify AWS services and provide pre-deployment cost estimates and insights.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AWS Pricing MCP Server estimate cost of t3.medium EC2 in us-east-1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AWS Pricing MCP Server
MCP server for generating upfront AWS service cost estimates and providing cost insights
Important Note: This server provides estimated pricing based on AWS pricing APIs and web pages. These estimates are for pre-deployment planning purposes and do not reflect the actual expenses of deployed cloud services.
Features
Analyze and visualize AWS costs
Get detailed breakdown of your AWS costs by service, region and tier
Understand how costs are distributed across various services
Provide pre-deployment cost estimates for infrastructure planning
Support for analyzing both CDK and Terraform projects to identify AWS services
Query cost data with natural language
Ask questions about your AWS costs in plain English, no complex query languages required
Get instant answers fetched from pricing webpage and AWS Pricing API, for questions related to AWS services
Retrieve estimated pricing information before actual cloud service deployment
Generate cost reports and insights
Generate comprehensive cost estimates based on your IaC implementation
Get cost optimization recommendations for potential cloud infrastructure
Provide upfront pricing analysis to support informed decision-making
Related MCP server: AWS Pricing Calculator MCP Server
Prerequisites
Install
uvfrom Astral or the GitHub READMEInstall Python using
uv python install 3.10Set up AWS credentials with access to AWS services
You need an AWS account with appropriate permissions
Configure AWS credentials with
aws configureor environment variablesEnsure your IAM role/user has permissions to access AWS Pricing API
Installation
Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit ~/.aws/amazonq/mcp.json):
{
"mcpServers": {
"awslabs.aws-pricing-mcp-server": {
"command": "uvx",
"args": ["awslabs.aws-pricing-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"AWS_PROFILE": "your-aws-profile"
},
"disabled": false,
"autoApprove": []
}
}
}or docker after a successful docker build -t awslabs/aws-pricing-mcp-server .:
# fictitious `.env` file with AWS temporary credentials
AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk {
"mcpServers": {
"awslabs.aws-pricing-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"--env-file",
"/full/path/to/file/above/.env",
"awslabs/aws-pricing-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}NOTE: Your credentials will need to be kept refreshed from your host
AWS Authentication
The MCP server uses the AWS profile specified in the AWS_PROFILE environment variable. If not provided, it defaults to the "default" profile in your AWS configuration file.
"env": {
"AWS_PROFILE": "your-aws-profile"
}Make sure the AWS profile has permissions to access the AWS Pricing API. The MCP server creates a boto3 session using the specified profile to authenticate with AWS services. Your AWS IAM credentials remain on your local machine and are strictly used for accessing AWS services.
Available Tools
5 toolsanalyze_cdk_projectA
Analyze a CDK project to identify AWS services used. This tool dynamically extracts service information from CDK constructs without relying on hardcoded service mappings.
Inputs: project_path (required).
analyze_terraform_projectB
Analyze a Terraform project to identify AWS services used. This tool dynamically extracts service information from Terraform resource declarations.
Inputs: project_path (required).
generate_cost_reportA
Generate a detailed cost analysis report based on pricing data for one or more AWS services.
This tool requires AWS pricing data and provides options for adding detailed cost information.
IMPORTANT REQUIREMENTS:
ALWAYS include detailed unit pricing information (e.g., "$0.0008 per 1K input tokens")
ALWAYS show calculation breakdowns (unit price × usage = total cost)
ALWAYS specify the pricing model (e.g., "ON DEMAND")
ALWAYS list all assumptions and exclusions explicitly
Output Format Options:
'markdown' (default): Generates a well-formatted markdown report
'csv': Generates a CSV format report with sections for service information, unit pricing, cost calculations, etc.
Example usage:
{
// Required parameters
"pricing_data": {
// This should contain pricing data retrieved from get_pricing
"status": "success",
"service_name": "bedrock",
"data": "... pricing information ...",
"message": "Retrieved pricing for bedrock from AWS Pricing url"
},
"service_name": "Amazon Bedrock",
// Core parameters (commonly used)
"related_services": ["Lambda", "S3"],
"pricing_model": "ON DEMAND",
"assumptions": [
"Standard ON DEMAND pricing model",
"No caching or optimization applied",
"Average request size of 4KB"
],
"exclusions": [
"Data transfer costs between regions",
"Custom model training costs",
"Development and maintenance costs"
],
"output_file": "cost_analysis_report.md", // or "cost_analysis_report.csv" for CSV format
"format": "markdown", // or "csv" for CSV format
// Advanced parameter for complex scenarios
"detailed_cost_data": {
"services": {
"Amazon Bedrock Foundation Models": {
"usage": "Processing 1M input tokens and 500K output tokens with Claude 3.5 Haiku",
"estimated_cost": "$80.00",
"free_tier_info": "No free tier for Bedrock foundation models",
"unit_pricing": {
"input_tokens": "$0.0008 per 1K tokens",
"output_tokens": "$0.0016 per 1K tokens"
},
"usage_quantities": {
"input_tokens": "1,000,000 tokens",
"output_tokens": "500,000 tokens"
},
"calculation_details": "$0.0008/1K × 1,000K input tokens + $0.0016/1K × 500K output tokens = $80.00"
},
"AWS Lambda": {
"usage": "6,000 requests per month with 512 MB memory",
"estimated_cost": "$0.38",
"free_tier_info": "First 12 months: 1M requests/month free",
"unit_pricing": {
"requests": "$0.20 per 1M requests",
"compute": "$0.0000166667 per GB-second"
},
"usage_quantities": {
"requests": "6,000 requests",
"compute": "6,000 requests × 1s × 0.5GB = 3,000 GB-seconds"
},
"calculation_details": "$0.20/1M × 0.006M requests + $0.0000166667 × 3,000 GB-seconds = $0.38"
}
}
},
// Recommendations parameter - can be provided directly or generated
"recommendations": {
"immediate": [
"Optimize prompt engineering to reduce token usage for Claude 3.5 Haiku",
"Configure Knowledge Base OCUs based on actual query patterns",
"Implement response caching for common queries to reduce token usage"
],
"best_practices": [
"Monitor OCU utilization metrics and adjust capacity as needed",
"Use prompt caching for repeated context across API calls",
"Consider provisioned throughput for predictable workloads"
]
}
}Inputs: pricing_data (required), service_name (required), format, exclusions, +6 more.
get_bedrock_patternsA
Get architecture patterns for Amazon Bedrock applications, including component relationships and cost considerations
Inputs: ctx.
get_pricingA
Get detailed pricing information from AWS Price List API with optional filters.
Service codes for API often differ from web URLs.
(e.g., use "AmazonES" for OpenSearch, not "AmazonOpenSearchService").
List of service codes can be found with `curl 'https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/index.json' | jq -r '.offers| .[] | .offerCode'`
IMPORTANT GUIDELINES:
- When retrieving foundation model pricing, always use the latest models for comparison
- For database compatibility with services, only include confirmed supported databases
- Providing less information is better than giving incorrect information
**TOOL PURPOSE:**
Retrieve AWS pricing data for various analysis needs: cost optimization, regional comparisons, compliance reporting, budget planning, or general pricing research.
**YOUR APPROACH:**
Follow a systematic discovery workflow to ensure accurate, complete results regardless of your specific use case.
**MANDATORY WORKFLOW - ALWAYS FOLLOW:**
**Step 1: Build Precise Filters**
```python
# FOR COST OPTIMIZATION: Create matrix of ALL minimum qualifying combinations
filters = {
"filters": [
{"Field": "memory", "Value": "8 GiB", "Type": "TERM_MATCH"},
{"Field": "instanceType", "Value": "m5.large", "Type": "TERM_MATCH"}
]
}
```
**Step 2: Execute Query**
```python
pricing = get_pricing('AmazonEC2', 'us-east-1', filters)
```
**COMMON USE CASES:**
**Cost Optimization (CRITICAL):**
- Build complete cross-product matrix of ALL qualifying attribute combinations
- Test every combination systematically: example: (min_memory × qualifying_storage × other_attributes)
- Start with minimum thresholds, test ALL possibilities - don't stop at first match
- Compare prices to find most cost-effective solution
- Prove optimality: Verify no cheaper option exists within requirements
**Regional Comparison:**
- Use identical filters across different regions
- Compare same instance types between us-east-1 vs eu-west-1
- Analyze pricing variations for capacity planning
**Compliance/Reporting:**
- Retrieve pricing for specific instance families or configurations
- Generate cost reports for budget planning
- Document pricing for procurement processes
**Research/Analysis:**
- Compare pricing across different service tiers
- Analyze cost implications of different configurations
- Investigate pricing patterns for forecasting
**CRITICAL REQUIREMENTS:**
- **USE SPECIFIC FILTERS**: Large services (EC2, RDS) require 2-3 filters minimum
- **VERIFY EXISTENCE**: Ensure all filter values exist in the service before querying
- **FOR "CHEAPEST" QUERIES**: Build complete matrix, test ALL qualifying combinations, prove optimality
**CONTEXT AND CONSTRAINTS:**
- **CURRENT PRICING ONLY:** Use get_price_list_file for historical data
- **NO SAVINGS PLANS/SPOT:** Only On-Demand and Reserved Instance pricing
- **REGION AUTO-FILTER:** 'region' parameter creates regionCode filter automatically
**REQUIRED INPUTS:**
- `service_code`: (e.g., 'AmazonEC2', 'AmazonS3')
- `region`: AWS region (e.g., 'us-east-1')
- `filters`: Built using discovered values (MANDATORY for large services)
- `max_allowed_characters`: Response limit (default: 100,000)
**ANTI-PATTERNS - AVOID THESE:**
❌ Using broad queries without specific filters on large services
❌ Assuming attribute values exist across different services/regions
❌ **Stopping at first qualifying option when seeking cheapest price**
❌ **Testing only "obvious" instance sizes - smaller may be cheaper**
**EXAMPLE USE CASES:**
**1. Cost Optimization Example:**
```python
# Find cheapest option meeting requirements
qualifying_memory = [m for m in memory_options if meets_requirement(m, "≥8GB")]
# Test combinations starting with minimum qualifying specs
```
**2. Regional Comparison Example:**
```python
# Compare same configuration across regions
filters = {"filters": [{"Field": "instanceType", "Value": "m5.large", "Type": "TERM_MATCH"}]}
us_pricing = get_pricing('AmazonEC2', 'us-east-1', filters)
eu_pricing = get_pricing('AmazonEC2', 'eu-west-1', filters)
```
**3. Research/Analysis Example:**
```python
# Compare different memory tiers for same instance family
memory_tiers = ["4 GiB", "8 GiB", "16 GiB"]
for memory in memory_tiers:
filters = {"filters": [{"Field": "memory", "Value": memory, "Type": "TERM_MATCH"}]}
pricing = get_pricing('AmazonEC2', 'us-east-1', filters)
```
**FILTERING STRATEGY:**
- **Large Services (EC2, RDS)**: ALWAYS use 2-3 specific filters to prevent 200+ record responses
- **Small Services**: May work with single filter or no filters
- **Multi-Region Analysis**: Use identical filters across regions for accurate comparison
- **Requirement-Based**: Systematically discover ALL options meeting criteria
- **Cost Optimization**: Start with minimum qualifying thresholds, use minimum-threshold filtering, test all qualifying combinations
**SUCCESS CRITERIA:**
✅ Applied appropriate filters for the service size
✅ For cost optimization: tested all qualifying combinations and proved optimality
Inputs: region (required), service_code (required), filters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: analyzing CDK vs Terraform projects, retrieving pricing data, retrieving Bedrock patterns, and generating cost reports. No two tools overlap in function.
All tools follow a consistent verb_noun naming pattern: analyze_cdk_project, analyze_terraform_project, get_pricing, get_bedrock_patterns, generate_cost_report. The verbs are descriptive and parallel where appropriate.
With 5 tools, the server is well-scoped for its purpose of AWS pricing and cost analysis. Each tool covers a distinct step in the workflow, and the count is within the ideal range.
Core workflow is covered: analyze IaC projects, get pricing, generate reports. However, the get_pricing description references a get_price_list_file tool for historical data that does not exist in this server, creating a minor gap. Service code discovery also relies on external commands rather than a built-in tool.
Maintenance
Related MCP Connectors
Hosted MCP server for AWS cloud spend: service breakdowns, anomalies, savings and forecasts.
- Costory FinOps MCPDeprecatedio.costory
FinOps harness MCP: allocated cloud, data and LLM bills. Build on it or switch. Cloud read-only.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Cloudflare Workers MCP server: ai-cost-optimizer
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server for unified cost tracking and analysis across AWS, OpenAI, and Anthropic. It enables users to query expenditures, compare costs across providers, and analyze usage trends through natural language.10MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that provides tools for automating AWS Pricing Calculator estimate generation.MIT
- AlicenseAqualityDmaintenanceAn MCP server for accessing real-time AWS pricing information and providing cost analysis capabilities, with no AWS credentials required.9Apache 2.0
- AlicenseAqualityBmaintenanceAn MCP server for running the Infracost CLI to estimate, compare, and publish infrastructure cost changes from Terraform and other IaC projects.8296 npmMIT