MCP Hub
Back to servers

gcpdoc-mcp

A Google Cloud Documentation assistant that provides real-time access to GCP docs through search, content extraction, and API reference retrieval.

Tools
4
Updated
Dec 18, 2025

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

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.

ParameterTypeRequiredDescription
querystringYesNatural language search query
productstringNoFilter 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.

ParameterTypeRequiredDescription
pathstringYesDocumentation 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.

ParameterTypeRequiredDescription
servicestringYesService name (e.g., 'compute', 'storage')
resourcestringNoSpecific API resource (e.g., 'instances', 'buckets')

Example:

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

Supported Topics

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

CategoryTopics
Storage & Encryptionencrypt, bucket, cmek, kms, customer managed, object storage
IAM & Securityiam, role, service account, impersonation, workload identity
Networkingvpc, peering, shared vpc, firewall, load balancer, dns, nat
Databasecloud sql, high availability, mysql, postgres, replica, failover
BigQuerypartition, cluster, materialized view, schedule
GKEgke, autoscaling, node pool, horizontal pod autoscaler, helm
Serverlesscloud run, environment variable, cloud function, deploy
Containerdocker, artifact registry, cloud build
Pub/Subpubsub, topic, subscription
Data Processingdataflow, dataproc, composer, airflow, spark
Monitoringlogging, monitoring, metric, alert, dashboard, trace
Infrastructureterraform, deployment manager, gcloud

Supported GCP Products

IDNameDescription
computeCompute EngineVirtual machines and infrastructure
storageCloud StorageObject storage service
bigqueryBigQueryData warehouse and analytics
kubernetesGKEManaged Kubernetes service
functionsCloud FunctionsServerless compute platform
runCloud RunServerless containers
pubsubPub/SubMessaging and event ingestion
sqlCloud SQLManaged relational databases
firestoreFirestoreNoSQL document database
spannerCloud SpannerGlobally distributed database
aiVertex AIMachine learning platform
iamIAMIdentity and Access Management
vpcVPCVirtual Private Cloud networking
loadbalancingCloud Load BalancingGlobal load balancing
loggingCloud LoggingLog management and analysis
monitoringCloud MonitoringInfrastructure 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

Reviews

No reviews yet

Sign in to write a review