Azure Pricing MCP Server
A Model Context Protocol server that enables programmatic querying of Azure resource pricing information from the Azure Retail Prices API through a structured four-step workflow.
README
Azure Pricing MCP Server
This project provides a Model Context Protocol (MCP) server that allows you to programmatically query Azure resource pricing. The server provides a structured workflow to retrieve pricing information from the Azure Retail Prices API.
Features
- Query Azure pricing data through a simple, structured workflow
- Get real-time pricing information from the Azure Retail Prices API
- Navigate through Azure service families, service names, and products
- Calculate monthly costs for Azure resources
System Requirements
- Python 3.8 or higher
- Internet connection to access the Azure Retail Prices API
- Permission to install Python packages
- No Azure account or credentials required (uses public pricing API)
Installation
-
Clone the repository:
git clone https://github.com/sboludaf/mcp-azure-pricing.git cd mcp-azure-pricing -
Create and activate a virtual environment:
python -m venv .venv- Windows:
.venv\Scripts\activate - macOS/Linux:
source .venv/bin/activate
- Windows:
-
Install the dependencies:
pip install -r requirements.txt
Usage
The MCP server provides a structured four-step workflow for accessing Azure pricing information:
- Get service families - Retrieve the list of available Azure service families
- Get service names - Get service names within a specific family
- Get products - Get products associated with a service
- Calculate monthly costs - Calculate the monthly cost for a specific product
Starting the MCP Server
source .venv/bin/activate # Activate the virtual environment
python azure_pricing_mcp_server.py
The server will start at http://0.0.0.0:8080 by default.
Available Endpoints
GET /sse: Server-Sent Events endpoint for MCP communicationGET /tools: Lists the available tools in the MCP server
MCP Client Configuration
To configure an MCP client to connect to this server, add the following to your mcp_config.json file:
"azure-pricing": {
"serverUrl": "http://localhost:8080/sse"
}
This configuration tells the MCP client to connect to the local server on port 8080 using the SSE endpoint. Make sure the URL matches the address and port your server is running on.
MCP Tools
The server provides four main tools that form a logical workflow for querying Azure pricing:
1. list_service_families
Description: Lists all available service families in Azure according to Microsoft's official documentation.
2. get_service_names
Description: Gets all unique service names within a specified service family.
Parameters:
service_family: The service family to query (e.g., 'Compute', 'Storage')region: Azure region (default: 'westeurope')max_results: Maximum number of results to process
3. get_products
Description: Gets product names from a specific service family.
Parameters:
service_family: The service family to queryregion: Azure region (default: 'westeurope')type: Price type (optional, e.g., 'Consumption', 'Reservation')service_name: Service name to filter by (optional)product_name_contains: Filter products whose name contains this text (optional)limit: Maximum number of products to return (optional)
4. get_monthly_cost
Description: Calculates the monthly cost of a specific Azure product.
Parameters:
product_name: Exact name of the product (e.g., 'Azure App Service Premium v3 Plan')region: Azure region (default: 'westeurope')monthly_hours: Number of hours per month (default: 730)type: Price type (optional, e.g., 'Consumption')
Error Handling
The MCP server includes a robust error handling system that:
- Provides descriptive error messages when resources cannot be found
- Properly handles Azure API errors
- Logs detailed information for debugging purposes
Common Error Scenarios
- Product not found: When a product name doesn't exist in the specified region
- Service family not found: When an invalid service family is specified
- API rate limits: When the Azure Retail Prices API rate limits are exceeded
- Network errors: When the server cannot connect to the Azure API
Limitations
- Prices are estimates based on public information from the Azure Retail Prices API
- Does not include all possible discounts, account-specific offers, or additional costs like taxes or support
- The Azure Retail Prices API has rate limits that can affect performance with a high volume of requests
- Prices may vary depending on the region and currency selected
- Not all Azure resources are available in all regions
Contributing
Contributions are welcome! Here's how you can contribute to this project:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。