MCP ExplorerExplorer

Mcp Azure Billing

@curious-stackon 10 months ago
2 MIT
FreeCommunity
AI Systems
MCP server for Azure Billing integration, offering cost analysis, budget management, and usage details.

Overview

What is Mcp Azure Billing

mcp-azure-billing is a Model Context Protocol (MCP) server designed for Azure Billing integration, providing tools to interact with Azure’s Billing and Cost Management APIs.

Use cases

Use cases include analyzing Azure spending over time, managing budgets for cloud resources, tracking resource usage details, and retrieving subscription-related billing information.

How to use

To use mcp-azure-billing, install it via pip and set up an Azure service principal with the necessary permissions. Configure the required environment variables with your Azure credentials.

Key features

Key features include cost analysis with various timeframes, budget management, detailed usage information, subscription details retrieval, and access to Azure service pricing.

Where to use

mcp-azure-billing can be used in cloud cost management, financial analysis, and resource optimization within organizations utilizing Azure services.

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:

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

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers