Google Search Console
概览
作者提供的说明(英文原文)
MCP server for Google Search Console: properties, sitemaps, search analytics and URL inspection
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i1 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新↓ 95/周 · ★ –
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 搜索与 AI 记忆
- 你需要填写:GSC_SERVICE_ACCOUNT_KEY, GSC_CLIENT_SECRET, GSC_REFRESH_TOKEN
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:1 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 需要你自己填写:
GSC_SERVICE_ACCOUNT_KEY,GSC_SERVICE_ACCOUNT_KEY_FILE,GSC_CLIENT_ID,GSC_CLIENT_SECRET,GSC_REFRESH_TOKEN,GOOGLE_APPLICATION_CREDENTIALS,GSC_SITE_URL,GSC_ALLOWED_SITES,GSC_READ_ONLY,GSC_ALLOW_TOOLS,GSC_DENY_TOOLS
标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
- npm已安装 Node.js(用于 npx 命令)
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"google-search-console": {
"command": "npx",
"args": [
"-y",
"@ni-c/google-search-console-mcp"
],
"env": {
"GSC_SERVICE_ACCOUNT_KEY": "your-value",
"GSC_SERVICE_ACCOUNT_KEY_FILE": "your-value",
"GSC_CLIENT_ID": "your-value",
"GSC_CLIENT_SECRET": "your-value",
"GSC_REFRESH_TOKEN": "your-value",
"GOOGLE_APPLICATION_CREDENTIALS": "your-value",
"GSC_SITE_URL": "your-value",
"GSC_ALLOWED_SITES": "your-value",
"GSC_READ_ONLY": "your-value",
"GSC_ALLOW_TOOLS": "your-value",
"GSC_DENY_TOOLS": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add google-search-console --env GSC_SERVICE_ACCOUNT_KEY=your-value --env GSC_SERVICE_ACCOUNT_KEY_FILE=your-value --env GSC_CLIENT_ID=your-value --env GSC_CLIENT_SECRET=your-value --env GSC_REFRESH_TOKEN=your-value --env GOOGLE_APPLICATION_CREDENTIALS=your-value --env GSC_SITE_URL=your-value --env GSC_ALLOWED_SITES=your-value --env GSC_READ_ONLY=your-value --env GSC_ALLOW_TOOLS=your-value --env GSC_DENY_TOOLS=your-value -- npx -y @ni-c/google-search-console-mcp运行前请先填写空着的值。
或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"google-search-console": {
"command": "npx",
"args": [
"-y",
"@ni-c/google-search-console-mcp"
],
"env": {
"GSC_SERVICE_ACCOUNT_KEY": "your-value",
"GSC_SERVICE_ACCOUNT_KEY_FILE": "your-value",
"GSC_CLIENT_ID": "your-value",
"GSC_CLIENT_SECRET": "your-value",
"GSC_REFRESH_TOKEN": "your-value",
"GOOGLE_APPLICATION_CREDENTIALS": "your-value",
"GSC_SITE_URL": "your-value",
"GSC_ALLOWED_SITES": "your-value",
"GSC_READ_ONLY": "your-value",
"GSC_ALLOW_TOOLS": "your-value",
"GSC_DENY_TOOLS": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"google-search-console": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@ni-c/google-search-console-mcp"
],
"env": {
"GSC_SERVICE_ACCOUNT_KEY": "your-value",
"GSC_SERVICE_ACCOUNT_KEY_FILE": "your-value",
"GSC_CLIENT_ID": "your-value",
"GSC_CLIENT_SECRET": "your-value",
"GSC_REFRESH_TOKEN": "your-value",
"GOOGLE_APPLICATION_CREDENTIALS": "your-value",
"GSC_SITE_URL": "your-value",
"GSC_ALLOWED_SITES": "your-value",
"GSC_READ_ONLY": "your-value",
"GSC_ALLOW_TOOLS": "your-value",
"GSC_DENY_TOOLS": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
需要你填写的值
- Service account key as JSON, or base64-encoded JSON. One of the three credential options.
GSC_SERVICE_ACCOUNT_KEY_FILEenvPath to a service account key file. Alternative to GSC_SERVICE_ACCOUNT_KEY.GSC_CLIENT_IDenvOAuth2 client id. Use together with GSC_CLIENT_SECRET and GSC_REFRESH_TOKEN.- OAuth2 client secret. All three OAuth2 variables are required together.
- OAuth2 refresh token. All three OAuth2 variables are required together.
GOOGLE_APPLICATION_CREDENTIALSenvPath to application default credentials, used when no GSC_ credential is set.GSC_SITE_URLenvDefault property, e.g. sc-domain:example.com or https://example.com/ — makes site_url optionalGSC_ALLOWED_SITESenvComma-separated properties this server may touch; anything else is refusedGSC_READ_ONLYenvSet to true to register only the read tools (default: false)GSC_ALLOW_TOOLSenvComma-separated tool names or list_* prefixes to register; 'essential' selects a curated preset (default: all tools)GSC_DENY_TOOLSenvComma-separated tool names or list_* prefixes to remove from whatever the allow list left
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月9日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 ni-c 验证,该账户拥有此仓库
- … 尚未检查
仍在维护
我们还没有从 GitHub 读取这个仓库
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“搜索与 AI 记忆”中的其他服务器比较i
- 星标数多于此分类中其他 5764 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 5764 个服务器的 39% 更新
- 基础检查结果等于或优于此分类中其他 5764 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Google Search Console 安全吗?
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
你需要填写:GSC_SERVICE_ACCOUNT_KEY, GSC_CLIENT_SECRET, GSC_REFRESH_TOKEN
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于–,最新版本(0.3.0)于2个月前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js, Docker。
有什么可以替代它?
同一分类中有:Context7, Codebase Memory, Exa
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Codebase Memory
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Exa
Connect AI agents to Exa for web search, content fetching, and multi-step research.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
google-search-console-mcp
A Model Context Protocol (MCP) server for Google Search Console, the service that tells you how Google sees your site — this reads it and sets it up.
Lets MCP clients like Claude Code, Claude Desktop or Codex create a property and prove ownership of it, submit and refresh sitemaps, ask what any URL's index status is, and query the whole Performance report — with the irreversible operations put to a person first and the write tools switchable off entirely.
21 tools is the ceiling, not the floor: GSC_ALLOW_TOOLS=essential registers a curated five instead, and a model picks the right tool far more reliably from five than from 21 — see choosing which tools load.
What makes it different
It can actually create a working property. Getting one takes four steps in a fixed order — obtain a verification token, place it in DNS or on the page, verify ownership, add the property — and nothing in Google's APIs enforces that order. Calling sites.add first _succeeds_ and leaves a property that appears in every listing and answers 403 for every piece of data, which looks like a permissions bug and is not. setup_site reports which step is missing and hands over the exact DNS record to paste. Servers that expose sites.add alone can only add properties somebody already verified by hand.
Three APIs, not one. Search Console v1 is ten methods and does not include ownership. Site Verification is a separate service with its own scope, its own host and an incompatible way of naming the same site — sc-domain:example.com there is {type: INET_DOMAIN, identifier: example.com}, and passing the property spelling straight through is accepted and verifies a domain literally called sc-domain:example.com. The Indexing API is a third. All three are covered, and the translation between them is in src/site-identity.ts.
The numbers are right. Search analytics come back as a table with totals where CTR is computed from the totals rather than averaged across rows, and average position is weighted by impressions. Unweighted, a thousand rare queries ranking 80th drag a property's real average of 12 up into the nineties. The result also says plainly that the rows do not sum to the property total when the query dimension is used — Google withholds rare queries for anonymity, commonly a third or more of all impressions, and a total printed without that caveat is a number people will quote.
It knows where these APIs are sharp. The trailing slash on https://example.com/ is mandatory and its absence is a 403; a domain property and a URL-prefix property for the same site are different properties with different data, so a bare hostname is refused rather than guessed at; days are counted in Pacific Time, so a last7days computed in UTC asks for a day Google has no data for; the hour dimension silently returns nothing without dataState: HOURLY_ALL; Google omits empty arrays entirely, so a fresh credential's property list arrives as {}; and the Indexing API returns 200 for any owned URL while only acting on JobPosting and BroadcastEvent pages.
Requirements
- Node.js 24 or newer (or the container image)
- A Google credential — a service account key, an OAuth2 refresh token, or application default credentials
- The APIs you intend to use enabled in a Google Cloud project: Search Console API, and separately Site Verification API and Indexing API
Configuration
The server starts without credentials and lists its tools; every call then fails with setup instructions rather than a Google error. That is deliberate, so registries and sandbox inspectors can introspect it.
| Variable | Description |
|---|---|
GSC_SERVICE_ACCOUNT_KEY | Service account key as raw JSON, or base64-encoded JSON |
GSC_SERVICE_ACCOUNT_KEY_FILE | Path to a service account key file. Alternative to the above — setting both is an error |
GSC_CLIENT_ID | OAuth2 client id |
GSC_CLIENT_SECRET | OAuth2 client secret |
GSC_REFRESH_TOKEN | OAuth2 refresh token. All three OAuth2 variables are required together |
GOOGLE_APPLICATION_CREDENTIALS | Application default credentials, used when no GSC_ credential is set |
GSC_SITE_URL | Default property, e.g. sc-domain:example.com or https://example.com/. Makes site_url optional everywhere |
GSC_ALLOWED_SITES | Comma-separated properties this server may touch at all; anything else is refused |
GSC_READ_ONLY | true (or 1/yes) registers only the twelve read tools |
GSC_ALLOW_TOOLS | Comma-separated tool names, a list_* prefix, or essential |
GSC_DENY_TOOLS | Same shape, subtracted from whatever the allow list left |
ELICITATION | false replaces the approval dialog with the two-call token. Not prefixed |
Credentials are tried in that order — explicit beats ambient. A partial OAuth triple is a startup error rather than a reason to fall through to application default credentials, because that fallback would quietly run the server as whatever account the machine is logged into.
Which credential
A service account is the recommended one: it sees only the properties you explicitly add it to, and revoking it does not touch anyone's Google account. Add its client_email under Settings → Users and permissions in Search Console, or give it ownership with verify_site. Note that the Indexing API requires owner, not full user.
An OAuth2 refresh token acts as the person who consented and sees everything they see. Its scopes were fixed at consent time and cannot be widened later.
Choosing which tools load
Every visible tool costs context on every request, and a model picks the right one far more reliably from five than from 21. Two variables narrow the list:
GSC_ALLOW_TOOLS=essential # the curated five
GSC_ALLOW_TOOLS='list_*,get_site' # exact names, or one trailing * GSC_DENY_TOOLS='delete_*' # subtracted from whatever allow left
essential is list_sites, get_site, list_sitemaps, query_search_analytics and inspect_url — everything needed to look at a property, and nothing that changes it.
An entry that matches no tool stops the server with the list of real names. An ignored typo would otherwise leave a tool missing from tools/list with nothing pointing at the cause, and nobody traces an absence back to an environment variable.
If you run several of these servers at once, mcp-hub is the other answer — its /hub endpoint replaces every server's tools with six meta-tools.
Narrowing the list also narrows the credential: the OAuth scopes this server requests are derived from the tools that are actually registered, so a server denied the Indexing tools never asks for the Indexing scope.
Installation
Claude Code
claude mcp add google-search-console -- npx -y @ni-c/google-search-console-mcp
Claude Desktop
{
"mcpServers": { "google-search-console": { "command": "npx", "args": ["-y", "@ni-c/google-search-console-mcp"], "env": { "GSC_SERVICE_ACCOUNT_KEY_FILE": "/path/to/key.json", "GSC_SITE_URL": "sc-domain:example.com" } } } }
Codex
[mcp_servers.google-search-console]
command = "npx" args = ["-y", "@ni-c/google-search-console-mcp"]
[mcp_servers.google-search-console.env] GSC_SERVICE_ACCOUNT_KEY_FILE = "/path/to/key.json" GSC_SITE_URL = "sc-domain:example.com"
Docker
docker run --rm -i \
-v /path/to/key.json:/key.json:ro \ -e GSC_SERVICE_ACCOUNT_KEY_FILE=/key.json \ -e GSC_SITE_URL=sc-domain:example.com \ ghcr.io/ni-c/google-search-console-mcp
Through mcp-hub
A client that cannot spawn a local process — ChatGPT connectors, Claude on the web, Cursor, LibreChat — reaches google-search-console-mcp through mcp-hub: one container serves many stdio MCP servers over Streamable HTTP, with an OAuth 2.1 login behind a single password and long-lived tokens for the clients that cannot do OAuth. Its /hub endpoint puts every server behind six meta-tools, so one connector reaches all of them without N×tool schemas in the model's context, and it speaks both protocol revisions — a question this server asks travels through it to the person at the far end.
Its /config/mcp.json uses Claude Code's format, so the entry is the one you already have:
{
"mcpServers": { "google-search-console": { "command": "npx", "args": ["-y", "@ni-c/google-search-console-mcp"], "env": { "GSC_SERVICE_ACCOUNT_KEY": "…", "GSC_SITE_URL": "sc-d
只显示了开头部分;其余内容请在仓库中阅读