search-console-mcp
search-console-mcp
面向 Google Search Console 的 MCP 服务器,它将官方 Search Console API 以工具的形式提供给 AI 代理使用。
它的重点是 搜索效果和索引健康度——按查询、页面、国家/地区、设备或日期查询点击量、展示量、CTR 和排名,检查某个 URL 是否被索引以及未被索引的原因,并管理账号下的站点地图和资源。
它不会做的事情: 不请求对 URL 进行(重新)索引——这个独立的 Indexing API 只支持招聘信息页面和直播页面;不进行资源所有权验证(所有者必须将服务账号添加到每个资源中);也不涉及 Google Analytics 数据(那是另一个无关的 Analytics Data API)。
删除操作是可选的(opt-in)。 只有当设置了
GOOGLE_SEARCH_CONSOLE_ALLOW_DESTRUCTIVE时,delete_sitemap和delete_site才会被注册——请参阅 Configuration。
Install
claude mcp add search-console \
-e GOOGLE_SERVICE_ACCOUNT_KEY_PATH=/path/to/service-account.json \
-e GOOGLE_SEARCH_CONSOLE_SITE_URL=https://example.com/ \
-- npx -y @orellbuehler/search-console-mcp-e 标志必须放在 -- 分隔符之前;-- 后面的内容会传给服务器进程执行,而不会被当作配置来读取。
Related MCP server: Google Search Console MCP Server
获取服务账号密钥
在 Google Cloud console 中选择或创建一个项目,并启用 Google Search Console API。
进入 IAM 与监管 → 服务账号 → 创建服务账号。可以跳过“授予访问权限”的可选步骤——Search Console 的权限是单独授予的,不通过 Cloud IAM 角色。
打开新建的服务账号,进入 Keys 标签页,选择 Add key → Create new key → JSON。该文件只能下载一次,之后无法再次获取。
在 Search Console 中打开资源,进入 Settings → Users and permissions → Add user,权限 并粘贴服务账号的邮箱地址(
name@project-id.iam.gserviceaccount.com)。请授予:对于(analytics、sitemaps、URL inspection)等读取工具,授予 Restricted 或 Full 权限
对于
submit_sitemap和delete_sitemapal,授予 Full 权限
对服务器需要看到的每个资源重复第 4 步——服务账号无法自行验证资源所有权。
将
GOOGLE_SERVICE_ACCOUNT_KEY_PATH指向下载的 JSON 文件。
请像对待密码一样对待 JSON 密钥——它携带你授予的所有权限,没有第二道验证在前面。应将其放在仓库之外,并考虑使用 chmod 600。
配置
在该表中,GOOGLE_SERVICE_ACCOUNT_KEY_PATH 或 GOOGLE_SERVICE_ACCOUNT_KEY 为必须提供之一(即二者之一),其余变量视为可选。
变量 | 必需 | 说明 |
| 二选一 | 已下载的服务账号 JSON 密钥文件的路径 |
| 二选一 | 服务账号 JSON 密钥的内联内容,须为原始 JSON 字符串 |
| 否 | 默认资源,这样工具就可以省略 |
| 否 | 设置为 |
资源既可以标识为 URL-prefix property(如 https://example.com/,协议和结尾斜线都很重要——http://example.com/ 和 http://example.com/ 是不同的资源——就必须注意两端都要写全)也可以标识为 domain property(如 sc-domain:example.com),后者包含所有子域和协议。请使用与资源在 Search Console 中被添加时一致的形式;你可以通过 list_sites 查看确切的字符串。
与 Claude Code 配套使用
{
"mcpServers": {
"search-console": {
"command": "npx",
"args": ["-y", "@orellbuehler/search-console-mcp"],
"env": {
"GOOGLE_SERVICE_ACCOUNT_KEY_PATH": "/path/to/service-account.json",
"GOOGLE_SEARCH_CONSOLE_SITE_URL": "https://example.com/"
}
}
}
}示例提示词
“我这个月有哪些热门搜索查询?”
“哪些页面从 Google 获得最多的点击,与之前 28 天相比有什么变化?”
“显示包含‘pricing’且我们排在较差位置(如 10 名开外)的查询——这些是快速见效的候选项。”
“我们的流量中移动端与桌面端各占多少?”
“画出最近三个月中每天的点击量和展示量趋势图。”
“我们有没有被展示但几乎没有点击的国家?”
“https://example.com/blog/launch 是被索引了吗?如果没有,为什么?”
“列出我们的 sitemap,告诉我哪些有错误或警告。”
“旧站点改版后,重新提交一次 sitemap。”
“哪些针对‘mcp server’排名的页面之间存在竞争?”
“对比本季度Discover 流量与常规搜索流量的表现。”
工具
搜索效果分析
工具 | 说明 |
| 功能完善的效果查询:任意维度、筛选、正则、搜索类型、最大 25k 行的分页 |
| 按点击量排前的搜索查询,可缩小范围到某个页面、国家或设备 |
| 按点击量排前的页面,可缩小范围到某个查询片段、国家或设备 |
站点地图
工具 | 说明 |
| 列出全部已提交的 sitemap 及其状态、错误、警告和已索引 URL 数量 |
| 获取某个 sitemap 的处理状态和内容 |
| 提交新的 sitemap 或重新提交现有 sitemap 以再次处理 |
| 从 Search Console 中删除某个 sitemap(需显式启用 |
站点
工具 | 说明 |
| 列出服务账号能够访问的所有资源及其权限级别 |
| 获取某个资源的权限级别 |
| 将已经过验证的资源的到账号下 |
| 从账号视图中移除某个资源(需显式启用 |
URL 检查
工具 | 说明 |
| 返回某个 URL 的 Google 索引分析:判定结果、覆盖范围、普通链接、最后抓取、富显示的版本、robots 情况 |
注意事项
效果数据约有 2–3 天的延迟。 便捷工具默认把日期范围结束于 3 天前,而
data_state: "all"会包含最新但可能不完整的数据。数据保留 16 个月。 查询更早的数据不会返回任何行。
隐私过滤机制。 稀疏查询对应的行会被隐藏,因此按查询维度汇总会低于真实总数据;不带维度进行查询可以获得精确的总量。
单次调用最多 25,000 行。 需要用
start_row分页;当返回的行数小于row_limit时,说明是最后一页。URL inspection 配额大约是每个资源每天 2,000 次调用、每分钟 600 次——应选择性地检查 URL,而不要批量执行。
hour维度必须用data_state: "hourly_all",并且只能覆盖最近约 10 天。你的搜索数据会转移到 LLM——工具返回的一切都会成为模型上下文,因此不要接入任何不允许离开你环境的资源。
开发
npm install
npm run build # tsc -p tsconfig.build.json -> dist/
npm test # vitest run
npm run lint # eslint src
npm run typecheck # tsc --noEmit
npm run format # prettier --write .用真实资源基于构建后的 server 做冒烟测试:
GOOGLE_SERVICE_ACCOUNT_KEY_PATH=/path/to/service-account.json \
GOOGLE_SEARCH_CONSOLE_SITE_URL=https://example.com/ \
npx @modelcontextprotocol/inspector node dist/index.jsCI / 发布
CI 在 Node.js 20 和 22 上运行 format:check、lint、typecheck、test 和 build。发布通过 GitHub release 进行,并使用 npm trusted publishing(OIDC,无需 token):
npm version patch
git push --follow-tags
gh release create "v$(node -p "require('./package.json').version")" --generate-notesLicense
MIT © Orell Bühler
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides read-only access to Google Search Console data, allowing AI assistants to query site performance metrics like keywords, clicks, and rankings using natural language. It supports listing verified properties, querying search analytics with dimension filters, and retrieving sitemap information.31MIT
- AlicenseNot gradedqualityFmaintenanceProvides 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.744MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Google Search Console data for SEO analysis, including search analytics, URL inspection, sitemaps, indexing, and opportunity detection.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to query Google Search Console data including search analytics, URL inspection, sitemap management, and site performance monitoring, with per-user OAuth authentication.
Related MCP Connectors
SEO research, audits, backlinks, GSC, and content workflow tools for AI agents.
Turn Search Console data into SEO actions, content, publishing, indexing, and AI insights.
Open-source SEO manager for coding agents: keyword research, content PRs, rank + Search Console.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/OrellBuehler/search-console-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server