Skip to main content
Glama

searchconsole-mcp

为你的项目自动化 Google Search Console 的 MCP 服务器:搜索分析、站点地图管理、网站属性和 URL 检查。

工具

工具

描述

gsc_list_sites

列出服务账号可以访问的所有属性

gsc_add_site / gsc_remove_site

添加/移除属性(sc-domain:example.com 或 https://www.example.com/)

gsc_search_analytics

按查询/页面/国家/设备/日期分组的点击次数、展示次数、CTR、排名,支持筛选。默认最近 28 天

gsc_list_sitemaps / gsc_get_sitemap

检查已提交的站点地图和索引数量

gsc_submit_sitemap / gsc_delete_sitemap

提交或移除站点地图

gsc_inspect_url

URL 检查 API:索引状态、规范链接、抓取信息、移动设备可用性

Related MCP server: Google Search Console MCP Server

一次性 Google 设置

  1. 在 Google Cloud Console 中创建项目。

  2. 启用 Google Search Console API(APIs & Services > Library)。

  3. 创建服务账号(IAM & Admin > Service Accounts)并下载 JSON 密钥。

  4. 对于每个 Search Console 属性:Settings > Users and permissions > Add user,粘贴服务账号邮箱(...@...iam.gserviceaccount.com)并授予所有者权限(URL 检查 API 需要所有者权限)。

配置

环境变量:

变量

必填

描述

GSC_SERVICE_ACCOUNT_JSON

二选一

内联的完整服务账号 JSON 密钥

GSC_SERVICE_ACCOUNT_FILE

二选一

密钥文件的路径。默认为 ./service-account.json

GSC_DEFAULT_SITE

可选

默认属性,这样每次调用时可以省略 siteUrl

服务器启动时还会从其工作目录加载 .env。

在 MCP 客户端中注册

opencode(~/.config/opencode/opencode.json 或项目 .opencode/opencode.json):

{
  "mcp": {
    "searchconsole": {
      "type": "local",
      "command": ["node", "/absolute/path/to/searchconsole-mcp/dist/index.js"],
      "environment": {
        "GSC_SERVICE_ACCOUNT_FILE": "/absolute/path/to/service-account.json",
        "GSC_DEFAULT_SITE": "sc-domain:example.com"
      }
    }
  }
}

Claude Desktop(claude_desktop_config.json):

{
  "mcpServers": {
    "searchconsole": {
      "command": "node",
      "args": ["/absolute/path/to/searchconsole-mcp/dist/index.js"],
      "env": {
        "GSC_SERVICE_ACCOUNT_FILE": "/absolute/path/to/service-account.json",
        "GSC_DEFAULT_SITE": "sc-domain:example.com"
      }
    }
  }
}

开发

npm install
npm run build     # tsc -> dist/
npm start         # run the server on stdio
npm run smoke     # boots the server and lists tools

注意事项

  • 分析数据滞后 ~2 天;传入 dataState: "all" 以包含最新的部分数据。

  • API 将每次请求的分析行数限制为 25,000 条;使用 startRow 进行分页。

  • 通过 API 添加网站时,在所有权确认之前该网站将保持未验证状态;最简单的做法是先在界面中将服务账号邮箱添加为所有者。

Available Tools

9 tools
gsc_add_siteAdd a Search Console siteA

Add a property to Search Console. Use "sc-domain:example.com" for domain properties or "https://www.example.com/" for URL-prefix properties. The property stays unverified until ownership is confirmed.

Inputs: siteUrl (required).

gsc_delete_sitemapDelete a sitemapA

Remove a sitemap from a property. Pages already indexed are not deindexed by this.

Inputs: feedpath (required), siteUrl.

gsc_get_sitemapGet sitemap detailsA

Get details of one submitted sitemap (status, contents, errors/warnings).

Inputs: feedpath (required), siteUrl.

gsc_inspect_urlInspect URL indexing statusA

URL Inspection API: check whether a URL is on Google, its coverage state, canonical, crawl info, mobile usability and rich results. The service account must be an OWNER of the property for this API. Only works for URLs in properties you own.

Inputs: inspectionUrl (required), siteUrl, languageCode.

gsc_list_sitemapsList sitemapsA

List submitted sitemaps for a property, with submission dates and indexed counts.

Inputs: siteUrl, sitemapIndex.

gsc_list_sitesList Search Console sitesA

List all Google Search Console properties the service account has access to, including permission levels.

Inputs: no named parameters.

gsc_remove_siteRemove a Search Console siteB

Remove a property from Search Console.

Inputs: siteUrl (required).

gsc_search_analyticsQuery search analyticsC

Run a Search Console search-analytics query: clicks, impressions, CTR and average position grouped by dimensions (query, page, country, device, date). Dates default to the last 28 days.

Inputs: endDate, siteUrl, rowLimit, startRow, +6 more.

gsc_submit_sitemapSubmit a sitemapC

Submit a sitemap URL for a property (same as clicking Submit in the UI).

Inputs: feedpath (required), siteUrl.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct resource or action: site management, search analytics, sitemaps, and URL inspection. Even similar-looking sitemap tools are clearly separated by list/get/submit/delete semantics.

    Naming Consistency5/5

    Every tool uses the gsc_ prefix followed by a verb_noun pattern, such as list_sites, submit_sitemap, and inspect_url. The naming is uniform and predictable across the entire set.

    Tool Count5/5

    Nine tools is well-scoped for a Search Console server, covering each core API area without redundancy. No tool feels like filler, and the count is within a comfortable range.

    Completeness5/5

    The set maps closely to Google's official Search Console API surface: site CRUD, sitemap submission/removal/list, search analytics querying, and URL inspection. It covers all primary workflows an agent would need for Search Console.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables interaction with Google Search Console via MCP, offering search analytics, performance summaries, URL inspection, sitemap management, and property listing for SEO workflows.
      1,223 npm
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables programmatic management of Google Search Console properties and IndexNow URL submission for search indexing.
      -