mcp-gsc

mcp-gsc

MCP server for Google Search Console, enabling querying search analytics, URL inspection, sitemap management, and more via natural language.

Category
访问服务器

README

<p align="center"> <img src="logo.svg" alt="mcp-gsc" width="280" /> </p>

<h1 align="center">mcp-gsc</h1>

<p align="center"> Google Search Console MCP server — query search analytics, inspect URLs, manage sitemaps & more via natural language. <br/> Built with Bun + TypeScript. Works with Claude, Cursor, and any MCP client. </p>


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:

export GOOGLE_GSC_CREDENTIALS_PATH=/path/to/credentials.json
  1. Run setup to authorize:
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

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 18+ when running via npx.

Claude Desktop / Cursor

Add to your claude_desktop_config.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):

[mcp_servers.gsc]
command = "npx"
args = ["-y", "mcp-gsc@latest"]
startup_timeout_sec = 30
env = { 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

Tool Description
list_properties List all GSC properties with permission levels
get_property_details Verification info, ownership, permissions for a property

Search Analytics

Tool Description
search_analytics Query 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

Tool Description
list_sitemaps List sitemaps with status, type, indexed counts, errors
get_sitemap Detailed sitemap info with content breakdown

URL Inspection

Tool Description
inspect_url URL indexing status, crawl info, rich results, canonicals
batch_inspect_urls Inspect up to 10 URLs at once with categorized results

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

Export

Tool Description
export_csv Export full search analytics to CSV file (auto-paginates, up to 25K rows)

Extended Tools (disabled by default)

Enable with GOOGLE_GSC_ENABLE_EXTENDED_TOOLS=true:

Reporting Suite

Tool Description
performance_overview Aggregate metrics + daily trend breakdown
compare_periods Compare two date ranges with delta calculations
top_movers Biggest gains and drops between periods
device_country_breakdown Performance by device and/or country

SEO Suite

Tool Description
quick_wins High-impression, low-CTR queries in striking distance (position 4-20)
cannibalization Multiple pages competing for the same query
opportunity_finder Emerging queries, growing impressions with low CTR, declining performers
position_tracking Position changes over time for specific queries/pages
ctr_anomalies Queries with abnormal CTR relative to position
content_decay Pages/queries with impressions dropping >50% from historical peak
weekly_seo_report All-in-one report: overview + quick wins + top movers

Technical SEO Suite

Tool Description
indexing_coverage Batch URL inspection with categorized indexing status
sitemap_health Sitemap error patterns, freshness, indexed vs submitted ratio

Write Tools (disabled by default)

Enable with GOOGLE_GSC_ENABLE_WRITES=true:

Tool Description
add_site Add a new site to GSC
delete_site Remove a site from GSC
submit_sitemap Submit a new sitemap
delete_sitemap Remove/unsubmit a sitemap

Configuration

Variable Required Default Description
GOOGLE_GSC_CREDENTIALS_PATH Yes Path to OAuth client JSON or service account key
GOOGLE_GSC_TOKEN_PATH No Derived Path to cached OAuth token (default: *_token.json next to credentials)
GOOGLE_GSC_PROPERTY No Default property URL (e.g., sc-domain:example.com). Accepts bare domains.
GOOGLE_GSC_ENABLE_WRITES No false Enable write tools
GOOGLE_GSC_ENABLE_EXTENDED_TOOLS No false Enable extended analytics tools (13 extra)
GOOGLE_GSC_ENV_FILE No .env Path to .env file
DEBUG No 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.

mcp-gsc --version

Development

Requires Bun.

git clone https://github.com/pijusz/mcp-gsc.git
cd mcp-gsc
bun install
bun test           # tests
bun run build      # standalone binary
bun run inspect    # MCP Inspector
bun run check      # biome format + lint

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选