Using AWS Model Context Protocol awslabs-cost-analysis-mcp-server
I've recently started using Claude Pro on the desktop. It can do a lot of things like simple coding and producing readable reports from data I was interested to learn about the Model Context Protocol recently. To greatly simplify what it does, it pushes external data into prompts With this crude method it seems possible that LLMs can be interoperable across differing corporate software, across different types of interface and could be a rosetta stone for a new dawn of one thing speaking to another I saw that AWS had a new set of MCP servers available, including one that dealt with billing and cost. I am interested in the costs so I did a quick try out. TDLR; this is not a new dawn step one, get the MCP server running The information to get the MCP server running with Claude Desktop was scanty but here is a recipe that worked for me (on a Mac) Do this in the shell. The uv thing is required. uv does some package management plus there is a uvx command that we need in the next step brew install uv uv python install 3.13 uv venv source .venv/bin/activate uv init costly cd costly uv add "mcp[cli]" httpx pip install awslabs-cost-analysis-mcp-server Do this in Claude Desktop -> settings -> developer -> edit config. The edit config for me opened vscode. Remove the empty braces and add. I have nothing in the MCP_SETTINGS_PATH. I really do have a AWS profile called Hauptsteuerung { "mcpServers": { "awslabs.core-mcp-server": { "command": "uvx", "args": [ "awslabs.core-mcp-server@latest" ], "env": { "FASTMCP_LOG_LEVEL": "ERROR", "MCP_SETTINGS_PATH": "/Users/jamesandrews/mcp/mcp.json" }, "autoApprove": [], "disabled": false }, "awslabs.cost-analysis-mcp-server": { "command": "uvx", "args": [ "awslabs.cost-analysis-mcp-server@latest" ], "env": { "AWS_PROFILE": "Hauptsteuerung", "FASTMCP_LOG_LEVEL": "ERROR" } } } } Now in the Claude window there is an extra icon that looks like a hammer. If I click on it it gives some info on the new MCP things I have installed prompting - hot or not Here's where it all goes wrong. I added an export file of our RDS servers. The phrase get_pricing_from_api service_code=AmazonRDS should get Claude to use the MCP to get the current up to date data from AWS api! I whacked in the prompt below, Claude confirmed that it was allowed to run the MCP commands, it was all looking great... the rdsapr2.csv file has the name of the RDS in column 2, region in column 4 and the instance size in column 5 using get_pricing_from_api service_code=AmazonRDS and the regions available in the rdsapr2.csv file, generate a report of the relative cost of each RDS instance in the rdsapr2 file I need to compare the no upfront 1 year RI vs. on demand cost This is the result it came out with RDS Instances Pricing Analysis Regional Distribution Region Number of Instances Percentage us-east-1 38 55.07% eu-west-1 13 18.84% eu-central-1 7 10.14% eu-west-2 6 8.70% ap-southeast-1 3 4.35% us-west-2 2 2.90% Total 69 100% Pricing Insights On-Demand vs Reserved Instance Cost Comparison Instance Type On-Demand Hourly Rate 1-Year No Upfront RI Rate Potential Savings db.t2.micro (MariaDB) $0.017 Not significant Minimal db.m5d.xlarge (Oracle SE2) $0.805 $0.576 28.4% db.t3.2xlarge (MySQL) $1.088 $0.765 29.7% db.r5.12xlarge (Oracle EE) $11.184 $6.469 42.2% db.z1d.12xlarge (SQL Server SE) $20.513 $19.385 5.5% db.x2iedn.16xlarge (MySQL) $35.533 $27.360 23.0% Cost Optimization Recommendations Regional Consolidation - 55% of instances are in us-east-1 - Consider consolidating or optimizing multi-region deployments Instance Type Analysis - High variation in instance sizes and types - Recommend comprehensive utilization review - Potential for significant cost savings through right-sizing Reserved Instance Strategy - Most instance types offer 20-40% savings with 1-year No Upfront RIs - Evaluate workload stability for potential RI purchases Database Engine Considerations - Mix of engines: Oracle, MySQL, SQL Server, MariaDB - Licensing costs vary significantly - Review BYOL vs. included license models Detailed Observations Lowest Cost Instance: db.t2.micro (MariaDB) at $0.017/hour Highest Cost Instance: db.z1d.12xlarge (SQL Server SE) at $20.513/hour Most Common Region: us-east-1 with 38 instances Least Utilized Region: us-west-2 with 2 instances Next Steps Conduct a comprehensive audit of current RDS instances Create a detailed utilization report Develop a rightsizing and cost optimization strategy Consider Reserved Instance purchases for stable workloads Implement tagging for better cost tracking and allocation Which is great exc

I've recently started using Claude Pro on the desktop. It can do a lot of things like simple coding and producing readable reports from data
I was interested to learn about the Model Context Protocol recently. To greatly simplify what it does, it pushes external data into prompts
With this crude method it seems possible that LLMs can be interoperable across differing corporate software, across different types of interface and could be a rosetta stone for a new dawn of one thing speaking to another
I saw that AWS had a new set of MCP servers available, including one that dealt with billing and cost. I am interested in the costs so I did a quick try out. TDLR; this is not a new dawn
step one, get the MCP server running
The information to get the MCP server running with Claude Desktop was scanty but here is a recipe that worked for me (on a Mac)
Do this in the shell. The uv thing is required. uv does some package management plus there is a uvx command that we need in the next step
brew install uv
uv python install 3.13
uv venv
source .venv/bin/activate
uv init costly
cd costly
uv add "mcp[cli]" httpx
pip install awslabs-cost-analysis-mcp-server
Do this in Claude Desktop -> settings -> developer -> edit config. The edit config for me opened vscode. Remove the empty braces and add. I have nothing in the MCP_SETTINGS_PATH. I really do have a AWS profile called Hauptsteuerung
{
"mcpServers": {
"awslabs.core-mcp-server": {
"command": "uvx",
"args": [
"awslabs.core-mcp-server@latest"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"MCP_SETTINGS_PATH": "/Users/jamesandrews/mcp/mcp.json"
},
"autoApprove": [],
"disabled": false
},
"awslabs.cost-analysis-mcp-server": {
"command": "uvx",
"args": [
"awslabs.cost-analysis-mcp-server@latest"
],
"env": {
"AWS_PROFILE": "Hauptsteuerung",
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}
Now in the Claude window there is an extra icon that looks like a hammer. If I click on it it gives some info on the new MCP things I have installed
prompting - hot or not
Here's where it all goes wrong. I added an export file of our RDS servers.
The phrase get_pricing_from_api service_code=AmazonRDS
should get Claude to use the MCP to get the current up to date data from AWS api! I whacked in the prompt below, Claude confirmed that it was allowed to run the MCP commands, it was all looking great...
the rdsapr2.csv file has the name of the RDS in column 2, region in column 4 and the instance size in column 5
using get_pricing_from_api service_code=AmazonRDS and the regions available in the rdsapr2.csv file, generate a report of the relative cost of each RDS instance in the rdsapr2 file
I need to compare the no upfront 1 year RI vs. on demand cost
This is the result it came out with
RDS Instances Pricing Analysis
Regional Distribution
Region | Number of Instances | Percentage |
---|---|---|
us-east-1 | 38 | 55.07% |
eu-west-1 | 13 | 18.84% |
eu-central-1 | 7 | 10.14% |
eu-west-2 | 6 | 8.70% |
ap-southeast-1 | 3 | 4.35% |
us-west-2 | 2 | 2.90% |
Total | 69 | 100% |
Pricing Insights
On-Demand vs Reserved Instance Cost Comparison
Instance Type | On-Demand Hourly Rate | 1-Year No Upfront RI Rate | Potential Savings |
---|---|---|---|
db.t2.micro (MariaDB) | $0.017 | Not significant | Minimal |
db.m5d.xlarge (Oracle SE2) | $0.805 | $0.576 | 28.4% |
db.t3.2xlarge (MySQL) | $1.088 | $0.765 | 29.7% |
db.r5.12xlarge (Oracle EE) | $11.184 | $6.469 | 42.2% |
db.z1d.12xlarge (SQL Server SE) | $20.513 | $19.385 | 5.5% |
db.x2iedn.16xlarge (MySQL) | $35.533 | $27.360 | 23.0% |
Cost Optimization Recommendations
- Regional Consolidation
- 55% of instances are in us-east-1
- Consider consolidating or optimizing multi-region deployments
- Instance Type Analysis
- High variation in instance sizes and types
- Recommend comprehensive utilization review
- Potential for significant cost savings through right-sizing
- Reserved Instance Strategy
- Most instance types offer 20-40% savings with 1-year No Upfront RIs
- Evaluate workload stability for potential RI purchases
- Database Engine Considerations
- Mix of engines: Oracle, MySQL, SQL Server, MariaDB
- Licensing costs vary significantly
- Review BYOL vs. included license models
Detailed Observations
- Lowest Cost Instance: db.t2.micro (MariaDB) at $0.017/hour
- Highest Cost Instance: db.z1d.12xlarge (SQL Server SE) at $20.513/hour
- Most Common Region: us-east-1 with 38 instances
- Least Utilized Region: us-west-2 with 2 instances
Next Steps
- Conduct a comprehensive audit of current RDS instances
- Create a detailed utilization report
- Develop a rightsizing and cost optimization strategy
- Consider Reserved Instance purchases for stable workloads
- Implement tagging for better cost tracking and allocation
Which is great except
- I have no MariaDB
- I have no db.z1d.12xlarge instances, not even one
- Most of my servers are postgresql which isn't mentioned
I queried this and
what is the name of the db.z1d.12xlarge server mentioned in the csv file?
Edit
I'll retrieve the name of the db.z1d.12xlarge server from the CSV file.
Analysis
I apologize, but it seems that there might be no db.z1d.12xlarge server in the actual CSV file, despite being mentioned in the pricing analysis. This could be because the pricing information comes from AWS's standard pricing API, while the specific servers in your CSV might differ.
So not quite got it doing any useful work yet but maybe some day soon :)