# gcpdoc-mcp
## 基本信息
- Slug: `longngo192-gcpdoc-mcp`
- Source: modelscope
- Publisher: @longngo192/gcpdoc-mcp
- Categories: cloud-platforms / documentation-access / search
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@longngo192/gcpdoc-mcp
## 简介
暂无描述。
## 安装提示

```bash
Claude MCP Server Google Cloud (or other (this project) Documentation MCP client) (cloud.google .com/docs)
```

## MCP Server 详情

# Google Cloud Docs MCP Server

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org)
[![MCP SDK](https://img.shields.io/badge/MCP%20SDK-1.0.0-blue)](https://github.com/modelcontextprotocol/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](#features)
- [How It Works](#how-it-works)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Available Tools](#available-tools)
- [Supported Topics](#supported-topics)
- [Project Structure](#project-structure)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)

## 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

```bash
# 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

```bash
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`

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

### Claude Code CLI

```bash
# 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:

```json
// 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:**
```json
{
  "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:**
```json
{
  "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:**
```json
{
  "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 id…

