Skip to main content

Azure Billing MCP Server

A Model Context Protocol (MCP) server for Azure Billing integration. This server provides tools for interacting with Azure's Billing and Cost Management APIs, allowing you to query cost analysis, budgets, usage details, and other billing information.

Features

  • Cost Analysis: Analyze your Azure costs with various timeframes and granularity options
  • Budget Management: View existing budget information
  • Usage Details: Get detailed information about resource usage
  • Subscription Information: Retrieve subscription details
  • Price Sheet: Access pricing information for Azure services

Installation

pip install mcp-azure-billing

Azure Credentials

To use this MCP server, you'll need to set up an Azure service principal with permissions to access billing information. Here's how to obtain the necessary credentials:

  1. Create an Azure AD application and service principal:

    az ad sp create-for-rbac --name "AzureBillingMCP" --role "Cost Management Reader" --scopes /subscriptions/{SUBSCRIPTION_ID}
    

    This command will output application (client) ID, tenant ID, and client secret.

  2. Verify the permissions:

    Ensure the service principal has at least the "Cost Management Reader" role assigned at the subscription level to access billing data.

  3. Required Credentials:

    • AZURE_BILLING_TENANT_ID: Your Azure AD tenant ID
    • AZURE_BILLING_CLIENT_ID: The application (client) ID of your service principal
    • AZURE_BILLING_CLIENT_SECRET: The client secret value
    • AZURE_BILLING_SUBSCRIPTION_ID: Your Azure subscription ID

Configuration

Set the following environment variables:

export AZURE_BILLING_TENANT_ID="your_tenant_id"
export AZURE_BILLING_CLIENT_ID="your_client_id"
export AZURE_BILLING_CLIENT_SECRET="your_client_secret" 
export AZURE_BILLING_SUBSCRIPTION_ID="your_subscription_id"

Usage

Starting the server directly

mcp-azure-billing

Using with Claude Desktop

Add the following to your claude_desktop_config.json file:

"mcp-azure-billing": {
  "command": "uvx",
  "args": [
    "mcp-azure-billing"
  ],
  "env": {
    "AZURE_BILLING_TENANT_ID": "your_tenant_id",
    "AZURE_BILLING_CLIENT_ID": "your_client_id",
    "AZURE_BILLING_CLIENT_SECRET": "your_client_secret",
    "AZURE_BILLING_SUBSCRIPTION_ID": "your_subscription_id"
  }
}

Replace the environment variables with your actual Azure credentials.

Available Tools

  • get_cost_analysis: Analyze Azure costs with customizable timeframes, granularity, and grouping
  • get_budgets: Retrieve information about all configured budgets for the subscription
  • get_usage_details: Get detailed usage information for a specified date range
  • get_subscription_details: Retrieve details about the current Azure subscription
  • get_price_sheet: Get pricing information for Azure services

Available Resources

  • azure_billing://subscription: Details about the current Azure subscription
  • azure_billing://billing-summary: Summary of current billing for the subscription
  • azure_billing://budgets: Information about all configured budgets

Available Prompts

  • analyze_costs: Template for analyzing Azure costs with customizable parameters
  • budget_recommendations: Template for getting budget recommendations based on usage patterns
  • cost_reduction: Template for getting cost reduction suggestions

Security Notes

  • Store your Azure credentials securely - they provide access to potentially sensitive billing information
  • Consider using environment variables rather than hardcoding credentials
  • Ensure your service principal has the minimum necessary permissions

Limitations

  • This server provides read-only access to billing information
  • Some operations may take time to complete due to the nature of the Azure Cost Management API
  • Usage data may not reflect the most recent activities (typically 8-24 hour delay)

Version

0.0.1

Metadata

Release files for mcp-azure-billing 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-azure-billing 0.0.3
File Size Uploaded
mcp_azure_billing-0.0.3.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-azure-billing 0.0.3
File Interpreter ABI Platform
mcp_azure_billing-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / mcp_azure_billing-0.0.3.tar.gz

Download URL mcp_azure_billing-0.0.3.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
07993c0c5984b414b9615feefb36a052d767f20b0f49d02ca40f2ad169478343
BLAKE2b-256 checksum
How to use checksums
39f53e253668e2143246b4a4466c4ae01aa0957d87cdd62efd6242cb444347a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.13

Release files / mcp_azure_billing-0.0.3-py3-none-any.whl

Download URL mcp_azure_billing-0.0.3-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6b1245184640c9f19356422008a3af9a2b9ba33365f046295e6159af61d709c
BLAKE2b-256 checksum
How to use checksums
ae259b11f490840eff8e73c3d922738f70db8f7d3bd1140e5d414390884c334d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.13

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page