Mcp Gsc

io.github.pijusz由 GitHub 账号 pijusz 发布v0.1.7更新于 Oct 24, 2026

Google Search Console MCP server — query performance, sitemaps, indexing & more

概览

AI 生成的概览

本地 MCP 服务器,让助手连接 Google Search Console,查询搜索表现、检查网址收录、管理站点地图并生成 SEO 报告。

可以做什么
列出资源属性,并显示每个属性的验证、所有权和权限信息。按查询词、页面、国家、设备、日期和搜索类型查询搜索分析数据,并可导出为 CSV。列出并查看站点地图的状态、已收录数量和错误。检查单个网址或最多 10 个网址的收录状态、抓取信息和规范网址。可选的扩展工具提供周期对比、涨跌最大项、快速见效机会、关键词自相竞争、点击率异常、内容衰退和每周 SEO 报告。可选的写入工具可添加或删除站点、提交或删除站点地图,并请求编入索引。
适用场景
适合需要处理 Google Search Console 数据、希望用自然语言让助手回答 SEO 问题的场景,例如热门查询词、收录检查、站点地图健康状况、周期对比或定期 SEO 报告。
运行要求
通过 npx(Node 22+)或 Bun 在本地运行。需要 Google Cloud Console 中启用 Search Console API 后生成的 OAuth 客户端凭据或服务账号密钥,通过 GOOGLE_GSC_CREDENTIALS_PATH 传入。首次需运行 setup 命令,在浏览器中完成 OAuth 授权并缓存刷新令牌。需要访问 Google API 的网络连接。
安装前请注意
凭据文件和缓存的 OAuth 令牌属于敏感信息,不要放入共享配置。写入工具默认关闭,启用后可添加或删除站点和站点地图,并请求编入索引。索引请求需要额外授权范围和所有者级权限,且只请求抓取,不保证收录。扩展工具同样默认关闭。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[mcp-gsc]

mcp-gsc

Google Search Console MCP server — query search analytics, inspect URLs, manage sitemaps & more via natural language.
Built with Bun + TypeScript. Works with Claude, Cursor, and any MCP client.


Quick Start

1. Get Credentials

You need OAuth client credentials from Google Cloud Console.

  1. Go to Google Cloud Console

  2. Create a project (or select existing)

  3. Enable the Google Search Console API:

    • APIs & Services → Library → search "Google Search Console API" → Enable
  4. Configure OAuth consent screen (if not done):

    • APIs & Services → OAuth consent screen → External
    • Fill in app name + your email, add scope https://www.googleapis.com/auth/webmasters
  5. Create credentials:

    • APIs & Services → Credentials → Create Credentials → OAuth client ID
    • Application type: Desktop app (allows localhost redirects automatically)
    • Download the JSON file
  6. Set the credentials path:

bash
export GOOGLE_GSC_CREDENTIALS_PATH=/path/to/credentials.json
  1. Run setup to authorize:
bash
npx mcp-gsc setup

This opens your browser for OAuth consent, saves a refresh token, verifies access to your GSC properties, and prints config snippets for your MCP client.

2. Add to Claude Code

bash
claude mcp add gsc --scope user --transport stdio \  -e GOOGLE_GSC_CREDENTIALS_PATH=/path/to/credentials.json \  -- npx -y mcp-gsc@latest

That's it. Restart Claude Code and the tools are available.

Also works with bunx mcp-gsc@latest if you have Bun. Requires Node 22+ when running via npx.

Claude Desktop / Cursor

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "gsc": {      "command": "npx",      "args": ["-y", "mcp-gsc@latest"],      "env": {        "GOOGLE_GSC_CREDENTIALS_PATH": "/path/to/credentials.json"      }    }  }}

Codex CLI

Add to ~/.codex/config.toml (TOML, not JSON):

toml
[mcp_servers.gsc]command = "npx"args = ["-y", "mcp-gsc@latest"]startup_timeout_sec = 30env = { GOOGLE_GSC_CREDENTIALS_PATH = "/path/to/credentials.json" }

Codex defaults to a 10s startup timeout, which is often too short for a cold npx fetch. Bump startup_timeout_sec (30 is safe) or install the package globally (npm i -g mcp-gsc) and use command = "mcp-gsc" instead.

Service Account (alternative)

For server-to-server auth without browser-based OAuth:

  1. Create a service account in Google Cloud Console
  2. Download the JSON key file
  3. In Google Search Console, add the service account email as a user for each property
  4. Point GOOGLE_GSC_CREDENTIALS_PATH to the key file — auth type is auto-detected

Tools (25)

Core Tools (always available)

Sites
ToolDescription
list_propertiesList all GSC properties with permission levels
get_property_detailsVerification info, ownership, permissions for a property
Search Analytics
ToolDescription
search_analyticsQuery search performance (clicks, impressions, CTR, position) with dimensions, filters, and brand segmentation

Dimensions: query, page, country, device, date, searchAppearance, hour

Types: web, image, video, news, discover, googleNews

Note: searchAppearance cannot combine with query or page. hour requires data_state="hourly_all" (last 10 days only). Country codes are ISO 3166-1 alpha-3 (usa, gbr, deu).

Sitemaps
ToolDescription
list_sitemapsList sitemaps with status, type, indexed counts, errors
get_sitemapDetailed sitemap info with content breakdown
URL Inspection
ToolDescription
inspect_urlURL indexing status, crawl info, rich results, canonicals
batch_inspect_urlsInspect up to 10 URLs at once with categorized results

Rate limits: 600/minute + 2,000/day per site (tracked automatically).

Export
ToolDescription
export_csvExport full search analytics to a local CSV file (auto-paginates 25K rows per call, up to 1M rows)

Extended Tools (disabled by default)

Enable with GOOGLE_GSC_ENABLE_EXTENDED_TOOLS=true:

Reporting Suite
ToolDescription
performance_overviewAggregate metrics + daily trend breakdown
compare_periodsCompare two date ranges with delta calculations
top_moversBiggest gains and drops between periods
device_country_breakdownPerformance by device and/or country
SEO Suite
ToolDescription
quick_winsHigh-impression, low-CTR queries in striking distance (position 4-20)
cannibalizationMultiple pages competing for the same query
opportunity_finderEmerging queries, growing impressions with low CTR, declining performers
position_trackingPosition changes over time for specific queries/pages
ctr_anomaliesQueries with abnormal CTR relative to position
content_decayPages/queries with impressions dropping >50% from historical peak
weekly_seo_reportAll-in-one report: overview + quick wins + top movers
Technical SEO Suite
ToolDescription
indexing_coverageBatch URL inspection with categorized indexing status
sitemap_healthSitemap error patterns, freshness, indexed vs submitted ratio

Write Tools (disabled by default)

Enable with GOOGLE_GSC_ENABLE_WRITES=true:

ToolDescription
add_siteAdd a new site to GSC
delete_siteRemove a site from GSC
submit_sitemapSubmit a new sitemap
delete_sitemapRemove/unsubmit a sitemap
request_indexingAsk Google to crawl a URL via the Indexing API
get_indexing_statusWhen a URL was last submitted for indexing

Indexing API prerequisites. The last two use a different Google API to the rest of this server, so they need three things the other tools don't:

  1. Re-run mcp-gsc setup — credentials created before this feature lack the auth/indexing scope. The tools say so explicitly if yours do.
  2. Enable the Indexing API on your Google Cloud project — console.cloud.google.com/apis/library/indexing.googleapis.com
  3. Be a verified owner of the property in Search Console. Full-user access is not enough.

Google officially supports the Indexing API only for pages carrying JobPosting or BroadcastEvent structured data, with a default quota of 200 URLs/day. It requests a crawl — it never guarantees indexing.

Configuration

VariableRequiredDefaultDescription
GOOGLE_GSC_CREDENTIALS_PATHYes—Path to OAuth client JSON or service account key
GOOGLE_GSC_TOKEN_PATHNoDerivedPath to cached OAuth token (default: *_token.json next to credentials)
GOOGLE_GSC_PROPERTYNo—Default property URL (e.g., sc-domain:example.com). Accepts bare domains.
GOOGLE_GSC_ENABLE_WRITESNofalseEnable write tools
GOOGLE_GSC_ENABLE_EXTENDED_TOOLSNofalseEnable extended analytics tools (13 extra)
GOOGLE_GSC_ENV_FILENo.envPath to .env file
DEBUGNo—Enable debug logging

Property resolution: You can pass bare domains like example.com — the server auto-resolves to sc-domain:example.com or https://example.com/ by matching against your verified properties.

Examples

Ask your AI assistant:

  • "Show me my top 10 queries this month"
  • "Find quick wins for example.com"
  • "Which pages have declining traffic over the last 3 months?"
  • "Check if these URLs are indexed: url1, url2, url3"
  • "Compare this week's performance to last week"
  • "Export all search analytics data to CSV for the last 28 days"
  • "Run a weekly SEO report for my site"
  • "Find keyword cannibalization issues"

Future Tool Ideas

  • Content gap analysis (requires competitor data integration)
  • Core Web Vitals integration (via PageSpeed Insights API)
  • Multi-property comparison
  • Search appearance deep analysis
  • Integration with Google Analytics for conversion data
  • Automated reporting schedules

Updates

Using npx @latest (recommended): You always get the latest version.

Using a binary: The server checks for new releases on startup and logs to stderr if outdated.

bash
mcp-gsc --version

Development

Requires Bun.

bash
git clone https://github.com/pijusz/mcp-gsc.gitcd mcp-gscbun installbun test           # testsbun run build      # standalone binarybun run inspect    # MCP Inspectorbun run check      # biome format + lint

License

MIT

来源:README.md,提交 4b24854

工具

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

版本历史

1
  1. v0.1.7最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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