Azure Pricing MCP Server

Azure Pricing MCP Server

Provides AI assistants with real-time access to Azure retail pricing information, enabling price searches, regional cost comparisons, monthly bill estimates, and SKU discovery through natural language queries.

Category
访问服务器

README

Azure Pricing MCP Server 💰

Python 3.10+ MCP License: MIT

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.

<p align="center"> <img src="https://img.shields.io/badge/Azure-Pricing-0078D4?style=for-the-badge&logo=microsoft-azure&logoColor=white" alt="Azure Pricing"/> <img src="https://img.shields.io/badge/VS_Code-MCP-007ACC?style=for-the-badge&logo=visual-studio-code&logoColor=white" alt="VS Code MCP"/> </p>


🚀 Quick Start

# 1. Clone the repository
git clone https://github.com/msftnadavbh/AzurePricingMCP.git
cd azure-pricing-mcp

# 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_server

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
💰 Savings Plans View 1-year and 3-year savings plan pricing
🎯 Smart SKU Discovery Fuzzy matching for service names ("vm" → "Virtual Machines")
🌍 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

🛠️ Available Tools

Tool Description
azure_price_search Search Azure retail prices with flexible filtering
azure_price_compare Compare prices across regions or SKUs
azure_cost_estimate Estimate costs based on usage patterns
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

Prerequisites

  • Python 3.10+
  • pip (Python package manager)

Option 1: Automated Setup

# Windows PowerShell
.\setup.ps1

# Linux/Mac/Cross-platform
python setup.py

Option 2: Manual Setup

# Clone repository
git clone https://github.com/msftnadavbh/AzurePricingMCP.git
cd azure-pricing-mcp

# 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

Dependencies

mcp>=1.0.0
aiohttp>=3.9.0
pydantic>=2.0.0
requests>=2.31.0

🖥️ 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:

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

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

"command": "C:/path/to/azure-pricing-mcp/.venv/Scripts/python.exe"

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

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

💬 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)

🧪 Testing

Verify Installation

# Run the server directly (should start without errors)
python -m azure_pricing_server

# Run tests
python test_mcp_server.py

Test MCP Connection in VS Code

  1. Open Command Palette → MCP: List Servers
  2. Verify azure-pricing shows 6 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/azure-pricing-mcp.git
cd azure-pricing-mcp

# Create development environment
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Make your changes
# ...

# Test your changes
python test_mcp_server.py

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
  • Test your changes before submitting

Ideas for Contributions

  • [ ] Add support for Azure Reserved Instances pricing
  • [ ] Implement caching for frequently requested prices
  • [ ] Add more currency support
  • [ ] Create unit tests for all tools
  • [ ] Add support for Azure Government/China regions
  • [ ] Implement price alerts/notifications

📁 Project Structure

azure-pricing-mcp/
├── azure_pricing_server.py   # Main MCP server implementation
├── __init__.py               # Package initialization
├── __main__.py               # Module entry point
├── requirements.txt          # Python dependencies
├── setup.py                  # Automated setup script
├── setup.ps1                 # PowerShell setup script
├── test_mcp_server.py        # Test suite
├── README.md                 # This file
├── QUICK_START.md            # Quick start guide
├── USAGE_EXAMPLES.md         # Detailed usage examples
├── config_examples.json      # Example configurations
└── .vscode/
    └── mcp.json              # VS Code MCP configuration

🔌 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: Ensure no syntax errors in azure_pricing_server.py
  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


<p align="center"> Made with ❤️ for the Azure community </p>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选