Gsc Cli 标志

Gsc Cli

社区
exiao
gsc-cli

Query Google Search Console data via MCP (mcporter). Use when checking search performance, impressions, clicks, CTR, rankings for $APP_DOMAIN or any verified property. Also use for finding SEO quick wins, checking indexing status, or managing sitemaps.

概览

发布者exiao
代码仓库skills
技能名称gsc-cli
星标数
40
复刻数
12
附带文件
1
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 exiao 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Gsc Cli AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/exiao/skills/tree/main/external-services/gsc-cli
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/exiao/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/external-services/gsc-cli .claude/skills/gsc-cli
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Gsc Cli,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Gsc Cli。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Gsc Cli 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

gsc-cli — Google Search Console via MCP

Query Google Search Console performance data using mcporter's gsc server.

Available Tools (8)

ToolPurpose
list_sitesList all sites visible to the authenticated Google identity
search_analyticsBasic search performance data
enhanced_search_analyticsUp to 25K rows, regex filters, quick wins detection
detect_quick_winsDedicated quick wins finder with ROI estimation
index_inspectCheck if a URL is indexed or indexable
list_sitemapsList sitemaps for a site
get_sitemapGet details of a specific sitemap
submit_sitemapSubmit a new sitemap

Setup

Prerequisites

  1. Google credential file at ~/.config/gsc-credentials.json
  2. Search Console API enabled in Google Cloud Console
  3. The authenticated Google identity has access to the GSC property

Recommended auth: user's Google account OAuth

Use OAuth when the user already owns the GSC properties. The MCP server's GoogleAuth({ keyFile }) accepts authorized_user credential JSON, even though the package docs only mention service accounts.

Fast path with gcloud:

bash
gcloud auth application-default login \
  --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/webmasters.readonly

# Copy or symlink ADC to the file mcporter expects
cp ~/.config/gcloud/application_default_credentials.json ~/.config/gsc-credentials.json

Then edit ~/.config/gsc-credentials.json and ensure it contains a quota project:

json
{
  "type": "authorized_user",
  "client_id": "...",
  "client_secret": "...",
  "refresh_token": "...",
  "quota_project_id": "<google-cloud-project-id>"
}

If quota_project_id is missing, mcporter call gsc.list_sites fails with: searchconsole.googleapis.com API requires a quota project.

Alternate auth: service account

Service accounts work poorly with GSC because the web UI may reject service account emails with email not found. If OAuth is available, prefer OAuth.

If service account auth is still required:

  1. Go to console.cloud.google.com/iam-admin/serviceaccounts
  2. Pick or create a project
  3. Create Service Account (no IAM roles needed; GSC permissions are separate)
  4. Keys tab -> Add Key -> JSON
  5. Save to ~/.config/gsc-credentials.json
  6. Enable Search Console API for the project
  7. Try adding the service account in GSC Settings -> Users and permissions. If the UI rejects it, switch to OAuth instead. The API self-registration workaround can leave the service account as siteUnverifiedUser, which still cannot query analytics.

Verify access:

bash
mcporter call gsc.list_sites --output json

OAuth/auth troubleshooting details are in references/oauth-auth.md.

mcporter config

Already configured in ~/.mcporter/mcporter.json as stdio server:

bash
mcporter list gsc --schema

Usage

Basic performance data

bash
# Last 28 days of query performance
mcporter call gsc.search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-09" \
  endDate="2026-05-07" \
  dimensions="query" \
  rowLimit:1000 \
  --output json

# Page-level performance
mcporter call gsc.search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-09" \
  endDate="2026-05-07" \
  dimensions="page" \
  --output json

Multi-dimension analysis

bash
# Query + page breakdown (which queries land on which pages)
mcporter call gsc.search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  dimensions="query,page" \
  rowLimit:5000 \
  --output json

# Device breakdown
mcporter call gsc.search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  dimensions="query,device" \
  --output json

# Daily trend for a specific query
mcporter call gsc.search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  dimensions="date" \
  queryFilter="bloom investing app" \
  --output json

Enhanced search analytics (up to 25K rows, regex)

bash
mcporter call gsc.enhanced_search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  dimensions="query,page" \
  regexFilter="(invest|stock|portfolio)" \
  rowLimit:25000 \
  --output json

Filtering

bash
# Filter by page URL
mcporter call gsc.search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  dimensions="query" \
  pageFilter="$APP_DOMAIN/subscribe" \
  --output json

# Regex filter for related queries
mcporter call gsc.search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  dimensions="query" \
  queryFilter="regex:(invest|stock|portfolio)" \
  filterOperator="includingRegex" \
  --output json

# Mobile only
mcporter call gsc.search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  dimensions="query" \
  deviceFilter="MOBILE" \
  --output json

Quick Wins Detection (dedicated tool)

bash
# Find keywords ranking 4-10 with optimization potential
mcporter call gsc.detect_quick_wins \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  minImpressions:50 \
  maxCtr:2 \
  positionRangeMin:4 \
  positionRangeMax:20 \
  --output json

# Or use enhanced_search_analytics with inline quick wins
mcporter call gsc.enhanced_search_analytics \
  siteUrl="sc-domain:$APP_DOMAIN" \
  startDate="2026-04-01" \
  endDate="2026-05-01" \
  dimensions="query,page" \
  enableQuickWins:true \
  --output json

URL Indexing Inspection

bash
mcporter call gsc.index_inspect \
  siteUrl="sc-domain:$APP_DOMAIN" \
  inspectionUrl="https://$APP_DOMAIN/subscribe" \
  --output json

Sitemaps

bash
# List all sitemaps
mcporter call gsc.list_sitemaps \
  siteUrl="https://$APP_DOMAIN/" \
  --output json

# Submit a new sitemap
mcporter call gsc.submit_sitemap \
  siteUrl="https://$APP_DOMAIN/" \
  feedpath="https://$APP_DOMAIN/sitemap.xml" \
  --output json

Parameters Reference

ParameterRequiredDescription
siteUrlYessc-domain:example.com or https://example.com/
startDateYesYYYY-MM-DD
endDateYesYYYY-MM-DD
dimensionsNoComma-separated: query, page, country, device, date, searchAppearance
typeNoweb (default), image, video, news
rowLimitNoDefault 1000, max 25000
dataStateNofinal (default) or all (includes fresh/unfinalized data)
queryFilterNoFilter queries; prefix regex: for regex
pageFilterNoFilter pages; prefix regex: for regex
countryFilterNoISO 3166-1 alpha-3 (e.g. USA)
deviceFilterNoDESKTOP, MOBILE, TABLET
filterOperatorNoequals, contains, notEquals, notContains, includingRegex, excludingRegex
aggregationTypeNoauto, byProperty, byPage

Site URL Format

  • Domain property: sc-domain:$APP_DOMAIN (covers all subdomains and protocols)
  • URL prefix: https://$APP_DOMAIN/ (trailing slash required)

Use sc-domain: format when available as it captures all traffic.

Interpreting Results

  • Clicks: Actual visits from search
  • Impressions: Times a page appeared in search results
  • CTR: Click-through rate (clicks/impressions)
  • Position: Average ranking position (1 = top)

Common Workflows

  1. Weekly SEO check: Pull top queries by clicks, compare week-over-week
  2. Content optimization: Find pages with high impressions but low CTR (title/description improvements)
  3. New page monitoring: Track recently published pages' search visibility via index_inspect
  4. Keyword gaps: Compare queries landing on your site vs competitor keyword lists (combine with DataForSEO)
  5. Mobile vs Desktop: Check if mobile rankings differ significantly

Pitfalls

  • Prefer OAuth user credentials over service accounts for personal/company GSC properties. Service accounts often cannot be added through the GSC UI, while OAuth immediately inherits the user's existing properties.
  • authorized_user JSON works as GOOGLE_APPLICATION_CREDENTIALS for this MCP server because it uses GoogleAuth keyFile under the hood.
  • OAuth ADC needs quota_project_id; without it, Search Console returns a 403 quota project error.
  • GSC data has a 2-3 day lag. Don't query today's date.
  • dataState="all" includes preliminary data that may change.
  • Max 25,000 rows per request. For high-volume sites, use filters to segment.
  • No Google Cloud IAM role is needed for GSC access. GSC permissions are separate from Cloud IAM.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Gsc Cli AI 技能有什么作用?

Query Google Search Console data via MCP (mcporter). Use when checking search performance, impressions, clicks, CTR, rankings for $APP_DOMAIN or any verified property. Also use for finding SEO quick wins, checking indexing status, or managing sitemaps.

为什么在 TypingMind 中使用 Gsc Cli?

因为您只需安装一次,就能搭配任何模型使用。Gsc Cli 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Gsc Cli?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/exiao/skills/tree/main/external-services/gsc-cli。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Gsc Cli?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Gsc Cli 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Gsc Cli 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Gsc Cli AI 技能免费吗?

exiao 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇