gsc-mcp

gsc-mcp

MCP server for querying Google Search Console data — search analytics, URL inspection, sitemap monitoring, and more — read-only tools for any MCP-compatible AI client.

Category
访问服务器

README

gsc-mcp

PyPI version Python 3.10+ License: Apache 2.0 Glama MCP server

Google Search Console as MCP tools — query search analytics, inspect URLs, and monitor SEO performance from any MCP-compatible AI client (Claude Desktop, Claude Code, Claude.ai, Gemini CLI, Cursor, etc.).

Zero vendor middleware. Zero ongoing cost. Each user authenticates with their own Google account against Google's free Search Console API.


Why this exists

Pulling GSC data into an AI client normally means either (a) manual CSV exports, (b) a paid data-pipeline vendor like Windsor or Coupler, or (c) building your own script and glue. This is option (d): a small, self-contained MCP server you install once and use from anywhere. Pairs naturally with Google's Analytics MCP for a complete SEO + user behavior picture.


Tools

All tools are read-only. No writes in v1.

Tool What it does
gsc_list_sites Enumerate every verified Search Console property for the authenticated user
gsc_query_search_analytics Flexible analytics query — any combination of dimensions (query, page, country, device, date, searchAppearance) and filters
gsc_top_queries Convenience: top N search queries for a site over a recent window
gsc_top_pages Convenience: top N landing pages for a site over a recent window
gsc_inspect_url URL inspection — indexing verdict, coverage state, Google-chosen canonical, last crawl, mobile usability, rich results
gsc_list_sitemaps List registered sitemaps with status, errors, warnings, last submitted date
gsc_health_check Auth + API reachability diagnostic (use this first when something breaks)

Setup

Three steps. ~15 minutes total.

1. Google Cloud — create an OAuth client

  1. Open Google Cloud Console.
  2. Create (or reuse) a project. Name it something like gsc-mcp.
  3. Enable the Search Console API: one-click link.
  4. Go to APIs & Services → Credentials.
  5. If you haven't already, configure the OAuth consent screen:
    • User type: External.
    • App name: gsc-mcp, support email: your email, developer email: your email.
    • Add yourself as a Test user (under "Audience" / "Test users").
  6. Click Create Credentials → OAuth client ID.
    • Application type: Desktop app.
    • Name: gsc-mcp-local.
  7. Download JSON. Move the downloaded file to:
    ~/.config/gsc-mcp/credentials.json
    
    (Create the directory if it doesn't exist: mkdir -p ~/.config/gsc-mcp)

2. Install the server

pipx install gsc-mcp

Or with pip:

pip install gsc-mcp

This installs the gsc-mcp console command and the gsc_mcp Python module.

3. Authenticate once

gsc-mcp auth

A browser window opens. Sign in with the Google account that owns your Search Console properties. You'll see a "Google hasn't verified this app" screen — that's expected because the app is for your personal use; click Advanced → Go to gsc-mcp (unsafe) and continue.

The token is saved to ~/.config/gsc-mcp/token.json (chmod 600) and refreshed automatically from here on.

Verify everything works:

gsc-mcp info
# gsc-mcp version: 0.1.0
# Credentials path: /Users/you/.config/gsc-mcp/credentials.json  (exists: True)
# Token path:       /Users/you/.config/gsc-mcp/token.json  (exists: True)

Connect it to a client

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent path on Linux/Windows, and add:

{
  "mcpServers": {
    "gsc": {
      "command": "gsc-mcp"
    }
  }
}

Restart Claude Desktop. Type /mcp in a chat — you should see gsc listed with 7 tools.

Claude Code

claude mcp add gsc -- gsc-mcp

Or edit ~/.claude.json / the project .claude/mcp.json directly:

{
  "mcpServers": {
    "gsc": {
      "command": "gsc-mcp"
    }
  }
}

Claude.ai

  1. Settings → Connectors → Add custom connector.
  2. Name: GSC. Command: gsc-mcp.
  3. Enable it.

Cursor, Windsurf, Gemini CLI, etc.

Any MCP-compatible client accepts the same stdio server config. Command: gsc-mcp. No args.


Example prompts once connected

What verified sites do I have in Search Console?

Show me the top 20 search queries for defusely.com over the last 30 days.

Which pages on defusely.app have the biggest impression-to-click gap?

Inspect https://defusely.com/pricing — is it indexed, what's the canonical, when
was it last crawled?

List all sitemaps registered for defusely.com and flag any with errors.

Compare CTR on mobile vs desktop for the top 10 queries on defusely.com this month.

Configuration

All paths are overrideable via environment variables:

Variable Default Purpose
GSC_MCP_CREDENTIALS ~/.config/gsc-mcp/credentials.json OAuth client JSON from Google Cloud
GSC_MCP_TOKEN ~/.config/gsc-mcp/token.json Cached access token (auto-managed)

Troubleshooting

Error 403 on every call — the Search Console API isn't enabled on your Google Cloud project, or the authenticated Google account doesn't own the property. Enable the API at the Search Console API library page and verify site ownership in Search Console.

Error 401 / token refresh fails — your refresh token was revoked (Google does this after ~6 months of non-use or on password change). Delete the token and re-auth:

rm ~/.config/gsc-mcp/token.json
gsc-mcp auth

Site not found — call gsc_list_sites first to see the exact siteUrl format. Domain properties use sc-domain:example.com; URL-prefix properties use https://example.com/ with the trailing slash.

URL inspection returns "quota exceeded" — the URL Inspection API is capped at ~2000 calls per property per day. Wait 24 hours or use bulk URL inspection sparingly.

Data looks stale — Search Console data typically lags real-time by 2-3 days. The default date range in this server ends 3 days ago for this reason. Don't query end_date = today and expect full data.


License

Apache 2.0 — see LICENSE.

Contributing

Issues and PRs welcome. This is deliberately small; keep changes focused on the GSC API surface.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选