Google Search Console

io.github.PixFrixSystems由 GitHub 账号 PixFrixSystems 发布v0.1.0更新于 Nov 14, 2026

Google Search Console data and SEO analysis: performance, quick wins, indexing and sitemaps.

概览

AI 生成的概览

将 AI 助手连接到 Google Search Console,获取搜索表现、索引和站点地图数据,并附带内置 SEO 分析。

可以做什么
  • 列出资源并获取表现概览、自定义搜索分析查询、周期对比、流量异常和品牌流量拆分
  • 发现优化机会:快速提升关键词、低点击率页面、关键词自相竞争、下滑页面、内容缺口及单 URL 分析
  • 检查索引与站点地图:检查单个或最多 50 个 URL、审计站点地图索引情况、列出站点地图
  • 在显式开启写入后可提交或删除站点地图
  • 运行六个预置提示工作流,如每周 SEO 报告、流量下滑诊断和内容更新计划
适用场景
适合对自己在 Search Console 中拥有的站点做 SEO 工作:诊断流量变化、确定优先改进的关键词和页面、检查索引与站点地图健康状况。适合代理机构、企业内 SEO 或希望直接得到分析而非原始导出的开发者。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js 22 或更高版本。需要可访问目标 Search Console 资源的 Google 账号,并提供服务账号 JSON 密钥(路径放在 GSC_SERVICE_ACCOUNT_KEY,或密钥本身放在 GSC_SERVICE_ACCOUNT_JSON),或使用 OAuth 桌面客户端登录。需在 Google Cloud 中启用 Google Search Console API,并需要访问 Google API 的网络。
安装前请注意
服务账号 JSON 密钥属于凭据,请勿放入共享配置或对话中。默认只读;设置 GSC_ALLOW_WRITE=true 会启用站点地图提交与删除,并申请读写权限范围。返回的搜索数据会成为与助手对话的一部分,受该助手隐私条款约束。浏览器登录会以刷新令牌形式保存在 GSC_CONFIG_DIR,可用 auth logout 删除。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Google Search Console,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Search Console MCP

[npm] [CI] [License: MIT]

An MCP server that connects Claude, Cursor and other AI assistants to Google Search Console.

It gives the assistant the raw data (search performance, URL inspection, sitemaps) and does the analysis on top: which keywords are one push from page one, which pages rank but are not clicked, which pages compete with each other, what lost traffic and why, and how much of your sitemap is indexed.

It runs on your machine, talks only to Google's API, and is read-only unless you switch writing on.

What you can ask

  • "How did organic search do in the last 28 days compared with the month before?"
  • "Which keywords are we close to ranking on page one for?"
  • "Which pages rank in the top 10 but hardly get clicked? Suggest better titles."
  • "Traffic dropped last week. What happened?"
  • "Are any of our pages competing for the same keyword?"
  • "Is https://example.com/pricing indexed? If not, why not?"
  • "How much of our sitemap is indexed, and what is wrong with the rest?"
  • "Pick the five blog posts most worth refreshing and write a brief for each."

What to use it for goes through each of these: what runs, what comes back and what to do with it.

Why this one

  • It analyses, not only fetches. The opportunity tools return a ranked list of things to act on, with the numbers behind each.
  • Estimates come from your own site. Expected click-through is measured on your data, not taken from a generic table.
  • It says what the numbers do not show. Row caps, samples, hidden queries, incomplete days and empty comparison periods are stated in every result.
  • Forgiving inputs. Say example.com or paste a page URL. Leave out the dates and you get the last 28 complete days.
  • Read-only by default, with errors that tell you how to fix them and a doctor command that checks the setup.

Quick start

You need Node.js 22 or newer and a Google account with access to the Search Console properties you want to use.

1. Get Google credentials

Both ways are free. The authentication guide has every click.

Service accountYour own Google account (OAuth)
Best forAgencies, servers, automationOne person with many properties
SeesOnly properties you add it toEverything your account can see
SetupCreate a key, add its email as a user on each propertyCreate a "Desktop app" client, sign in once in the browser

Service account: in Google Cloud enable the Google Search Console API, create a service account, download a JSON key, then in Search Console add the service account's email under Settings > Users and permissions for each property.

Your own account: in Google Cloud enable the Google Search Console API, create an OAuth client of type Desktop app, download its JSON, then run:

bash
GSC_OAUTH_CLIENT_FILE=/path/to/client_secret.json npx -y @pixfrix/search-console-mcp auth login

2. Add the server to your assistant

Claude Code
bash
claude mcp add search-console \  --env GSC_SERVICE_ACCOUNT_KEY=/path/to/service-account.json \  -- npx -y @pixfrix/search-console-mcp

If you signed in with auth login, leave out the --env line.

Claude Desktop

Open Settings > Developer > Edit Config and add:

json
{  "mcpServers": {    "search-console": {      "command": "npx",      "args": ["-y", "@pixfrix/search-console-mcp"],      "env": {        "GSC_SERVICE_ACCOUNT_KEY": "/path/to/service-account.json"      }    }  }}

Restart Claude Desktop afterwards.

Cursor

Add to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

json
{  "mcpServers": {    "search-console": {      "command": "npx",      "args": ["-y", "@pixfrix/search-console-mcp"],      "env": {        "GSC_SERVICE_ACCOUNT_KEY": "/path/to/service-account.json"      }    }  }}
VS Code

Add to .vscode/mcp.json:

json
{  "servers": {    "search-console": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@pixfrix/search-console-mcp"],      "env": {        "GSC_SERVICE_ACCOUNT_KEY": "/path/to/service-account.json"      }    }  }}
Any other MCP client

The server speaks MCP over stdio. Run npx -y @pixfrix/search-console-mcp as the command and pass the environment variables from Configuration.

On Windows, use forward slashes or doubled backslashes in JSON paths (C:/keys/gsc.json). If your client cannot start npx directly, use "command": "cmd" with "args": ["/c", "npx", "-y", "@pixfrix/search-console-mcp"].

3. Check that it works

bash
GSC_SERVICE_ACCOUNT_KEY=/path/to/service-account.json npx -y @pixfrix/search-console-mcp doctor
[ ok ] Credentials: service account ([email protected])[ ok ] Google sign-in[ ok ] Search Console API[ ok ] Properties (2):         sc-domain:example.com  [siteFullUser]         https://shop.example.com/  [siteRestrictedUser]

If a step fails, doctor says what to change. Then ask your assistant: "List my Search Console properties."

Documentation

GuideWhat is in it
What to use it forEach job with the question to ask, what comes back and what to do next
How it worksWhere the numbers come from, the rules behind each analysis, limits and safety
AuthenticationService account and browser sign-in, step by step
Tool referenceEvery tool and parameter

Tools

Performance

ToolWhat it answers
list_sitesWhich properties can this account read?
get_performance_overviewHow is the site doing? Totals against a comparison period, the trend, and the top queries, pages, countries, devices and search appearances, in one call
search_analyticsAny custom question: every dimension (including hourly data), regex filters, every search type, paging to any depth, sorting by any metric
compare_periodsWhat changed? Gainers, decliners, new and lost rows against the previous period, the previous year or a custom range
detect_traffic_anomaliesDid traffic drop or spike, and was it one day or a lasting shift?
get_brand_splitHow much of the traffic is people searching for the brand, and how is the rest doing?

Opportunities

ToolWhat it answers
find_quick_winsWhich keywords rank just below the top results and would pay off fastest?
find_ctr_opportunitiesWhich results rank well but get clicked far less than their position should earn?
find_keyword_cannibalizationWhich queries are split between several of my pages?
find_declining_pagesWhich pages or queries lost the most clicks, and was it rankings, impressions or click-through?
find_content_gapsWhere does the site show up without a page that serves the search, and which questions are people asking?
analyze_pageEverything about one URL: its queries, which to target, devices, countries, trend and index status

Indexing and sitemaps

ToolWhat it answers
inspect_urlIs this URL indexed, and if not, why?
inspect_urlsThe same for up to 50 URLs, as one table
audit_sitemap_indexingHow much of my sitemap is indexed, and what is wrong with the rest?
list_sitemapsWhich sitemaps are submitted, when were they last read, and do they have errors?
submit_sitemapSubmit or resubmit a sitemap. Only with GSC_ALLOW_WRITE=true
delete_sitemapRemove a sitemap from Search Console. Only with GSC_ALLOW_WRITE=true

Prompts

Clients that support MCP prompts (Claude Desktop and Claude Code show them as slash commands) get six ready-made workflows:

PromptWhat it produces
seo_weekly_reportWhat moved in the last seven days and why
seo_opportunity_auditA prioritised action plan across every opportunity tool
diagnose_traffic_dropWhen a drop started, where it is concentrated and the likely cause
content_refresh_planThe existing pages most worth updating, with what to change
indexing_health_checkSitemap and indexing problems, by importance
optimize_pageA data-backed brief for one URL

Configuration

Everything is set through environment variables. Only credentials are required.

VariablePurpose
GSC_SERVICE_ACCOUNT_KEYPath to a service account JSON key
GSC_SERVICE_ACCOUNT_JSONThe key itself as a JSON string, for hosts without a file system
GOOGLE_APPLICATION_CREDENTIALSGoogle's standard variable, honoured when the two above are not set
GSC_OAUTH_CLIENT_FILEPath to an OAuth "Desktop app" client secret file, used by auth login
GSC_SITE_URLDefault property, so you do not have to name it. Example: sc-domain:example.com
GSC_BRAND_TERMSComma-separated brand names, to keep brand searches out of opportunity lists and to split branded from non-branded traffic
GSC_ALLOW_WRITEtrue enables submit_sitemap and delete_sitemap and requests the read/write scope
GSC_CONFIG_DIRWhere the saved sign-in lives. Default: ~/.config/search-console-mcp, or %APPDATA%\search-console-mcp on Windows

Credentials are looked up in this order: GSC_SERVICE_ACCOUNT_JSON, GSC_SERVICE_ACCOUNT_KEY, GOOGLE_APPLICATION_CREDENTIALS, a saved auth login, then Google's Application Default Credentials.

search-console-mcp                 Start the MCP server (what your client runs)search-console-mcp doctor          Check credentials and list the properties you can readsearch-console-mcp auth login      Sign in with your own Google account (--write for sitemap changes)search-console-mcp auth logout     Forget the saved sign-in

Troubleshooting

Run doctor first: it tests credentials, sign-in, API access and property permissions in order and explains the first failure.

SymptomCause and fix
"The signed-in account cannot read this property"The account is not a user of the property. In Search Console open Settings > Users and permissions and add it. For a service account, add its client_email
"Enable the Google Search Console API"The API is off in your Google Cloud project. Enable it under APIs & Services > Library
Sign-in expires every weekYour OAuth consent screen is in Testing. Publish it under Google Auth Platform > Audience
"No Search Console property matches"Call list_sites, or pass the bare domain and let the server match it
No data for a pageSearch Console matches page URLs exactly, including www and the trailing slash. Use a contains filter to find the form it reports
Rows by query do not add up to the totalExpected. Google hides rare queries for privacy
Numbers differ from the Search Console websiteCompare the same dates. The website's default range runs up to today and includes incomplete days; the server's default stops at the last complete day
The server does not appear in the clientCheck the client's MCP log. On Windows try the cmd /c npx form shown above

Privacy and security

  • The server runs locally as a child process of your MCP client. It contacts googleapis.com, and your own site when audit_sitemap_indexing reads a sitemap. There is no telemetry.
  • Credentials stay on your machine. A browser sign-in is stored as a refresh token in GSC_CONFIG_DIR. Delete it with auth logout.
  • The default scope is read-only. Search data returned by the tools becomes part of your conversation with the AI assistant, under that assistant's own privacy terms.

See SECURITY.md to report a vulnerability.

Development

bash
git clone https://github.com/PixFrixSystems/search-console-mcp.gitcd search-console-mcpnpm installnpm run buildnpm test

The tests run against a stand-in for Google's API, so they need no credentials. With credentials, npm run live-check -- --site example.com runs every read-only tool against a real property and checks that the numbers agree with each other.

Contributions are welcome. See CONTRIBUTING.md.

License

MIT

Built and maintained by PixFrix. This project is not affiliated with or endorsed by Google. Google Search Console is a trademark of Google LLC.

来源:README.md,提交 04a70ca

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Nov 14, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分