Google Search Console

io.github.acamolese由 GitHub 帳號 acamolese 發布v3.0.1更新於 Oct 25, 2026

Google Search Console: SEO audits, performance queries, URL inspection, indexing checks.

概覽

AI 產生的概覽

唯讀的 Google Search Console 伺服器,用於 SEO 稽核:查詢成效資料、檢查網址、檢視索引與網站地圖,並產生 HTML 稽核報告。

可以做什麼
列出可存取的資源及其權限層級與類型,提供依最差優先排序的資源總覽,以及設定與 API 連線檢查(gsc_doctor)。依篩選條件、維度和分頁查詢 Search Analytics,並支援期間比較、成效概覽、快速見效機會、點擊率落差、關鍵字自我競爭、流量下滑、內容衰退和異常提醒。批次檢查網址的索引狀態,並對單一頁面執行完整的網址檢查。列出 Google 已知的網站地圖及其錯誤和警告。產生自包含、可白標的 HTML 稽核報告,支援英文或義大利文,品牌與門檻來自 JSON 檔案。
適用情境
適合對已在 Search Console 中授予讀取權限的網站進行 SEO 工作:每週成效檢視、索引稽核、找出關鍵字自我競爭或點擊率落差、診斷流量下滑,以及為代理商產生可掛名的客戶稽核報告。
執行需求
以 Python 套件形式透過 uvx 在本機執行(需安裝 uv),或以 Docker 容器執行。需要 Google Search Console API 存取權:OAuth 桌面應用程式用戶端(GSC_CLIENT_ID、GSC_CLIENT_SECRET、GSC_REFRESH_TOKEN,透過 auth 指令取得)、服務帳戶金鑰(GSC_SERVICE_ACCOUNT_FILE 或 GSC_SERVICE_ACCOUNT_JSON),或應用程式預設憑證。需要連線至 Google API 的網路。
安裝前請注意
需要 OAuth 用戶端憑證和更新權杖,或服務帳戶私密金鑰檔案;這些屬於機密,應避免寫入共用設定。權限範圍為唯讀(webmasters.readonly),任何工具都不會修改資源或網站地圖。選用的 Docker 容器以 streamable HTTP 提供且本身沒有身分驗證,應僅綁定回環位址或置於反向代理之後。受 Google 配額限制,包括每個資源每日的網址檢查上限。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Google Search Console,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Google Search Console MCP

English · Italiano

[CI] [PyPI] [Python] [License: MIT]

Seventeen read-only tools over the Google Search Console API, plus a deterministic white-label HTML audit report an agency can put its own name on and send to a client, in English or Italian.

[The generated audit report]

Regenerate that report from committed synthetic data, with no credentials:

bash
python scripts/render_sample_report.py --lang en --open

Install

Claude Code

bash
/plugin marketplace add acamolese/google-search-console-mcp/plugin install google-search-console@acamolese

The plugin brings the MCP server, five skills (weekly review, cannibalisation check, indexing audit, content opportunities, white-label client audit) and a config prompt for the three credentials.

Claude Desktop

Download google-search-console.mcpb from the latest release and open it. It needs uv installed. Or edit the config file directly:

json
{  "mcpServers": {    "google-search-console": {      "command": "uvx",      "args": ["mcp-google-search-console"],      "env": {        "GSC_CLIENT_ID": "...",        "GSC_CLIENT_SECRET": "...",        "GSC_REFRESH_TOKEN": "..."      }    }  }}

Cursor, Codex, Gemini CLI, Zed

Any MCP client takes the same three lines: command uvx, argument mcp-google-search-console, and the three GSC_* environment variables.

bash
# Codexcodex mcp add google-search-console -- uvx mcp-google-search-console
# Gemini CLIgemini mcp add google-search-console uvx mcp-google-search-console

Docker

bash
docker build -t mcp-gsc .docker run --rm -p 127.0.0.1:8765:8765 \  -e GSC_CLIENT_ID -e GSC_CLIENT_SECRET -e GSC_REFRESH_TOKEN \  -v "$PWD/reports:/reports" mcp-gsc

The container speaks streamable HTTP on /mcp. It has no authentication of its own: keep it on loopback or behind a reverse proxy.

Authentication

The OAuth scope is webmasters.readonly and nothing else. No tool in this server can modify a property, a sitemap or anything else in Search Console.

Credentials are resolved in this order:

  1. GSC_AUTH_MODE if set (oauth, service_account, adc)
  2. GSC_SERVICE_ACCOUNT_FILE or GSC_SERVICE_ACCOUNT_JSON
  3. GSC_CLIENT_ID + GSC_CLIENT_SECRET + GSC_REFRESH_TOKEN
  4. A token file in ~/.config/mcp-google-search-console/
  5. Application Default Credentials

OAuth, once

  1. In Google Cloud Console, enable the Google Search Console API and create an OAuth client of type Desktop app.

  2. Export the client, or save the downloaded JSON as ~/.config/mcp-google-search-console/oauth_credentials.json:

    bash
    export GSC_CLIENT_ID="...apps.googleusercontent.com"export GSC_CLIENT_SECRET="..."uvx mcp-google-search-console auth
  3. The browser flow prints the three export lines for a stateless setup, and also stores a token at ~/.config/mcp-google-search-console/token.json with 0600 permissions.

On a headless machine, run auth on your laptop and copy the three environment variables across. --no-browser prints the URL instead of opening one, but still needs a local redirect.

Service account

Grant the service account's email read access to the property in Search Console, then point the server at the key:

bash
export GSC_SERVICE_ACCOUNT_FILE=/path/to/key.json# or, for a container:export GSC_SERVICE_ACCOUNT_JSON='{"type":"service_account",...}'

Check it works

bash
uvx mcp-google-search-console doctor

Prints the auth mode in use, when the token expires, how many properties the account can read, and the defaults every tool applies. Secrets are masked. Exits 1 when nothing resolves, which is the answer to most "the server won't start" reports.

Tools

ToolWhat it answers
gsc_sitesWhich properties can this account read, and in what exact format
gsc_site_detailsPermission level and type for one property
gsc_queryThe Search Analytics report, with filters, dimensions and pagination
gsc_performance_overviewIs the site up or down, against the previous period
gsc_compare_periodsWhat changed between two periods, ranked by click delta
gsc_quick_winsQueries close enough to the top that a push would pay off
gsc_ctr_gapsPages that rank but are not clicked
gsc_cannibalizationQueries where several pages compete against each other
gsc_traffic_dropsPages that lost clicks, with a likely cause for each
gsc_content_decayPages sliding down month after month
gsc_alertsWhat moved sharply enough to be worth a message today
gsc_portfolioEvery property at a glance, worst first
gsc_indexing_issuesWhich of these URLs are indexed, and why not
gsc_inspect_urlFull URL Inspection for one page
gsc_sitemapsWhich sitemaps Google knows about, with errors and warnings
gsc_doctorWhat is configured, and does the API answer
gsc_auditThe full HTML report

Three prompts wrap the workflows that repeat: gsc_weekly_report, gsc_indexing_audit, gsc_content_opportunities.

Why this server

HereTypical GSC MCP server
Client-ready reportSelf-contained HTML, English or Italian, white-labelnone
AnalysisCannibalisation, CTR gaps, decay, drop diagnosis, run server-sideraw rows, analysed by the model
ThresholdsAdapt to the size of the propertyfixed, or none
Datesperiod="last_month", days=28, resolved server-sideexplicit dates only
FreshnessdataState=all by default, matching the UIfinal only
AuthOAuth, service account, ADCOAuth only
OutputTSV by default, roughly a third of the tokens of pretty JSONjson.dumps(indent=2)
ErrorsGoogle's reason plus what to do about itbare HTTP status
Tests280+, on both mcp majors, three operating systemsusually none

Report customisation

Colours, logo, report name, brand terms and thresholds come from a JSON file. Pass branding_path, or place it at ~/.config/mcp-google-search-console/branding.json to apply it everywhere:

json
{  "brand_name": "Your Agency",  "logo": "logo.png",  "brand_terms": ["clientbrand", "client brand"],  "colors": { "primary": "#2b6cb0", "primary_dark": "#1a365d" },  "thresholds": { "min_impressions": 200 }}

A local logo is base64-encoded into the document. A remote one is only kept if allow_external_fonts is true, because the report is otherwise guaranteed to contain no external URL at all: no CDN, no font service, nothing that phones home when a client opens it.

brand_terms matters more than it looks. Without it, the first label of the domain is used as the brand, which is wrong for abbreviations, holding companies and invented names, and it silently mislabels the brand/non-brand split. The report says when it had to guess.

Quotas and limits

  • 16 months of daily data. Anything older is not available at any price.
  • Hourly data: the last 10 days only.
  • URL Inspection: 600 per minute and 2,000 per day per property. This is the limit that bites on a large site.
  • Search Analytics: 1,200 queries per minute per site. Responses are cached in memory for 6 hours (1 hour for inspections); no_cache=true bypasses it.
  • Rows: 25,000 per API call. Tools default to 100 and cap at 1,000, with start_row for pagination; the cap is reported in the response, never applied silently.

Environment variables

VariableDefaultPurpose
GSC_CLIENT_ID, GSC_CLIENT_SECRET, GSC_REFRESH_TOKENStateless OAuth
GSC_SERVICE_ACCOUNT_FILE, GSC_SERVICE_ACCOUNT_JSONService account
GSC_AUTH_MODEautoForce oauth, service_account or adc
GSC_REPORT_LANGUAGEenReport language: en or it
GSC_DATA_STATEallall includes today's partial data, final does not
GSC_CACHE_TTL_SECONDS21600Response cache TTL; 0 disables it
GSC_INSPECT_CONCURRENCY5Parallel URL inspections
GSC_LOG_LEVELWARNINGLogging, always to stderr
MCP_TRANSPORT, MCP_HOST, MCP_PORTstdioTransport

Troubleshooting

spawn uvx ENOENT — the client cannot find uvx on its PATH. GUI apps do not inherit a shell PATH. Use the absolute path: which uvx gives it, typically /Users/you/.local/bin/uvx.

403 forbidden on every call — almost always the property format. A domain property is sc-domain:example.com; a URL-prefix property is https://example.com/, trailing slash included. gsc_sites returns the exact strings.

401 invalid_grant — the refresh token was revoked or expired. Google expires refresh tokens for OAuth apps still in "testing" after seven days; publish the app, or re-run auth.

403 quotaExceeded — the daily URL Inspection quota is gone. It resets tomorrow; nothing retries past it.

Empty report on a small site — check the thresholds in the response meta. They adapt to the property, but the floors (50 impressions, 10 clicks) still apply. Pass thresholds to lower them.

Anything else — run doctor and include its output in the issue.

Security

  • Read-only scope, requested and never widened.
  • Token files are written atomically with 0600 permissions. Credentials supplied through the environment are never written to disk.
  • gsc_doctor masks the client ID and never returns a token.
  • No telemetry, no analytics, no request to any host other than Google's API.

See SECURITY.md for the reporting policy.

Development

bash
uv venv && uv pip install -e ".[dev]"ruff check src tests scripts && ruff format --check src tests scriptspytest -q --cov=google_search_console_mcppython scripts/sync_versions.pypython scripts/render_sample_report.py --lang it --open

Tests never hit the network. Live tests exist behind -m live and require GSC_LIVE_TESTS=1 plus credentials; they never run in CI.

Releases: see docs/RELEASING.md. Decisions not covered by the code are logged in docs/DECISIONS.md.

License

MIT. Chart.js 4.5.1 is vendored under src/google_search_console_mcp/static/, also MIT, with its licence alongside.

來源:README.md,提交 3bba49f

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v3.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分