
This project provides a Model Context Protocol (MCP) server that allows you to programmatically query Azure resource pricing.
概览
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. - 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 - 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) The MCP server provides a structured four-step workflow for accessing Azure pricing information: 1. - Retrieve the list of available Azure service families 2. - Get service names within a specific family 3. - Get products associated with a service 4.
README
以下为原文 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:
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →