Skip to main content
Glama
msftnadavbh

Azure Pricing MCP Server

by msftnadavbh

Azure Pricing MCP Server πŸ’°

Python 3.10+ MCP License: MIT Tests

A Model Context Protocol (MCP) server that provides AI assistants with real-time access to Azure retail pricing information. Query VM prices, compare costs across regions, estimate monthly bills, and discover available SKUsβ€”all through natural language.


πŸš€ Quick Start

# 1. Clone the repository git clone https://github.com/msftnadavbh/AzurePricingMCP.git cd AzurePricingMCP # 2. Set up virtual environment python -m venv .venv source .venv/bin/activate # Linux/Mac # .venv\Scripts\activate # Windows # 3. Install dependencies pip install -r requirements.txt # 4. Test the server python -m azure_pricing_mcp

Then configure your AI assistant (VS Code, Claude Desktop, etc.) to use the MCP server.


✨ Features

Feature

Description

πŸ” Price Search

Search Azure prices with filters (service, region, SKU, price type)

βš–οΈ Price Comparison

Compare costs across regions or between different SKUs

πŸ’‘ Cost Estimation

Calculate monthly/yearly costs based on usage hours

🎫 Reserved Instances

Compare 1-year and 3-year RI pricing with break-even analysis

πŸ’° Savings Plans

View 1-year and 3-year savings plan pricing

🎯 Smart SKU Discovery

Fuzzy matching for service names ("vm" β†’ "Virtual Machines")

🌍 Region Recommendations

Find the cheapest Azure regions for any SKU with savings analysis

πŸ’± Multi-Currency

Support for USD, EUR, GBP, and more

πŸ“Š Real-time Data

Live data from Azure Retail Prices API

🏷️ Customer Discounts

Apply discount percentages to all pricing queries

⚠️ Retirement Warnings

Automatic alerts for retiring/retired VM SKUs with migration guidance

🐳 Docker Support

Run in containers for easy deployment and isolation


πŸ› οΈ Available Tools

Tool

Description

azure_price_search

Search Azure retail prices with flexible filtering

azure_price_compare

Compare prices across regions or SKUs

azure_ri_pricing

Get Reserved Instance pricing and savings analysis

azure_cost_estimate

Estimate costs based on usage patterns

azure_region_recommend

Find cheapest regions for a SKU with savings percentages

azure_discover_skus

List available SKUs for a specific service

azure_sku_discovery

Intelligent SKU discovery with fuzzy name matching

get_customer_discount

Get customer discount information


πŸ“‹ Installation

πŸ“ New to setup? Check out INSTALL.md for detailed instructions or SETUP_CHECKLIST.md for a step-by-step checklist!
🐳 Prefer Docker? See DOCKER.md for containerized deployment!

Prerequisites

  • Python 3.10+ (or Docker for containerized deployment)

  • pip (Python package manager)

Option 1: Docker (Easiest)

docker build -t azure-pricing-mcp . docker run -i azure-pricing-mcp

Option 2: Automated Setup

# Windows PowerShell .\scripts\setup.ps1 # Linux/Mac/Cross-platform python scripts/install.py

Option 3: Manual Setup

# Clone repository git clone https://github.com/msftnadavbh/AzurePricingMCP.git cd AzurePricingMCP # Create virtual environment python -m venv .venv # Activate virtual environment source .venv/bin/activate # Linux/Mac .venv\Scripts\activate # Windows # Install dependencies pip install -r requirements.txt

πŸ–₯️ VS Code Integration

Step 1: Install GitHub Copilot

Ensure you have the GitHub Copilot extension installed.

Step 2: Configure MCP Server

Create or edit .vscode/mcp.json in your workspace:

Option A: Using Python Virtual Environment

{ "servers": { "azure-pricing": { "type": "stdio", "command": "/absolute/path/to/AzurePricingMCP/.venv/bin/python", "args": ["-m", "azure_pricing_mcp"] } } }

Windows users: Use the full path with forward slashes or escaped backslashes:

"command": "C:/Users/YourUsername/Projects/AzurePricingMCP/.venv/Scripts/python.exe"

Option B: Using Docker (stdio) 🐳

{ "servers": { "azure-pricing": { "type": "stdio", "command": "docker", "args": ["run", "-i", "--rm", "azure-pricing-mcp:latest"] } } }

Option C: Using Docker (SSE - Server-Sent Events) 🐳

# First, build and run the container with port mapping docker build -t azure-pricing-mcp . docker run -d -p 8080:8080 --name azure-pricing azure-pricing-mcp

Then configure .vscode/mcp.json:

{ "servers": { "azure-pricing": { "type": "sse", "url": "http://localhost:8080/sse" } } }

πŸ’‘ SSE Benefits: Better isolation through Docker, allows multiple clients to connect to the same server instance, and easier to debug with HTTP endpoints.

Step 3: Restart MCP Server

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)

  2. Run: MCP: List Servers

  3. Click the refresh/restart button next to azure-pricing

Step 4: Use in Copilot Chat

Open Copilot Chat and ask:

What's the price of Standard_D32s_v6 in East US 2?

You'll see the MCP tools being invoked with real Azure pricing data!


πŸ€– Claude Desktop Integration

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

Option A: Using Python

{ "mcpServers": { "azure-pricing": { "command": "python", "args": ["-m", "azure_pricing_mcp"], "cwd": "/path/to/AzurePricingMCP" } } }

Option B: Using Docker 🐳

{ "mcpServers": { "azure-pricing": { "command": "docker", "args": ["run", "-i", "--rm", "azure-pricing-mcp:latest"] } } }

πŸ’¬ Example Queries

Once configured, ask your AI assistant:

Query Type

Example

Basic Pricing

"What's the price of a D4s_v3 VM in West US 2?"

Multi-Node

"Price for 20 Standard_D32s_v6 nodes in East US 2"

Comparison

"Compare VM prices between East US and West Europe"

Cost Estimate

"Estimate monthly cost for D8s_v5 running 12 hours/day"

SKU Discovery

"What App Service plans are available?"

Savings Plans

"Show savings plan options for virtual machines"

Storage

"What are the blob storage pricing tiers?"

Sample Response

Standard_D32s_v6 in East US 2: - Linux On-Demand: $1.613/hour β†’ $23,550/month for 20 nodes - 1-Year Savings: $1.113/hour β†’ $16,250/month (31% savings) - 3-Year Savings: $0.742/hour β†’ $10,833/month (54% savings)

⚠️ Retirement Status Warnings

The server automatically checks VM SKUs against Microsoft's official retirement documentation and warns you when querying SKUs that are:

Status

Icon

Description

Retirement Announced

⚠️

SKU has a planned retirement date - migrate soon

Retired

🚫

SKU is no longer available for new deployments

Previous Generation

ℹ️

Newer versions available - consider upgrading

Example Warning Output

⚠️ RETIREMENT WARNING: Lsv2-series Status: Retirement Announced Retirement Date: 11/15/28 Recommendation: Migrate to Lsv3, Lasv3, Lsv4, or Lasv4 series Migration Guide: https://learn.microsoft.com/azure/virtual-machines/... ℹ️ PREVIOUS GENERATION: Ev3-series Status: Newer versions available Recommendation: Consider upgrading to Ev5 or Ev6 series

The retirement data is fetched dynamically from Microsoft's official documentation and cached for 24 hours.


πŸ§ͺ Testing

Verify Installation

# Run the server directly (should start without errors) python -m azure_pricing_mcp # Run tests pytest tests/

Test MCP Connection in VS Code

  1. Open Command Palette β†’ MCP: List Servers

  2. Verify azure-pricing shows 8 tools

  3. Open Copilot Chat and ask a pricing question


🀝 Contributing

We welcome contributions! Here's how to get started:

Development Setup

# Fork and clone the repository git clone https://github.com/YOUR_USERNAME/AzurePricingMCP.git cd AzurePricingMCP # Create development environment python -m venv .venv source .venv/bin/activate # Install dependencies pip install -e ".[dev]" # Make your changes # ... # Test your changes pytest tests/

Contribution Guidelines

  1. Fork the repository

  2. Create a branch for your feature (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to your branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

Code Style

  • Follow PEP 8 guidelines

  • Add type hints for function parameters and return values

  • Include docstrings for public functions

  • Run black, ruff, and mypy before submitting

  • Test your changes with pytest tests/


πŸ“ Project Structure

AzurePricingMCP/ β”œβ”€β”€ src/ β”‚ └── azure_pricing_mcp/ β”‚ β”œβ”€β”€ __init__.py # Package initialization β”‚ β”œβ”€β”€ __main__.py # Module entry point β”‚ β”œβ”€β”€ server.py # Main MCP server implementation β”‚ └── handlers.py # Tool handlers β”œβ”€β”€ scripts/ β”‚ β”œβ”€β”€ install.py # Installation script β”‚ β”œβ”€β”€ setup.ps1 # PowerShell setup script β”‚ └── run_server.py # Server runner β”œβ”€β”€ tests/ # Test suite β”œβ”€β”€ docs/ # Additional documentation β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ pyproject.toml # Package configuration β”œβ”€β”€ README.md # This file β”œβ”€β”€ QUICK_START.md # Quick start guide └── USAGE_EXAMPLES.md # Detailed usage examples

πŸ”Œ API Reference

This server uses the Azure Retail Prices API:

https://prices.azure.com/api/retail/prices

No authentication required - The Azure Retail Prices API is publicly accessible.


πŸ“š Additional Documentation


⚠️ Troubleshooting

Tools not appearing in VS Code

  1. Check Python syntax: Run python -m azure_pricing_mcp to check for errors

  2. Verify path: Use absolute paths in .vscode/mcp.json

  3. Restart server: Command Palette β†’ MCP: List Servers β†’ Restart

"No module named 'mcp'"

# Ensure you're in the virtual environment source .venv/bin/activate pip install mcp>=1.0.0

Connection errors

  • Check your internet connection

  • The Azure Pricing API may rate-limit requests (automatic retry is built-in)


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


πŸ“¬ Support


-
security - not tested
A
license - permissive license
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/msftnadavbh/AzurePricingMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server