- Node.js 20 or higher
- npm or yarn
- Azure subscription (for pricing data)
# Clone or navigate to the project
cd azurepricing.mcp
# Install dependencies
npm install
# Build TypeScript
npm run build# Run basic tests
npm test
# Expected output:
✅ Search prices PASS
✅ Calculate cost PASS
✅ Terraform estimation PASS
✅ List resources PASS# Development mode (auto-reload)
npm run mcp:dev
# Or build and run
npm run mcp:buildThe server will start and listen for MCP protocol messages.
Add to .vscode/settings.json in your Terraform project:
{
"mcp.servers": {
"azure-pricing": {
"command": "node",
"args": ["/absolute/path/to/azurepricing.mcp/dist/mcp/server.js"]
}
}
}Close and reopen VS Code to load the MCP server.
Open Copilot Chat and try:
What's the monthly cost of a Standard_D2s_v3 VM in East US?
Or:
Show me available VMs in the D-series for East US
The server provides 5 tools:
- searchPrices - Search Azure pricing by service/SKU/region
- calculateCost - Calculate costs with time periods
- discoverVmOptions - Find available VM SKUs
- estimateTerraformCost - Estimate complete Terraform plan
- listSupportedResources - List supported resource types
Calculate monthly cost for:
- VM: Standard_D2s_v3
- Region: East US
- OS: Linux
{
"planned_values": {
"root_module": {
"resources": [
{
"type": "azurerm_linux_virtual_machine",
"values": {
"size": "Standard_D2s_v3",
"location": "eastus"
}
}
]
}
}
}Paste this into Copilot Chat:
Estimate cost for this Terraform plan: [paste JSON]
What VMs are available in the D-series with 4 vCPUs?
The server supports 11 Terraform resource types:
| Resource | Discovery | Example SKU |
|---|---|---|
| Linux VMs | ✅ Auto | Standard_D2s_v3 |
| Windows VMs | ✅ Auto | Standard_D2s_v3 |
| AKS Clusters | ✅ Auto | Standard_D4s_v3 |
| Storage Accounts | ❌ Manual | Standard LRS |
| MySQL Databases | ❌ Manual | GP_Gen5_2 |
| PostgreSQL | ❌ Manual | GP_Gen5_2 |
| SQL Database | ❌ Manual | S0 |
| Cosmos DB | ❌ Manual | Standard |
| App Service Plans | ❌ Manual | S1 |
| Public IPs | ❌ Manual | Static |
- Read the usage guide: doc/02-usage/README.md
- Explore resource types: doc/03-resources/README.md
- Learn cost calculations: doc/02-usage/cost-calculation.md
- Run comprehensive tests:
npm run test:all
# Check for build errors
npm run build
# Test manually
node dist/mcp/server.js- Check absolute path in settings.json
- Restart VS Code
- Check VS Code Output panel for errors
This is normal for some resources due to Azure API pagination. See Testing Guide.
Ready to explore? Continue to Usage Guide
Microsoft, Azure, Terraform, and GitHub are trademarks of their respective owners.
This is an independent open-source project and is not affiliated with, endorsed by, or sponsored by Microsoft Corporation, HashiCorp, Inc., or GitHub, Inc.
This tool is designed to work with Microsoft Azure services and the Terraform infrastructure-as-code tool.