SkillAgentSearch skills...

Gcp Cost MCP Server

šŸ’° An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go

Install / Use

/learn @nozomi-koborinai/Gcp Cost MCP Server
About this skill

Quality Score

0/100

Supported Platforms

Claude Code
Cursor

README

GCP Cost MCP Server

Note: This is an unofficial project and is not affiliated with, endorsed by, or supported by Google or the Genkit team.

AI Workflow Pipeline with Genkit

An MCP (Model Context Protocol) server for estimating Google Cloud running costs.

Instead of manually using the Google Cloud Pricing Calculator, you can get GCP cost estimates directly from AI assistants like Claude Desktop, Gemini CLI, or Cursor.

Features

Available Tools

| Tool | Description | |------|-------------| | get_estimation_guide | Start here! Dynamically generates estimation guides from SKU analysis for any GCP service | | list_services | Lists all available Google Cloud services with their IDs | | list_skus | Lists SKUs (billable items) for a specific service | | get_sku_price | Gets pricing details for a specific SKU | | estimate_cost | Calculates cost based on SKU and usage amount, with automatic free tier deduction |

Tool Relationships

Each tool is independent and stateless. AI assistants autonomously decide which tools to call and in what order based on context:

graph TB
    guide["get_estimation_guide<br/>─────────────────<br/>IN: service_name<br/>OUT: required params, pricing<br/>factors, free tier info, tips<br/>─────────────────<br/>Internally resolves<br/>service &amp; SKU lookup"]

    services["list_services<br/>─────────────────<br/>IN: name filter (opt)<br/>OUT: service_id, display_name"]

    skus["list_skus<br/>─────────────────<br/>IN: service_id, region, keyword<br/>OUT: sku_id, display_name,<br/>categories, regions"]

    price["get_sku_price<br/>─────────────────<br/>IN: sku_id, currency<br/>OUT: price/unit, pricing tiers"]

    cost["estimate_cost<br/>─────────────────<br/>IN: sku_id, usage_amount<br/>OUT: estimated cost with<br/>automatic free tier deduction<br/>─────────────────<br/>Internally resolves pricing"]

    services -- "service_id" --> skus
    skus -- "sku_id" --> price
    skus -- "sku_id" --> cost

Solid arrows show data flow — one tool's output feeds another's input. get_estimation_guide and estimate_cost are self-contained: they internally resolve their own dependencies, reducing round-trips.

| Use Case | How AI Uses the Tools | |----------|----------------------| | Quick estimate | get_estimation_guide → gather user requirements → estimate_cost | | Multi-service | Multiple get_estimation_guide + estimate_cost calls in parallel | | Explore pricing | list_services → list_skus → get_sku_price | | Direct calculation | estimate_cost with a known SKU ID |

Supported Services

get_estimation_guide works with any Google Cloud service:

  • Dynamic Guide Generation: Guides are generated dynamically by analyzing SKUs from the Cloud Billing Catalog API
  • Free Tier Information: Automatically fetched from GCP documentation and included in the guide
  • Universal Coverage: Works with all GCP services - no hardcoded service list

The tool analyzes available SKUs to determine:

  • Required parameters (region, instance type, storage, etc.)
  • Pricing factors and billing dimensions
  • Free tier quotas (when available)
  • Cost optimization tips

Quick Start

Prerequisites

  • Google Cloud SDK (gcloud) installed
  • Application Default Credentials configured

Note: No Google Cloud project setup or API enablement is required. This server accesses public pricing data using OAuth authentication.

1. Set up Authentication

gcloud auth application-default login

2. Install

Choose the installation method that best fits your environment:

Option A: Homebrew (macOS/Linux) — Recommended

The easiest way to install on macOS or Linux:

brew tap nozomi-koborinai/tap
brew install gcp-cost-mcp-server

The binary will be installed to /opt/homebrew/bin/gcp-cost-mcp-server (Apple Silicon) or /usr/local/bin/gcp-cost-mcp-server (Intel/Linux).

Upgrading to the latest version:

# Update tap to fetch the latest Formula
brew update

# Check the available version
brew info gcp-cost-mcp-server

# Upgrade to the latest version
brew upgrade gcp-cost-mcp-server

Note: Always run brew update first to ensure you get the latest version. Without it, Homebrew uses cached Formula information.

Option B: Download pre-built binary

Download from GitHub Releases for your platform:

| Binary | Platform | Architecture | |--------|----------|--------------| | gcp-cost-mcp-server-darwin-arm64 | macOS | Apple Silicon (M1/M2/M3/M4) | | gcp-cost-mcp-server-darwin-amd64 | macOS | Intel | | gcp-cost-mcp-server-linux-amd64 | Linux | x86_64 | | gcp-cost-mcp-server-windows-amd64.exe | Windows | x86_64 |

macOS users: After downloading, remove the quarantine attribute:

chmod +x gcp-cost-mcp-server-darwin-*
xattr -d com.apple.quarantine gcp-cost-mcp-server-darwin-*

Option C: Build from source

Requires Go 1.21+:

git clone https://github.com/nozomi-koborinai/gcp-cost-mcp-server.git
cd gcp-cost-mcp-server
go build -o gcp-cost-mcp-server .

3. Configure Your MCP Client

Find your binary path first:

# If installed via Homebrew
which gcp-cost-mcp-server
# Output: /opt/homebrew/bin/gcp-cost-mcp-server (Apple Silicon)
#         /usr/local/bin/gcp-cost-mcp-server (Intel/Linux)

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "gcp-cost": {
      "command": "/opt/homebrew/bin/gcp-cost-mcp-server"
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project or global config:

{
  "mcpServers": {
    "gcp-cost": {
      "command": "/opt/homebrew/bin/gcp-cost-mcp-server"
    }
  }
}

Gemini CLI

Add to ~/.gemini/settings.json:

{
  "mcpServers": {
    "gcp-cost": {
      "command": "/opt/homebrew/bin/gcp-cost-mcp-server"
    }
  }
}

Note: Replace /opt/homebrew/bin/gcp-cost-mcp-server with your actual binary path if different.

Usage Examples

Basic Cost Estimation (Conversational)

Start with a simple question - the AI will guide you through the details:

You: "How much would Cloud Run cost for 2 instances?"

AI: "To estimate Cloud Run costs accurately, I need a few more details:
    - Region: Where will this be deployed? (e.g., asia-northeast1, us-central1)
    - vCPU: How many vCPUs per instance? (e.g., 1, 2, 4)
    - Memory: How much memory per instance? (e.g., 1 GiB, 2 GiB)
    - Billing type: Instance-based or request-based?
    - Monthly usage: Will it run 24/7 (730 hours) or less?"

You: "Tokyo region, 1 vCPU, 2GB memory, instance-based, 24/7"

AI: "Based on your requirements for 2 Cloud Run instances in Tokyo (asia-northeast1):

    šŸ“Š Cost Breakdown:
    - vCPU: 2 vCPU Ɨ 2,628,000 sec = 5,256,000 vCPU-seconds
      Free tier applied: -180,000 vCPU-seconds
      Billable: 5,076,000 vCPU-seconds Ɨ $0.000024 = $121.82/month
    
    - Memory: 4 GiB Ɨ 2,628,000 sec = 10,512,000 GiB-seconds
      Free tier applied: -360,000 GiB-seconds
      Billable: 10,152,000 GiB-seconds Ɨ $0.0000025 = $25.38/month
    
    šŸ’° Total estimated: ~$147.20/month (free tier already applied)
    
    šŸ’” Tip: Cloud Run's free tier (180,000 vCPU-sec + 360,000 GiB-sec/month) 
       has been automatically deducted from your estimate."

Explore Services and SKUs

You: "What's the service ID for Compute Engine?"
You: "List the available SKUs for Compute Engine in Tokyo region"
You: "How much would an n2-standard-4 instance cost for 730 hours?"

Any GCP Service

All services work with dynamic guide generation:

You: "How much would Vertex AI cost for my ML training?"

AI: "I'll generate an estimation guide for Vertex AI by analyzing available SKUs...
    
    Based on my analysis, to estimate Vertex AI costs, I need:
    1. Region: Where will training run?
    2. Machine type: What accelerator type? (e.g., NVIDIA T4, A100)
    3. Training hours: How long will training take?
    4. Storage: How much training data?
    
    Free tier note: Vertex AI offers $300 in free credits for new users.
    
    Would you like me to list the specific SKUs available for Vertex AI?"

Architecture Diagram Estimation (Multi-Service)

Upload an architecture diagram and get a complete cost breakdown:

You: [Upload architecture diagram image]
     "Please estimate the monthly cost for this architecture"

AI: "I've analyzed your architecture diagram. Here are the GCP services identified:
     - Cloud Run (Application layer)
     - Cloud SQL (Database)
     - Cloud Storage (Static files)
     - Cloud Load Balancing (Traffic distribution)
     
     To provide an accurate estimate, I need some details:
     
     šŸŒ Common Settings:
     - Region: Is asia-northeast1 (Tokyo) okay?
     
     šŸ“¦ Cloud Run:
     - vCPUs: 1? 2? 4?
     - Memory: 1GB? 2GB? 4GB?
     - Instance count: How many instances?
     - Uptime: 24/7 or specific hours only?
     
     šŸ—„ļø Cloud SQL:
     - Database type: MySQL? PostgreSQL?
     - Machine type: Dev (db-f1-micro)? Production (db-custom-2-4096)?
     - Storage: How many GB needed?
     - High Availability (HA): Required?"

You: "Tokyo region, Cloud Run with 1vCPU/2GB Ɨ 2 instances running 24/7,
      Cloud SQL PostgreSQL db-custom-2-4096, 100GB SSD with HA,
      Cloud Storage 50GB Standard"

AI: "Thank you! Here's your estimate (free tiers automatically applied):

     | Service            | Configuration                  | Monthly Cost |
     |--------------------|--------------------------------|--------------|
     | Cloud Run          | 2 Ɨ 1vCPU Ɨ 2GB (24/7)         | $147.20 ✨   |
     | Cloud SQL          | PostgreSQL, 2vCPU/4GB, 100GB HA| $178.50      |
     | Cloud Storage      | 50G
View on GitHub
GitHub Stars10
CategoryDevelopment
Updated7h ago
Forks1

Languages

Go

Security Score

95/100

Audited on Mar 19, 2026

No findings