Skip to main content

Google Cloud Billing MCP Server

Create a powerful Model Context Protocol (MCP) server for Google Cloud Billing in minutes with our AI Gateway. This guide walks you through setting up seamless cost management with advanced budgeting, monitoring, and instant API authentication.

About Google Cloud Billing API

Google Cloud Billing provides comprehensive cost management and financial governance tools for Google Cloud Platform resources. The API enables organizations to monitor spending, optimize costs, set budgets and alerts, and gain detailed insights into cloud resource usage across projects and teams for better financial control and planning.

Available MCP Tools

Your Cloud Billing MCP server provides these tools for AI agents:

Billing Account Management

  • mcp_billing_cloudbillingBillingAccountsList - List all billing accounts
  • mcp_billing_cloudbillingBillingAccountsGet - Get billing account details
  • mcp_billing_cloudbillingBillingAccountsProjectsList - List projects for billing account

Project Billing

  • mcp_billing_cloudbillingProjectsGetBillingInfo - Get project billing information
  • mcp_billing_cloudbillingProjectsUpdateBillingInfo - Update project billing settings

Budget Management

  • mcp_billing_billingbudgetsBudgetsList - List budgets for billing account
  • mcp_billing_billingbudgetsBudgetsCreate - Create new budget with alerts
  • mcp_billing_billingbudgetsBudgetsGet - Get budget details
  • mcp_billing_billingbudgetsBudgetsUpdate - Update existing budget
  • mcp_billing_billingbudgetsBudgetsDelete - Delete budget

Service & Pricing Information

  • mcp_billing_cloudbillingServicesList - List available GCP services
  • mcp_billing_cloudbillingServicesSkusList - Get SKU pricing for services

Required OAuth Scopes

Your service account needs these specific scopes:

https://www.googleapis.com/auth/cloud-billing
https://www.googleapis.com/auth/cloud-platform

Note: The cloud-billing scope provides read/write access to billing data, while cloud-platform provides broader GCP access needed for some operations.

What You Can Do with Your MCP Server

Once created, your AI agents can use natural language to:

Billing Account Operations

  • "Show me all billing accounts and their status"
  • "Get details for billing account 01B9B2-85196F-A3C530"
  • "List all projects using this billing account"

Project Billing Management

  • "Check if project 'my-app' has billing enabled"
  • "Enable billing for project 'new-project'"
  • "Move project to different billing account"

Budget Management

  • "Create a $10,000 monthly budget for engineering team"
  • "List all active budgets"
  • "Set up budget alerts at 50%, 80%, and 100%"
  • "Update budget threshold to $15,000"
  • "Delete unused budget"

Cost Analysis

  • "Show me pricing for Compute Engine instances"
  • "List all available GCP services"
  • "Get SKU details for Cloud Storage"
  • "Compare pricing across different regions"

Prerequisites

  • Access to Cequence AI Gateway
  • Google Cloud Project with billing enabled
  • Billing Account Administrator access

Step 1: Create Authentication Credentials

1.1 Enable Required APIs

  1. Go to Google Cloud Console
  2. Navigate to APIs & ServicesLibrary
  3. Enable these APIs:
    • Cloud Billing API
    • Cloud Billing Budget API

1.2 Create Service Account with Proper Scopes

  1. Go to IAM & AdminService Accounts

  2. Click Create Service Account

  3. Configure:

    • Name: "AI Gateway Billing"
    • Description: "Service account for MCP billing operations"
  4. Grant Required Roles:

    • Billing Account Administrator (for full billing management)
    • Or create custom role with these permissions:
      • billing.accounts.get
      • billing.accounts.list
      • billing.budgets.*
      • billing.resourceAssociations.*
  5. Create and Download Key:

    • Click Create Key
    • Choose JSON format
    • Download and securely store the key file

1.3 Configure OAuth Scopes

Your service account automatically has access to these required scopes:

  • https://www.googleapis.com/auth/cloud-billing
  • https://www.googleapis.com/auth/cloud-platform

Step 2: Create Your MCP Server

2.1 Access AI Gateway

  1. Log into Cequence AI Gateway
  2. Navigate to MCP Servers
  3. Click Create New Server

2.2 Find Cloud Billing API

  1. Search for "Google Cloud Billing"
  2. Select the Cloud Billing API
  3. Click Create MCP Server

2.3 Configure Server Settings

  1. Server Name: "Cloud Billing"
  2. Description: "Cost management and financial governance"
  3. Base URL: https://cloudbilling.googleapis.com/v1
  4. Request Timeout: 60 seconds

2.4 Upload Authentication

  1. Authentication Type: Service Account
  2. Upload your downloaded JSON key file
  3. Test Connection to verify setup
  4. Click Deploy Server

Step 3: Using Your MCP Server

3.1 Connect with Claude Desktop

Add your MCP server to Claude Desktop configuration:

{
"servers": {
"cloud-billing": {
"url": "your-mcp-server-url"
}
}
}

3.2 Start Using Natural Language Commands

Your AI agent can now handle billing operations using simple commands:

  • "Show me all billing accounts and their status"
  • "Create a $10,000 monthly budget for the engineering team"
  • "Set up budget alerts at 50%, 80%, and 100%"
  • "List all projects using billing account 01B9B2-85196F-A3C530"
  • "Get pricing information for Compute Engine services"
  • "Enable billing for project 'my-new-app'"

Common Use Cases

  • Cost Monitoring: Track spending across projects and teams
  • Budget Management: Set up automated alerts and spending limits
  • Project Billing: Enable/disable billing for development projects
  • Cost Analysis: Analyze service pricing and usage patterns
  • Financial Reporting: Generate billing reports for stakeholders

Troubleshooting

Authentication Issues

  • Verify your service account has Billing Account Administrator role
  • Ensure both required APIs are enabled in your project
  • Check that your JSON key file is valid and not expired

Permission Errors

  • Confirm your billing account is active and accessible
  • Verify the service account has access to the specific billing account
  • Check organization-level IAM policies

Tool Failures

  • Some tools may return 404 errors if resources don't exist
  • Budget operations require an active (open) billing account
  • Project operations need valid project IDs

Getting Help