Skip to main content
Glama
Google Cloud Docs MCP Server

Google Cloud Docs MCP Server

by longngo192

Google Cloud Docs MCP Server

License: MIT Node.js Version MCP SDK

An MCP (Model Context Protocol) server that provides AI assistants with access to Google Cloud Platform documentation. This enables Claude and other MCP-compatible assistants to search, fetch, and understand GCP documentation in real-time.

Table of Contents

Related MCP server: GCP MCP

Features

  • Free-form Search: Search GCP documentation with natural language queries

  • Content Extraction: Extract clean markdown content from documentation pages

  • 80+ Topic Mappings: Pre-configured mappings for common GCP topics

  • Relevance Scoring: Smart ranking of search results by relevance

  • API Reference: Access REST API documentation for GCP services

  • 20+ GCP Products: Support for major Google Cloud services

How It Works

┌─────────────┐     ┌─────────────────┐     ┌──────────────────┐
│   Claude    │────▶│  MCP Server     │────▶│  Google Cloud    │
│  (or other  │     │  (this project) │     │  Documentation   │
│  MCP client)│◀────│                 │◀────│  (cloud.google   │
└─────────────┘     └─────────────────┘     │   .com/docs)     │
                                           └──────────────────┘
  1. Query Processing: When Claude receives a GCP-related question, it calls the MCP server tools

  2. Search Strategy: The server uses a multi-step search approach:

    • Google Search targeting site:cloud.google.com

    • Google Cloud's internal search API (fallback)

    • 80+ pre-configured topic mappings (fallback)

  3. Content Extraction: Uses Cheerio to parse HTML and extract clean markdown

  4. Relevance Scoring: Results are scored and sorted by query relevance

  5. Response: Returns structured JSON with documentation content

Technical Details

  • Protocol: MCP (Model Context Protocol) over stdio transport

  • Content Parsing: HTML to Markdown conversion with Cheerio

  • Search: Combines Google Search scraping with fallback topic mappings

  • Output Format: Structured JSON with markdown content

Prerequisites

  • Node.js >= 18.0.0

  • npm or yarn

  • Claude Desktop, Claude Code, or other MCP-compatible client

Installation

From Source

# Clone the repository
git clone https://github.com/longngo192/gcpdoc-mcp
cd gcpdoc-mcp

# Install dependencies
npm install

# Build the project
npm run build

Quick Start

npm install && npm run build

Configuration

Claude Desktop

Add to your Claude Desktop config file:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "google-cloud-docs": {
      "command": "node",
      "args": [
        "/path/to/google-cloud-docs-mcp/dist/index.js"
      ]
    }
  }
}

Claude Code CLI

# Add the MCP server
claude mcp add google-cloud-docs -- node /path/to/dist/index.js

# Verify installation
claude mcp list

Usage

Once configured, Claude will automatically use the GCP documentation tools when you ask questions about Google Cloud services.

Example Queries

"How do I set up VPC peering between two GCP projects?"
"What are the steps to enable CMEK encryption for Cloud Storage?"
"How to configure Cloud SQL high availability?"
"Show me GKE autoscaling configuration options"
"How to set environment variables in Cloud Run?"

Direct Tool Usage

If using MCP protocol directly:

// Search documentation
{
  "method": "tools/call",
  "params": {
    "name": "search_google_cloud_docs",
    "arguments": {
      "query": "vpc peering between projects"
    }
  }
}

// Fetch specific documentation
{
  "method": "tools/call",
  "params": {
    "name": "fetch_google_cloud_doc",
    "arguments": {
      "path": "vpc/docs/vpc-peering"
    }
  }
}

Available Tools

1. search_google_cloud_docs

Search GCP documentation with free-form queries. Primary tool for GCP questions.

Parameter

Type

Required

Description

query

string

Yes

Natural language search query

product

string

No

Filter by GCP product (e.g., 'compute', 'storage')

Example:

{
  "query": "how to share encrypted bucket cross account",
  "product": "storage"
}

2. fetch_google_cloud_doc

Fetch content from a specific documentation page.

Parameter

Type

Required

Description

path

string

Yes

Documentation path after cloud.google.com/

Example:

{
  "path": "storage/docs/encryption/customer-managed-keys"
}

3. list_google_cloud_products

List all supported GCP products and their documentation paths.

No parameters required.

4. get_api_reference

Get REST API reference for a GCP service.

Parameter

Type

Required

Description

service

string

Yes

Service name (e.g., 'compute', 'storage')

resource

string

No

Specific API resource (e.g., 'instances', 'buckets')

Example:

{
  "service": "compute",
  "resource": "instances"
}

Supported Topics

The server includes 80+ topic mappings for accurate search results:

Category

Topics

Storage & Encryption

encrypt, bucket, cmek, kms, customer managed, object storage

IAM & Security

iam, role, service account, impersonation, workload identity

Networking

vpc, peering, shared vpc, firewall, load balancer, dns, nat

Database

cloud sql, high availability, mysql, postgres, replica, failover

BigQuery

partition, cluster, materialized view, schedule

GKE

gke, autoscaling, node pool, horizontal pod autoscaler, helm

Serverless

cloud run, environment variable, cloud function, deploy

Container

docker, artifact registry, cloud build

Pub/Sub

pubsub, topic, subscription

Data Processing

dataflow, dataproc, composer, airflow, spark

Monitoring

logging, monitoring, metric, alert, dashboard, trace

Infrastructure

terraform, deployment manager, gcloud

Supported GCP Products

ID

Name

Description

compute

Compute Engine

Virtual machines and infrastructure

storage

Cloud Storage

Object storage service

bigquery

BigQuery

Data warehouse and analytics

kubernetes

GKE

Managed Kubernetes service

functions

Cloud Functions

Serverless compute platform

run

Cloud Run

Serverless containers

pubsub

Pub/Sub

Messaging and event ingestion

sql

Cloud SQL

Managed relational databases

firestore

Firestore

NoSQL document database

spanner

Cloud Spanner

Globally distributed database

ai

Vertex AI

Machine learning platform

iam

IAM

Identity and Access Management

vpc

VPC

Virtual Private Cloud networking

loadbalancing

Cloud Load Balancing

Global load balancing

logging

Cloud Logging

Log management and analysis

monitoring

Cloud Monitoring

Infrastructure monitoring

Project Structure

google-cloud-docs-mcp/
├── src/
│   └── index.ts          # Main MCP server implementation
├── dist/                  # Compiled JavaScript (generated)
├── package.json          # Project configuration
├── tsconfig.json         # TypeScript configuration
├── .gitignore           # Git ignore rules
├── LICENSE              # MIT License
└── README.md            # This file

Development

Running in Development Mode

# With hot reload
npm run dev

# Build and run
npm run build && npm start

Testing the Server

# Test MCP initialization
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | node dist/index.js

# Test tools/list
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | node dist/index.js

Building

npm run build

Contributing

Contributions are welcome! Here's how you can help:

Getting Started

  1. Fork the repository

  2. Clone your fork: git clone https://github.com/yourusername/google-cloud-docs-mcp.git

  3. Create a feature branch: git checkout -b feature/your-feature-name

  4. Make your changes

  5. Run tests and build: npm run build

  6. Commit your changes: git commit -m "Add your feature"

  7. Push to your fork: git push origin feature/your-feature-name

  8. Open a Pull Request

Contribution Ideas

  • Add more topic mappings: Expand the topicMappings object in src/index.ts

  • Support more GCP products: Add entries to GOOGLE_CLOUD_PRODUCTS

  • Improve content extraction: Enhance the Cheerio parsing logic

  • Add caching: Implement response caching to reduce API calls

  • Add tests: Write unit tests for search and content extraction

  • Documentation: Improve README or add usage examples

Code Style

  • Use TypeScript

  • Follow existing code patterns

  • Add comments for complex logic

  • Test your changes before submitting

Reporting Issues

Found a bug or have a suggestion? Please open an issue with:

  • Clear description of the problem

  • Steps to reproduce

  • Expected vs actual behavior

  • Your environment (Node.js version, OS)

Acknowledgments

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with love for the GCP and AI community

Available Tools

4 tools
fetch_google_cloud_docA

Fetch and extract content from a specific Google Cloud documentation page.

WHEN TO USE: Use this tool when you already know the exact documentation path you need, or when you want to get detailed content from a specific GCP documentation page.

INPUT: Documentation path after cloud.google.com/ (e.g., 'compute/docs/instances/create-start-instance', 'storage/docs/creating-buckets')

OUTPUT: Returns JSON with:

  • title: Page title

  • url: Full URL

  • content: Markdown-formatted documentation content (max 20,000 chars)

  • contentLength: Total content length

  • truncated: Whether content was truncated

COMMON PATHS:

  • Compute: compute/docs/instances/create-start-instance

  • Storage: storage/docs/creating-buckets, storage/docs/encryption

  • BigQuery: bigquery/docs/partitioned-tables, bigquery/docs/clustered-tables

  • Cloud SQL: sql/docs/high-availability, sql/docs/replication

  • GKE: kubernetes-engine/docs/how-to/cluster-autoscaler

  • IAM: iam/docs/understanding-roles, iam/docs/service-accounts

  • VPC: vpc/docs/vpc-peering, vpc/docs/shared-vpc

  • Cloud Run: run/docs/configuring/environment-variables

TIP: If you don't know the exact path, use 'search_google_cloud_docs' first to find relevant documentation.

Inputs: path (required).

get_api_referenceA

Get REST API reference documentation for a specific Google Cloud service.

WHEN TO USE: Use this tool when:

  • User needs API endpoints, methods, or parameters

  • User is developing integrations with GCP APIs

  • User asks about REST API for a specific GCP service

  • User needs to know available API resources for a service

INPUT:

  • service (required): GCP service name (compute, storage, bigquery, pubsub, sql, kubernetes, functions, run, iam)

  • resource (optional): Specific API resource (instances, buckets, datasets, topics, etc.)

SUPPORTED SERVICES & RESOURCES:

  • compute: instances, disks, networks, firewalls, images, machineTypes

  • storage: buckets, objects, notifications

  • bigquery: datasets, tables, jobs, routines

  • pubsub: topics, subscriptions, snapshots

  • sql: instances, databases, users, backupRuns

  • kubernetes: clusters, nodePools, operations

  • functions: functions, operations, locations

  • run: services, configurations, routes, revisions

  • iam: roles, serviceAccounts, policies

OUTPUT: Returns JSON with:

  • service: Service name

  • description: Service description

  • apiReferenceUrl: Full URL to API reference

  • availableResources: List of available resources for this service

  • documentation: Actual API documentation content (if available)

EXAMPLE USAGE:

  • Get Compute Engine API overview: service="compute"

  • Get Storage buckets API: service="storage", resource="buckets"

  • Get BigQuery datasets API: service="bigquery", resource="datasets"

Inputs: service (required), resource.

list_google_cloud_productsA

List all available Google Cloud products with their documentation paths.

WHEN TO USE: Use this tool when:

  • User wants to see what GCP services are available

  • User is exploring GCP products

  • You need to find the correct product ID for other tools

  • User asks "what GCP services are there?" or similar

OUTPUT: Returns JSON with:

  • totalProducts: Number of products listed

  • products: Array of products with id, name, docsPath, docsUrl, description

PRODUCTS INCLUDED (20+):

  • Compute: compute, kubernetes, functions, run, appengine

  • Storage: storage, firestore, spanner

  • Database: sql, bigquery

  • AI/ML: ai (Vertex AI), vision, speech, translate

  • Networking: vpc, loadbalancing, cdn, dns

  • Security: iam, kms

  • Messaging: pubsub

  • Monitoring: logging, monitoring

TIP: Use the returned 'docsPath' with 'fetch_google_cloud_doc' to get detailed documentation.

Inputs: no named parameters.

search_google_cloud_docsA

Search Google Cloud documentation with any free-form query. Returns relevant documentation with actual content.

WHEN TO USE: ALWAYS use this tool when the user asks about Google Cloud Platform (GCP) services, configurations, best practices, or how-to questions. This is the PRIMARY tool for GCP-related queries.

TRIGGERS - Use this tool when user asks about:

  • Any GCP service (Compute Engine, Cloud Storage, BigQuery, Cloud SQL, GKE, Cloud Run, IAM, VPC, etc.)

  • Configuration questions ("how to configure...", "how to setup...")

  • Best practices for GCP services

  • Troubleshooting GCP issues

  • Cross-project or cross-account scenarios

  • Security, encryption, permissions in GCP

  • Networking in GCP (VPC, peering, firewall, load balancer)

  • Database configurations (Cloud SQL HA, replicas, backups)

  • Container orchestration (GKE autoscaling, node pools)

  • Serverless (Cloud Run, Cloud Functions environment variables)

INPUT:

  • query (required): Free-form search query in natural language

  • product (optional): Filter by specific GCP product

EXAMPLE QUERIES:

  • "how to share encrypted bucket cross account"

  • "vpc peering between two projects"

  • "cloud sql high availability setup"

  • "gke autoscaling configuration"

  • "bigquery partition table"

  • "cloud run environment variables"

  • "iam service account impersonation"

  • "cloud storage cmek encryption"

  • "gke workload identity"

OUTPUT: Returns JSON with:

  • query: Original search query

  • totalResults: Number of results found

  • results: Array of top 3 docs with full content (title, url, content)

  • otherRelatedDocs: Additional related documentation URLs

SUPPORTED TOPICS (80+ mappings):

  • Storage & Encryption: encrypt, bucket, cmek, kms, customer managed, object storage

  • IAM & Security: iam, role, service account, impersonation, workload identity

  • Networking: vpc, peering, shared vpc, firewall, load balancer, dns, nat, private access

  • Database: cloud sql, high availability, mysql, postgres, replica, failover

  • BigQuery: partition, cluster, materialized view, schedule

  • GKE: gke, autoscaling, node pool, horizontal pod autoscaler, helm

  • Serverless: cloud run, environment variable, cloud function, deploy

  • Container: docker, artifact registry, cloud build

  • Pub/Sub: pubsub, topic, subscription

  • Data Processing: dataflow, dataproc, composer, airflow, spark

  • Monitoring: logging, monitoring, metric, alert, dashboard, trace

  • Infrastructure: terraform, deployment manager, gcloud

Inputs: query (required), product.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.6/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: fetch_google_cloud_doc retrieves specific documentation pages, get_api_reference provides API details, list_google_cloud_products enumerates available services, and search_google_cloud_docs performs general searches. The descriptions explicitly differentiate when to use each tool, preventing confusion.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with a clear verb_noun structure (fetch_google_cloud_doc, get_api_reference, list_google_cloud_products, search_google_cloud_docs). The naming is uniform and predictable across the set, making it easy for agents to understand and select tools.

    Tool Count5/5

    With 4 tools, the server is well-scoped for its purpose of accessing Google Cloud documentation and APIs. Each tool serves a unique function (fetching, searching, listing, and API reference), and the count is neither too sparse nor overwhelming, fitting typical MCP server ranges.

    Completeness5/5

    The tool set comprehensively covers the domain of Google Cloud documentation access: it supports fetching specific docs, searching broadly, listing products for exploration, and retrieving API references. There are no obvious gaps, as the tools enable agents to find, access, and understand GCP resources effectively.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with and manage Google Cloud Platform resources including Compute Engine, Cloud Run, Storage, BigQuery, and other GCP services through a standardized MCP interface.
      1
      6
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      Enables AI assistants to interact with Google Cloud Platform resources through natural language queries. Supports querying and managing GCP services like Compute Engine, Cloud Storage, BigQuery, and more across multiple projects and regions.
      9
      1,244 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to search and query documentation from multiple sources including Voiceflow and Claude Code, with full-text search, code examples retrieval, and step-by-step tutorials access.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Provides AI-powered search and documentation tools using Google Vertex AI or Gemini API with real-time web search grounding, enabling technical queries, code analysis, documentation retrieval, and architecture recommendations to overcome LLM knowledge gaps.
      7
      190 npm
      7
      MIT