Google Search Console MCP Server
Google Search Console MCP 服务器
从任何支持 MCP 协议的 AI 助手查询 Google Search Console 数据——包括排名、点击量、展示次数和页面级表现。
前置要求
Node.js 18+
拥有 Google Search Console 访问权限的 Google 账号
Related MCP server: Google Search Console + GA4 MCP Server
设置
1. 安装依赖
npm install2. 创建 Google Cloud 项目
创建一个新项目(或选择现有项目)
启用 Search Console API:
前往 APIs & Services > Library
搜索 "Search Console API"
点击启用
3. 创建 OAuth2 凭据
前往 APIs & Services > Credentials
点击 Create Credentials > OAuth client ID
应用类型:Desktop app(或 Web application)
随意命名
复制 Client ID 和 Client Secret
4. 配置你的 .env 文件
cp .env.example .env填入以下值:
变量 | 获取位置 |
| GSC 设置 > 关联 > Sc-domain (例如 |
| Google Cloud Console > 凭据 (来自第 3 步) |
| Google Cloud Console > 凭据 (来自第 3 步) |
5. 运行服务器
npm start首次运行时,浏览器窗口会自动打开以完成 OAuth 认证。之后,令牌将存储在本地的 .tokens.json 中,你将不会再次被提示。
连接到你的 AI 助手
此服务器通过 stdio(标准输入/输出)进行通信,这是将 MCP 服务器连接到 AI 助手的标准方式。配置你的 AI 助手使用:
node /path/to/src/index.js将 /path/to 替换为你机器上此项目的实际路径。
可用工具
getTopQueries
返回按点击量排名的热门搜索查询。
参数:
startDate(YYYY-MM-DD),endDate(YYYY-MM-DD),rowLimit(可选,默认 10)返回: 每行的查询词、点击量、展示次数、点击率 (CTR)、排名
getSiteSummary
返回网站整体搜索表现汇总。
参数:
startDate(YYYY-MM-DD),endDate(YYYY-MM-DD)返回: 总点击量、展示次数、点击率 (CTR)、平均排名
getPagePerformance
返回筛选至特定页面的表现数据。
参数:
pageUrl(GSC 中显示的精确 URL),startDate(YYYY-MM-DD),endDate(YYYY-MM-DD)返回: 该页面的点击量、展示次数、点击率 (CTR)、排名
getRankingChanges
查找两个时间段之间排名变化最大的页面。
参数:
days(要比较的天数,默认 28)返回: 页面 URL、排名变化、当前排名、之前排名
重要提示
切勿将 .env 或 .tokens.json 提交到版本控制系统。这些文件已通过 .gitignore 排除。
This server cannot be deployed
Maintenance
Related MCP Connectors
Query your Google Search Console, GA4 and Bing Webmaster data across every site you run.
Search Console SEO analytics: rankings, clicks, CTR, striking-distance insights, charts, sitemaps.
SEO rankings and traffic from Google Search Console for AI assistants, read-only
SEO & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides access to Google Search Console to retrieve and analyze search performance data including queries, pages, and rankings. It enables users to perform rich data analysis through customizable reporting periods and dimensions using the Search Console API.4,242 npmMIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables querying Google Search Console and Google Analytics 4 data to retrieve search performance and site analytics. It provides tools for listing web properties and running detailed reports using secure Google OAuth authentication.-
- AlicenseAqualityAmaintenanceProvides AI agents with read-only access to Google Search Console data, including search analytics, index coverage, and sitemap status. It enables users to query clicks, impressions, and ranking performance or check URL indexing status through natural language.4124 npm10MIT
- AlicenseAqualityDmaintenanceQuery Google Search Console search analytics, inspect URL indexing status, manage sitemaps, and analyze keyword performance. 13 tools covering search queries, page performance, sitemap management, and index coverage.13527 npm7MIT