
Google Search Console API 的模型上下文协议服务器——可与 Claude Code 和 Claude Desktop 集成
概览
一款模型上下文协议(MCP)服务器,通过 Claude Code 和光标提供对 Google Search Console API 数据的程序化访问。 跳转到逐步设置指南,获取完整说明。 - 🔍 - 获取您可访问的所有Search Console属性 - 📊 - 带灵活筛选的搜索性能查询数据 - 🗺️ - 检索网站地图状态和索引统计 - 🔎 - 检查特定URL的详细索引状态 - 📤 - 请求Google索引或删除URL- 📈 - 比较两个时间段的搜索性能 - 🛡️ - 详细的错误信息及可操作指导 - 🔄 - 处理速率限制和暂时故障 - ✅ - 在API调用前验证所有参数 - 在搜索控制台注册的网站 - 网站所有权已验证- 访问你想查询的搜索控制台属性 - GCP项目(免费套餐即可)- 启用- 凭证(桌面应用类型)- (可选)启用,如果你想使用submit_url_for_indexing 💡 :你只需要设置GCP......
概述(AI 翻译)
一款模型上下文协议(MCP)服务器,通过 Claude Code 和光标提供对 Google Search Console API 数据的程序化访问。
快速启动
新加入MCP服务器吗? 跳转到逐步设置指南,获取完整说明。
特色
- 🔍 列表网站 - 获取你能访问的所有搜索控制台属性
- 📊 搜索分析 - 带灵活筛选的查询搜索性能数据
- 🗺️ Sitemap 信息 - 检索网站地图状态和索引统计
- 🔎 URL 检查 - 检查特定 URL 的详细索引状态
- 📤 提交URL进行索引 - 请求Google索引或删除URL。
- 📈 比较时期 - 比较两个时间段的搜索表现
- 🛡️ 稳健错误处理 - 详细错误信息及可操作指导
- 🔄 自动重试逻辑 - 处理速率限制和瞬态故障
- ✅ 输入验证 - 在 API 调用前验证所有参数
先修条件
在使用该MCP服务器之前,您需要:
1.谷歌搜索控制台
- 注册于搜索控制台的网站
- 网站所有权已验证
- 访问你想查询的搜索控制台属性
2.谷歌云平台(GCP)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Google Search Console MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to Google Search Console API data through Claude Code and Cursor.
Quick Start
New to this MCP server? Jump to Step-by-Step Setup Guide for complete instructions.
Features
- 🔍 List Sites - Get all Search Console properties you have access to
- 📊 Search Analytics - Query search performance data with flexible filtering
- 🗺️ Sitemap Information - Retrieve sitemap status and indexing statistics
- 🔎 URL Inspection - Check detailed indexing status of specific URLs
- 📤 Submit URL for Indexing - Request Google to index or remove URLs
- 📈 Compare Periods - Compare search performance between two time periods
- 🛡️ Robust Error Handling - Detailed error messages with actionable guidance
- 🔄 Automatic Retry Logic - Handles rate limits and transient failures
- ✅ Input Validation - Validates all parameters before API calls
Prerequisites
Before using this MCP server, you need:
1. Google Search Console
- Site registered in Search Console
- Site ownership verified
- Access to the Search Console property you want to query
2. Google Cloud Platform (GCP)
- A GCP project (free tier is sufficient)
- Google Search Console API enabled
- OAuth 2.0 Client ID credentials (Desktop app type)
- (Optional) Indexing API enabled if you want to use
submit_url_for_indexing
💡 Note: You only need to set up GCP once. The CLIENT_ID and CLIENT_SECRET are reusable across multiple sites in your Search Console.
Setup
1. Configure Claude Code
Create .mcp.json in your project root:
{
"mcpServers": {
"google-search-console": {
"command": "npx",
"args": ["-y", "-p", "google-search-console-mcp-server", "google-search-console-mcp"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}
⚠️ Important: The args must include all three parts:
"-y"- Auto-confirm npx prompt"-p", "google-search-console-mcp-server"- Package name"google-search-console-mcp"- Executable name (different from package name!)
💡 Note: GOOGLE_REDIRECT_URI defaults to http://localhost:8080 and doesn’t need to be specified unless you want to use a different port.
2. Get Google OAuth Credentials
💡 Tip: You can use an existing OAuth 2.0 Client ID from other services (Supabase, Firebase, etc.) or create a new one.
- Go to Google Cloud Console
- Create or select a project
- Enable APIs:
- Navigate to “APIs & Services” → “Enable APIs and Services”
- Search and enable “Google Search Console API”
- (Optional) Enable “Indexing API” if you want to use
submit_url_for_indexing
安装
npx -y -p google-search-console-mcp-server google-search-console-mcp配置
{
"mcpServers": {
"google-search-console": {
"command": "npx",
"args": ["-y", "-p", "google-search-console-mcp-server", "google-search-console-mcp"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}