GSC MCP Server

GSC MCP Server

A TypeScript Model Context Protocol server that provides 21 tools for interacting with the Google Search Console API, enabling search analytics, URL inspection, sitemap management, and more through AI assistants.

Category
访问服务器

README

GSC MCP Server

Google Search Console MCP Server — a TypeScript Model Context Protocol server that provides tools for interacting with the Google Search Console API through AI assistants like Claude Desktop.

This is a TypeScript port of the mcp-gsc Python server, fully compatible with the MCP specification.

Features

  • 21 MCP Tools covering all aspects of Google Search Console
  • Dual Authentication — OAuth 2.0 (browser login) and Service Account
  • Cross-platform — Windows, macOS, Linux
  • STDIO and SSE transport support
  • Zero-config fallbacks — sensible defaults for all settings
  • Safety-first — destructive operations disabled by default

Tools Overview

Category Tool Description
Auth reauthenticate Log out and re-login with a different Google account
Properties list_properties List all GSC sites you have access to
get_site_details Get verification and ownership info for a site
add_site Add a new property (destructive — disabled by default)
delete_site Remove a property (destructive — disabled by default)
Analytics get_search_analytics Top queries/pages with clicks, impressions, CTR, position
get_performance_overview Summary + daily trend for a time period
compare_search_periods Compare performance between two date ranges
get_search_by_page_query Queries driving traffic to a specific page
get_advanced_search_analytics Advanced filtering, sorting, and pagination
URL Inspection inspect_url_enhanced Detailed crawl/index/rich-result status for a URL
batch_url_inspection Inspect up to 10 URLs at once
check_indexing_issues Check multiple URLs for indexing problems
Sitemaps get_sitemaps List all sitemaps for a site
list_sitemaps_enhanced Detailed sitemap info with errors and warnings
get_sitemap_details Detailed info for a specific sitemap
submit_sitemap Submit or resubmit a sitemap
delete_sitemap Remove a sitemap (destructive — disabled by default)
manage_sitemaps All-in-one: list, details, submit, delete
Info get_capabilities List all tools, auth status, and getting started guide

Prerequisites

  • Node.js 18+ (LTS recommended)
  • A Google Cloud project with the Search Console API enabled
  • At least one authentication method set up (see below)

Installation

# Clone the repository
git clone <repo-url> gsc-mcp
cd gsc-mcp

# Install dependencies
npm install

# Build
npm run build

Authentication Setup

You must configure one of two authentication methods:

Option 1: OAuth 2.0 (Recommended)

Best for individual users. Opens a browser window for Google login.

  1. Create a Google Cloud project at console.cloud.google.com
  2. Enable the Google Search Console API
  3. Create OAuth 2.0 Client ID credentials (Desktop application type)
  4. Download the client secrets JSON file

Set the environment variable:

# Windows (PowerShell)
$env:GSC_OAUTH_CLIENT_SECRETS_FILE = "C:\path\to\client_secrets.json"

# macOS / Linux
export GSC_OAUTH_CLIENT_SECRETS_FILE="/path/to/client_secrets.json"

Or place the file as client_secrets.json in the project source directory.

On first use, the server will automatically open your browser for authentication. No manual token management needed.

Option 2: Service Account

Best for server/automation use cases.

  1. Create a service account in your Google Cloud project
  2. Download the JSON key file
  3. Add the service account email as a user in GSC for each property
# Windows (PowerShell)
$env:GSC_CREDENTIALS_PATH = "C:\path\to\service_account_credentials.json"

# macOS / Linux
export GSC_CREDENTIALS_PATH="/path/to/service_account_credentials.json"

Claude Desktop Configuration

Edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "gsc": {
      "command": "node",
      "args": [
        "C:\\path\\to\\gsc-mcp\\build\\index.js"
      ],
      "env": {
        "GSC_OAUTH_CLIENT_SECRETS_FILE": "C:\\path\\to\\client_secrets.json"
      }
    }
  }
}

For macOS/Linux, use forward slashes and the export-style environment configuration.

Restart Claude Desktop after saving. You should see the hammer icon in the input box.

Environment Variables

Variable Default Description
GSC_OAUTH_CLIENT_SECRETS_FILE (none) Absolute path to OAuth client secrets JSON
GSC_CREDENTIALS_PATH (none) Absolute path to service account credentials JSON
GSC_SKIP_OAUTH false Set to true to skip OAuth and use service account only
GSC_ALLOW_DESTRUCTIVE false Set to true to enable add/delete operations
GSC_DATA_STATE all all (matches GSC dashboard) or final (confirmed data only, 2-3 day lag)
GSC_CONFIG_DIR Platform default Override config directory for token storage
MCP_TRANSPORT stdio stdio or sse (HTTP SSE)
MCP_HOST 127.0.0.1 Host to bind when using SSE transport
MCP_PORT 3001 Port to bind when using SSE transport

Running with SSE Transport

# Windows (PowerShell)
$env:MCP_TRANSPORT = "sse"
$env:MCP_HOST = "0.0.0.0"
$env:MCP_PORT = "3001"
npm run start

# macOS / Linux
MCP_TRANSPORT=sse MCP_HOST=0.0.0.0 MCP_PORT=3001 npm run start

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run (stdio)
npm run start

Project Structure

gsc-mcp/
├── src/
│   ├── index.ts    # MCP server entry point + all 21 tool registrations
│   └── auth.ts     # Google authentication (OAuth 2.0 + Service Account)
├── build/          # Compiled JavaScript output
├── package.json
└── tsconfig.json

Credits

Original Python MCP-GSC server created by Amin Foroutan.

License

ISC

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选