# Azure Pricing MCP Server π°
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/msftnadavbh/AzurePricingMCP/actions/workflows/test.yml)
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
```bash
# Clone and setup
git clone https://github.com/msftnadavbh/AzurePricingMCP.git
cd AzurePricingMCP
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Test the server
python -m azure_pricing_mcp
```
Then configure your AI assistant. See [Integrations](#-integrations).
---
## β¨ Features
- **Price Search** - Query Azure prices with flexible filters
- **Price Comparison** - Compare costs across regions or SKUs
- **Cost Estimation** - Calculate monthly/yearly costs
- **Reserved Instances** - Compare RI pricing with break-even analysis
- **Region Recommendations** - Find the cheapest regions for any SKU
- **SKU Discovery** - Fuzzy matching for service names
- **Retirement Warnings** - Alerts for retiring VM SKUs
- **Spot VM Intelligence** - Eviction rates and price history (requires Azure auth)
- **Orphaned Resources** - Detect unused resources with real cost calculation (requires Azure auth)
- **PTU Sizing** - Estimate Provisioned Throughput Units for Azure OpenAI deployments
π **[Full feature details β](docs/FEATURES.md)**
---
## π οΈ Tools
13 tools available for AI assistants:
- `azure_price_search` - Search retail prices
- `azure_price_compare` - Compare across regions/SKUs
- `azure_ri_pricing` - Reserved Instance pricing
- `azure_cost_estimate` - Usage-based cost estimation
- `azure_region_recommend` - Find cheapest regions
- `azure_discover_skus` / `azure_sku_discovery` - SKU lookup
- `spot_eviction_rates` / `spot_price_history` / `simulate_eviction` - Spot VM tools
- `find_orphaned_resources` - Detect orphaned resources with cost analysis
- `azure_ptu_sizing` - Estimate PTUs for Azure OpenAI deployments
π **[Tool documentation β](docs/TOOLS.md)**
---
## π Installation
**Docker (Easiest):**
```bash
docker build -t azure-pricing-mcp .
docker run -i azure-pricing-mcp
```
**Python:**
```bash
pip install -r requirements.txt
```
π **[Full installation guide β](INSTALL.md)**
---
## π Integrations
Works with any MCP-compatible AI assistant:
- **VS Code** with GitHub Copilot
- **Claude Desktop**
π **[Integration setup β](docs/INTEGRATIONS.md)**
---
## π Project Structure
```
AzurePricingMCP/
βββ src/azure_pricing_mcp/ # Main package
β βββ server.py # MCP server
β βββ handlers.py # Tool handlers
β βββ client.py # Azure API client
β βββ services/ # Business logic
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ scripts/ # Setup scripts
```
π **[Detailed structure β](docs/PROJECT_STRUCTURE.md)**
---
## π API Reference
This server uses the [Azure Retail Prices API](https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices):
```
https://prices.azure.com/api/retail/prices
```
**No authentication required** - The Azure Retail Prices API is publicly accessible.
---
## π€ Contributing
We welcome contributions!
### Quick Start
```bash
git clone https://github.com/YOUR_USERNAME/AzurePricingMCP.git
cd AzurePricingMCP
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/
```
### Guidelines
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit changes (`git commit -m 'Add amazing feature'`)
4. Push to branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
### Code Style
- Follow PEP 8
- Add type hints
- Include docstrings
- Run `black`, `ruff`, and `mypy` before submitting
π **[Full contribution guide β](CONTRIBUTING.md)**
---
## π Documentation
| Document | Description |
|----------|-------------|
| [INSTALL.md](INSTALL.md) | Installation guide |
| [docs/FEATURES.md](docs/FEATURES.md) | Feature details |
| [docs/TOOLS.md](docs/TOOLS.md) | Tool documentation |
| [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md) | VS Code & Claude setup |
| [docs/USAGE_EXAMPLES.md](docs/USAGE_EXAMPLES.md) | Detailed examples |
| [docs/ORPHANED_RESOURCES.md](docs/ORPHANED_RESOURCES.md) | Orphaned resources guide |
| [CHANGELOG.md](CHANGELOG.md) | Version history |
---
## π License
MIT License - see [LICENSE](LICENSE) for details.
---
## π Acknowledgments
- **Original Author**: [@charris-msft](https://github.com/charris-msft)
- **Current Maintainer**: [@msftnadavbh](https://github.com/msftnadavbh)
- **Contributors**: [@notoriousmic](https://github.com/notoriousmic), [@iditbnaya](https://github.com/iditbnaya)
- [Model Context Protocol](https://modelcontextprotocol.io/)
- [Azure Retail Prices API](https://learn.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices)
---
## π¬ Support
- **Issues**: [GitHub Issues](https://github.com/msftnadavbh/AzurePricingMCP/issues)
- **Discussions**: [GitHub Discussions](https://github.com/msftnadavbh/AzurePricingMCP/discussions)
---
<p align="center">
Made with β€οΈ for the Azure community
</p>