Azure Pricing MCP server

Integrates with Microsoft's Azure Retail Prices API to provide service family listings, product filtering, and monthly cost calculations for cloud pricing analysis and budget planning workflows.
Back to servers
Setup instructions
Provider
sboludaf
Release date
Jun 03, 2025
Stats
5 stars

The Azure Pricing MCP Server provides a structured way to query Azure resource pricing information programmatically through the Model Context Protocol (MCP). This server interfaces with the Azure Retail Prices API, allowing you to retrieve real-time pricing data and calculate monthly costs for Azure resources without requiring an Azure account.

Installation

Prerequisites

  • Python 3.8 or higher
  • Internet connection
  • Permission to install Python packages

Setup Steps

  1. Clone the repository:

    git clone https://github.com/sboludaf/mcp-azure-pricing.git
    cd mcp-azure-pricing
    
  2. Create and activate a virtual environment:

    python -m venv .venv
    

    For Windows:

    .venv\Scripts\activate
    

    For macOS/Linux:

    source .venv/bin/activate
    
  3. Install the dependencies:

    pip install -r requirements.txt
    

Starting the Server

To start the MCP server:

source .venv/bin/activate  # Activate the virtual environment first
python azure_pricing_mcp_server.py

The server will start on http://0.0.0.0:8080 by default.

Configuring an MCP Client

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"
}

Make sure the URL matches the address and port your server is running on.

Using the MCP Tools

The server provides a four-step workflow for accessing Azure pricing information:

1. List Service Families

First, retrieve the available Azure service families:

Tool: list_service_families
Parameters: (none required)

This will return a list of all service families available in Azure.

2. Get Service Names

Next, get the service names within a specific family:

Tool: get_service_names
Parameters:
- service_family: "Compute" (or another family from step 1)
- region: "westeurope" (optional, default is "westeurope")
- max_results: 50 (optional, limits the number of results)

3. Get Products

Once you have a service family and name, you can retrieve products:

Tool: get_products
Parameters:
- service_family: "Compute"
- region: "westeurope" (optional)
- type: "Consumption" (optional)
- service_name: "Virtual Machines" (optional)
- product_name_contains: "VM" (optional)
- limit: 10 (optional)

4. Calculate Monthly Costs

Finally, calculate the monthly cost for a specific product:

Tool: get_monthly_cost
Parameters:
- product_name: "Azure App Service Premium v3 Plan"
- region: "westeurope" (optional)
- monthly_hours: 730 (optional, default is 730)
- type: "Consumption" (optional)

Error Handling

The server includes robust error handling for common scenarios:

  • Product not found in the specified region
  • Invalid service family
  • Azure API rate limit exceeded
  • Network connectivity issues

Limitations

  • Prices are estimates based on the Azure Retail Prices API
  • Does not include all possible discounts or account-specific offers
  • Additional costs like taxes or support are not included
  • API rate limits may affect performance with high request volumes
  • Pricing and availability vary by region

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "azure-pricing" '{"command":"python","args":["azure_pricing_mcp_server.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "azure-pricing": {
            "command": "python",
            "args": [
                "azure_pricing_mcp_server.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "azure-pricing": {
            "command": "python",
            "args": [
                "azure_pricing_mcp_server.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later