Gcpinframcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Gcpinframcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A Model Context Protocol (MCP) server that provides 30+ read-only tools for querying Google Cloud Platform infrastructure. Designed for AI assistants, Terraform workflow support, and any MCP-compatible client.
Each user authenticates with their own base64-encoded GCP service account key — no credentials are stored on the server.
.tf filesMCP Client
│
│ Authorization: Bearer <base64_sa_key>
▼
┌──────────────────────────────────────┐
│ main.py (Starlette ASGI app) │
│ ├── GET /sse → SSE stream │
│ ├── POST /messages/ → MCP messages │
│ └── GET /health → health check │
│ │
│ src/auth.py → decode token, set ctx │
│ src/server.py → shared FastMCP instance │
│ │
│ src/tools/compute.py (5 tools) │
│ src/tools/networking.py (17 tools) │
│ src/tools/gke.py (4 tools) │
│ src/tools/regions.py (4 tools) │
│ src/tools/inventory.py (3 tools) │
│ │
│ src/gcp_clients.py → client factories│
└──────────────────────────────────────┘
│
▼
Google Cloud APIs (Compute, Container, DNS, Asset Inventory)| Requirement | Minimum Version |
|---|---|
| Python | 3.10+ |
| pip | latest |
| GCP Service Account | with read-only roles |
| Docker (optional) | 20+ |
cd gcpmcp
# Create and activate a virtual environment
python -m venv venv
# Linux / macOS
source venv/bin/activate
# Windows (PowerShell)
.\venv\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txtdocker build -t gcp-mcp-server .python main.py| Flag | Default | Description |
|---|---|---|
--host | 0.0.0.0 | Bind address |
--port | 8080 | Listen port |
--log-level | info | debug / info / warning / error |
Example:
python main.py --host 127.0.0.1 --port 9000 --log-level debugdocker run -p 8080:8080 gcp-mcp-servercurl http://localhost:8080/health
# {"status":"healthy","server":"gcp-infrastructure-mcp"}PROJECT_ID=your-project-id
# Create the service account
gcloud iam service-accounts create mcp-reader \
--display-name="MCP Infrastructure Reader"
# Grant read-only roles
for ROLE in roles/compute.viewer roles/container.viewer \
roles/dns.reader roles/cloudasset.viewer; do
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member="serviceAccount:mcp-reader@${PROJECT_ID}.iam.gserviceaccount.com" \
--role="$ROLE"
done
# Download the JSON key
gcloud iam service-accounts keys create sa-key.json \
--iam-account=mcp-reader@${PROJECT_ID}.iam.gserviceaccount.comLinux / macOS:
TOKEN=$(base64 -w 0 < sa-key.json)
echo "$TOKEN"Windows (PowerShell):
$TOKEN = [Convert]::ToBase64String([IO.File]::ReadAllBytes("sa-key.json"))
Write-Output $TOKEN| Role | Purpose |
|---|---|
roles/compute.viewer | VMs, disks, VPCs, subnets, firewalls, LBs, routes |
roles/container.viewer | GKE clusters and node pools |
roles/dns.reader | Cloud DNS zones and records |
roles/cloudasset.viewer | Cloud Asset Inventory searches |
Set your MCP client to connect with:
http://<server-host>:8080/sse{
"mcpServers": {
"gcp-infrastructure": {
"url": "http://localhost:8080/sse",
"token": "<BASE64_ENCODED_SERVICE_ACCOUNT_KEY>"
}
}
}{
"mcpServers": {
"gcp-infrastructure": {
"url": "https://mcp.example.com/sse",
"token": "<BASE64_ENCODED_SERVICE_ACCOUNT_KEY>"
}
}
}Note: Different users can connect simultaneously, each with their own token pointing to a different GCP project.
| Tool | Description |
|---|---|
list_compute_instances | List VMs (all zones or specific zone) |
get_compute_instance | Get full details of a specific VM |
list_disks | List persistent disks |
list_instance_templates | List instance templates |
list_machine_types | List available machine types in a zone |
| Tool | Description |
|---|---|
list_vpcs | List VPC networks |
get_vpc | Get VPC details (peerings, routing) |
list_subnets | List subnets (all regions or specific) |
get_subnet | Get subnet details (CIDR, gateway) |
list_firewalls | List firewall rules |
get_firewall | Get firewall rule details |
list_routes | List all routes |
| Tool | Description |
|---|---|
list_addresses | List reserved / static IPs |
| Tool | Description |
|---|---|
list_forwarding_rules | Regional LB frontends |
list_global_forwarding_rules | Global HTTP(S)/SSL/TCP LB frontends |
list_backend_services | LB backend services |
list_url_maps | HTTP(S) LB URL routing |
list_target_pools | Classic network LB backends |
list_health_checks | Health checks |
| Tool | Description |
|---|---|
list_ssl_certificates | SSL certificates for HTTPS LBs |
| Tool | Description |
|---|---|
list_dns_zones | Cloud DNS managed zones |
list_dns_records | DNS record sets in a zone |
| Tool | Description |
|---|---|
list_gke_clusters | List GKE clusters |
get_gke_cluster | Cluster details (networking, add-ons, security) |
list_gke_node_pools | Node pools for a cluster |
get_gke_server_config | Supported K8s versions & image types |
| Tool | Description |
|---|---|
list_regions | All GCP regions |
get_region | Region details (quotas, zones) |
list_zones | All GCP zones |
get_zone | Zone details (status, CPU platforms) |
| Tool | Description |
|---|---|
search_cloud_resources | Full-text search across all resources |
list_cloud_assets | List assets by type |
get_infrastructure_summary | Resource counts by type (quick audit) |
This server is purpose-built for infrastructure-as-code workflows:
get_infrastructure_summary to see what's deployed..tf files.terraform plan output against live state.User: "List all VPCs and generate Terraform for them"
AI: → calls list_vpcs → gets 3 VPCs with auto-subnets
→ calls list_subnets → maps CIDRs per region
→ generates google_compute_network + google_compute_subnetwork resourcessrc/tools/compute.py, src/tools/networking.py, etc.) or create a new src/tools/<name>.py module.mcp from src.server and credentials helpers from src.auth.@mcp.tool().main.py so the tools get registered.# src/tools/storage.py (example)
from src.server import mcp
from src.auth import get_credentials, get_project_id
from src.gcp_clients import run_sync, format_response
@mcp.tool()
async def list_storage_buckets(project_id=None, max_results=100):
"""List Cloud Storage buckets."""
credentials = get_credentials()
project = project_id or get_project_id()
# ... call GCS API ...Then add to main.py:
import src.tools.storage # noqa: F401gcpmcp/
├── main.py # Entry point — HTTP server + route handlers
├── src/
│ ├── __init__.py
│ ├── server.py # Shared FastMCP instance
│ ├── auth.py # Token decoding + per-session credential mgmt
│ ├── gcp_clients.py # GCP client factories + proto-to-dict helpers
│ └── tools/
│ ├── __init__.py
│ ├── compute.py # Compute Engine tools (5)
│ ├── networking.py # VPC / firewall / DNS / LB tools (17)
│ ├── gke.py # GKE tools (4)
│ ├── regions.py # Region & zone tools (4)
│ └── inventory.py # Cloud Asset Inventory tools (3)
├── requirements.txt # Python dependencies
├── Dockerfile # Container image
└── README.md # This file| Concern | Mitigation |
|---|---|
| Token in transit | Use HTTPS (TLS) in production — the Bearer token is a full credential. |
| Least privilege | Grant only viewer / reader roles — never editor or owner. |
| Key rotation | Rotate service account keys regularly; delete unused keys. |
| Network access | Restrict the MCP server to trusted networks (VPN, firewall rules). |
| Secrets in VCS | Never commit sa-key.json or base64 tokens to version control. |
| Server hardening | Run as a non-root user in Docker; pin dependency versions. |
MIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.