Azure Pricing
HTTP-SSEMCP server for querying Azure resource pricing through a structured workflow.
MCP server for querying Azure resource pricing through a structured workflow.
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.
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
.venv\Scripts\activate
source .venv/bin/activate
Install the dependencies:
pip install -r requirements.txt
The MCP server provides a structured four-step workflow for accessing Azure pricing information:
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.
GET /sse: Server-Sent Events endpoint for MCP communicationGET /tools: Lists the available tools in the MCP serverTo 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.
The server provides four main tools that form a logical workflow for querying Azure pricing:
Description: Lists all available service families in Azure according to Microsoft's official documentation.
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 processDescription: 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)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')The MCP server includes a robust error handling system that:
Contributions are welcome! Here's how you can contribute to this project:
git checkout -b feature/amazing-featuregit commit -m 'Add some amazing feature'git push origin feature/amazing-featureThis project is licensed under the MIT License - see the LICENSE file for details.