saurabhsharma2u/search-console-mcp
简介
核心亮点
- 打通 Google 和 Bing 搜索后台实时数据
- 无需手动导出报表,直接用 AI 分析 SEO 趋势
- 快速查询关键词排名与页面索引状态
- 将搜索引擎管理能力集成至 AI 聊天界面
完整文档
<div align="center">
🔍 Search Console MCP
Google Search Console + Bing Webmaster Tools + GA4 — 集于同一个上下文窗口。
停止导出 CSV。开始向你的 AI agent 提问。



<br/>

📚 Docs · Quick Start · Tools · Backward Compatibility · Security
</div>
---
⚡ v2.0.2 更新内容* 📦 MCPB 一键安装包支持 (.mcpb): 为 Claude Desktop 提供拖拽式安装包安装。
- ⚡ 并行获取引擎 (
engine: "all"): 多引擎查询可并发获取 Google、Bing 和 GA4 数据,延迟降低 50% 以上。
- 🔄 100% 向后兼容: 所有约 96 个旧版工具名称通过我们的回退路由(fallback router)继续无缝工作。阅读向后兼容指南 →
---
为什么需要它
SEO 数据分布在三个不同的孤岛中。要回答一个问题——*“我的流量下降是因为排名丢失还是 UX 问题?”*——通常意味着需要登录三个仪表盘,导出三个 CSV 文件,并手动进行 VLOOKUP。
Search Console MCP 将 GSC、Bing 和 GA4 整合在一套 AI agent 可直接调用的工具之后,并在数据进入上下文窗口 *之前* 完成 SEO 计算(关键词蚕食、异常检测、机会评分)——这样你的 agent 获得的是洞察,而非电子表格。
| | 之前 | 之后 |
|---|---|---|
| 数据 | 3 个仪表盘,手动导出 | 1 个统一的上下文 |
| 分析 | 手动 VLOOKUP 和透视表 | 确定性的 SEO 计算,在服务端完成 |
| 账号 | 频繁重新登录 | 20+ 账号,按站点自动解析 |
| 洞察 | 原始行数据,agent 猜测 | 精选信号(机会评分、异常值) |
---
⚡ 快速开始bashnpx search-console-mcp setup
这将打开浏览器,授权您的 Google 账号并安全地存储凭据(参见 Security)。然后将其添加到您的 MCP 客户端配置中(Claude Desktop, Cursor, Antigravity 等):json{
"mcpServers": {
"search-console": {
"command": "npx",
"args": ["search-console-mcp"]
}
}
}
重启你的 client — 然后尝试以下 prompt。
npx search-console-mcp setup{
"mcpServers": {
"search-console": {
"command": "npx",
"args": ["search-console-mcp"]
}
}
}---
💬 试用
直接将这些内容粘贴到你的 agent 中:
> "My traffic dropped this week vs. last. Find exactly when it started and which pages are responsible."
> "Find keywords for example.com ranking positions 8–15 with 1,000+ impressions — my best quick wins."
> "Check for keyword cannibalization — are two of my pages competing for the same query?"
> "Run seo_audit on my top pages: which have high search visibility but poor CTR?"
<details>
<summary>更多示例 prompt</summary>
- *"Run a full SEO health check (
site_health_check), segmented by Brand vs Non-Brand."*
- *"Fetch my top 5 pages by impressions and run
pagespeed_analyze— any correlation with declining rankings?"*
- *"Compare Google vs Bing performance for the last 30 days (
compare_engines) — where is Bing winning?"*
- *"Submit my latest URLs to Google and IndexNow using
indexing_submitwithmethod: "index_now"."*
</details>
---
🔌 连接你的账户| 平台 | 方法 | 设置 |
|---|---|---| | Google Search Console | OAuth (推荐) |npx search-console-mcp setup |
| Google Search Console | Service Account | 设置 GOOGLE_APPLICATION_CREDENTIALS — 详情 |
| Bing Webmaster Tools | API Key | export BING_API_KEY="..." — 获取 key |
| Google Analytics 4 | Service Account | npx search-console-mcp setup --engine=ga4 |
通过 CLI 管理所有内容:
npx search-console-mcp accounts list
npx search-console-mcp accounts add-site [email protected] --site=example.com
npx search-console-mcp accounts remove [email protected]---
🖥️ 从 CLI 运行工具
Search Console MCP 还将注册的 MCP 工具公开为直接的 CLI 命令。使用 run 子命令可以列出工具、检查特定工具的参数,并将结果以 JSON、CSV 或 ASCII 表格形式打印:
# List registered tools
npx search-console-mcp run --help
Show options for one tool
npx search-console-mcp run analytics_query --help
Run an SEO audit with JSON output
npx search-console-mcp run seo_audit --siteUrl=https://example.com --type=quick_wins
Print array results as CSV or a table
npx search-console-mcp run analytics_query --siteUrl=https://example.com --startDate=2026-06-01 --endDate=2026-06-30 --dimensions=date,query --format=csv
npx search-console-mcp run sites_list --engine=all --format=table1. 在 Google Cloud Console 中创建 service account
2. 生成 JSON key
3. 将 service account 邮箱作为用户添加到 Search Console,并授予 "Full" 或 "Restricted" 权限
4. export GOOGLE_APPLICATION_CREDENTIALS="/path/to/key.json"
</details>
---
🛠 Tools (Fluent Domain Architecture)
Search Console MCP v2.0 包含 7 个 Fluent Domain Tools,可简洁地处理所有 SEO、Analytics、Inspection 和 Indexing 操作:| Fluent Tool | Parameters / Actions | Description |
|---|---|---|
| sites_list | engine: "all" \| "google" \| "bing" | 并行列出各搜索引擎中已验证的站点 |
| sites_manage | action: "add" \| "delete", siteUrl, engine | 添加或删除站点属性 |
| accounts_manage | action: "list" \| "add_site" \| "remove" | 配置多账号配置文件 |
| sitemaps_list | siteUrl, feedUrl, engine | 获取 sitemap 状态和索引状态 |
| sitemaps_submit | siteUrl, feedUrl, engine | 向 GSC 和 Bing 提交 sitemaps |
| sitemaps_delete | siteUrl, feedUrl, engine | 删除 sitemaps |
| analytics_query | siteUrl, engine, dimensions, metrics | 多引擎搜索和 GA4 分析查询 |
| analytics_compare | mode: "period_over_period" \| "trends" \| "drop_attribution" | 分析周期差异、趋势偏移和下跌原因 |
| analytics_anomalies| siteUrl, threshold | 流量激增/下跌的统计检测 |
| inspection_inspect| siteUrl, urls, engine | Google URL 检查和 Bing URL 信息 |
| pagespeed_analyze | url, strategy, cwvOnly | Core Web Vitals 和 PageSpeed Insights 审计 |
| indexing_submit | urls, method: "standard" \| "index_now" \| "remove" | 通过 IndexNow 或 Google/Bing API 立即索引 URL |
| indexing_status | siteUrl, type: "quota" \| "status" | 检查剩余索引配额和 URL 状态 |
| seo_audit | type: "quick_wins" \| "striking_distance" \| "cannibalization" \| "low_hanging_fruit" \| "lost_queries" \| "recommendations" \| "brand_vs_nonbrand" | 全面的自动化 SEO 审计 |
| seo_keywords_research| keywords, type: "stats" \| "related" \| "traffic" | 关键词量和相关关键词统计 |
| site_health_check | siteUrl, level: "summary" \| "full" \| "crawl_issues" | 一键式站点性能和技术审计 |
| compare_engines | siteUrl | Google 与 Bing 性能对比分析 |<details>
<summary><strong>向后兼容性通知 (96+ Legacy Tools)</strong></summary>
所有旧版工具名称 (bing_sites_list, seo_quick_wins, sitemaps_get, bing_index_now, indexing_submit_url, opportunity_matrix 等) 将继续通过我们的 fallback router 透明地工作。
阅读完整的 Backward Compatibility & Migration Guide →
</details>
---
🔒 Security
- 优先使用 OS keychain — token 存储在 macOS Keychain、Windows Credential Manager 或 Linux Secret Service 中
- AES-256-GCM 备选方案 — 使用基于机器硬件 ID 派生的密钥加密;被盗文件在其他设备上无法使用
- 最小化存储 — 仅持久化存储
refresh_token和expiry_date,权限为mode 600
- 静默刷新 — token 在后台自动续期
---
License
MIT · Contributing guide · Backward Compatibility Guide
<div align="center">
如果这为你省去了一张电子表格,请考虑 ⭐ star 本仓库。
</div>