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 accountsmcp_billing_cloudbillingBillingAccountsGet
- Get billing account detailsmcp_billing_cloudbillingBillingAccountsProjectsList
- List projects for billing account
Project Billing
mcp_billing_cloudbillingProjectsGetBillingInfo
- Get project billing informationmcp_billing_cloudbillingProjectsUpdateBillingInfo
- Update project billing settings
Budget Management
mcp_billing_billingbudgetsBudgetsList
- List budgets for billing accountmcp_billing_billingbudgetsBudgetsCreate
- Create new budget with alertsmcp_billing_billingbudgetsBudgetsGet
- Get budget detailsmcp_billing_billingbudgetsBudgetsUpdate
- Update existing budgetmcp_billing_billingbudgetsBudgetsDelete
- Delete budget
Service & Pricing Information
mcp_billing_cloudbillingServicesList
- List available GCP servicesmcp_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
- Go to Google Cloud Console
- Navigate to APIs & Services → Library
- Enable these APIs:
- Cloud Billing API
- Cloud Billing Budget API
1.2 Create Service Account with Proper Scopes
-
Go to IAM & Admin → Service Accounts
-
Click Create Service Account
-
Configure:
- Name: "AI Gateway Billing"
- Description: "Service account for MCP billing operations"
-
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.*
-
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
- Log into Cequence AI Gateway
- Navigate to MCP Servers
- Click Create New Server
2.2 Find Cloud Billing API
- Search for "Google Cloud Billing"
- Select the Cloud Billing API
- Click Create MCP Server
2.3 Configure Server Settings
- Server Name: "Cloud Billing"
- Description: "Cost management and financial governance"
- Base URL:
https://cloudbilling.googleapis.com/v1
- Request Timeout: 60 seconds
2.4 Upload Authentication
- Authentication Type: Service Account
- Upload your downloaded JSON key file
- Test Connection to verify setup
- 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
- Documentation: AI Gateway Docs
- Support: support@cequence.ai
- Cloud Billing Docs: cloud.google.com/billing/docs