SCMCP
SCMCP — 多租户 Google Search Console MCP
一个托管的 MCP 服务器,可让任意数量的用户将 Claude 连接到他们自己的 Google Search Console 数据——并提供原始 GSC 无法实现的定制 SEO 分析:快速获胜、内容衰减、关键词蚕食、CTR 异常值、品牌拆分、文件夹汇总、意图分类和算法更新关联。
每个用户使用 Google 登录,生成受限访问令牌,并连接 Claude。每个令牌只能读取其所有者的数据。所有工具均为只读。
通过复用 SearchPulse 的 MCP 服务器构建。
架构
Google sign-in ──► NextAuth ──► Account (OAuth tokens, ENCRYPTED at rest)
│
Claude ──HTTP──► /api/mcp ──► token → userId (+ site scope) ──► tools ──► GSC API
│
IP + per-token rate limits · revocation · expiry · audit登录: Google OAuth(
webmasters.readonly),会话为签名 JWT。每用户 MCP 令牌:
scmcp_+ 256 位熵,仅以 SHA-256 哈希存储。每个用户可有多个命名令牌,每个令牌可选站点范围和过期,可单独撤销,并带有最后使用/IP/次数审计。状态: 通过 Prisma 使用 Postgres。
Related MCP server: GSC MCP Server v2 - Remote Edition
MCP 加固
措施 | 位置 |
令牌仅以 SHA-256 哈希存储(256-bit 熵) |
|
在任何 DB 命中之前进行格式预检查 |
|
已撤销/过期的令牌永远不会通过身份验证 |
|
对于缺失/错误/已撤销/过期的令牌,统一返回 401(不进行枚举) |
|
每个令牌的站点允许列表在每次调用时集中强制执行 |
|
每 IP + 每令牌速率限制;基于 DB,如果 DB 不可用,则降级为每实例内存限制器(并非完全开放) |
|
客户端 IP 仅从代理控制的标头获取,并经过 IP 验证,因此伪造的 |
|
使用审计(最后使用、IP、次数) |
|
Google OAuth 令牌静态加密(AES-256-GCM);解密失败返回 null,绝不返回原始密文 |
|
只读工具表面(无写入工具) |
|
|
|
首选标头认证; |
|
对令牌创建/撤销及控制台路由进行同源(CSRF)检查 |
|
设置
1. 数据库
创建一个 Postgres 数据库(例如 Neon 免费套餐)并复制其连接字符串。
2. Google Cloud
Google Cloud Console → 创建/选择一个项目。
启用 API → Google Search Console API。
凭据 → 创建 OAuth 客户端 ID → Web 应用程序。
授权重定向 URI:
http://localhost:3000/api/auth/callback/google(开发)https://your-app.vercel.app/api/auth/callback/google(生产)
OAuth 同意屏幕: 外部;将用户添加为测试用户(对于私有、未验证的应用来说没问题)。
3. 配置并运行
npm install
cp .env.example .env.local # fill in all values
npm run db:push # create the tables
npm run dev仪表板(令牌 + 游乐场):http://localhost:3000/dashboard
MCP 端点:
http://localhost:3000/api/mcp
使用 openssl rand -base64 32 生成密钥(用于 NEXTAUTH_SECRET 和 ENCRYPTION_KEY)。
部署到 Vercel + Neon
推送到 Git 仓库并在 Vercel 中导入。添加 Neon 集成(或粘贴
DATABASE_URL)。设置环境变量:
DATABASE_URL、NEXTAUTH_URL(你的生产 URL)、NEXTAUTH_SECRET、GOOGLE_CLIENT_ID、GOOGLE_CLIENT_SECRET、ENCRYPTION_KEY。对生产数据库运行一次架构:
npm run db:push(在本地使用生产DATABASE_URL,或作为一次性任务)。在 Google Cloud 中添加生产重定向 URI。部署。
使用方法
用户访问你的 URL,使用 Google 登录,进入 /dashboard。
他们创建令牌(可选地限定到特定站点 / 设置过期时间)并复制一次。
他们使用仪表板显示的代码片段连接 Claude:
claude mcp add --transport http scmcp "https://your-app.vercel.app/api/mcp" --header "Authorization: Bearer <TOKEN>"然后询问:“我这个月针对 sc-domain:example.com 的快速获胜是什么?”
仪表板还有一个工具游乐场(会话认证),无需打开 Claude 即可针对你自己的数据运行任何工具。
工具
实时 GSC API — list_gsc_properties · gsc_totals · gsc_top_queries · gsc_top_pages · gsc_performance_timeseries · gsc_compare_queries · gsc_compare_pages · gsc_page_queries · gsc_query_pages · gsc_breakdown · gsc_quick_wins · gsc_content_decay · gsc_cannibalization · gsc_new_lost_keywords · gsc_ctr_outliers · gsc_branded_split · gsc_folder_performance · gsc_query_intent · list_algorithm_updates
BigQuery 批量导出(历史、未采样、无 1000 行上限)— bq_status · bq_totals · bq_top_queries · bq_top_pages · bq_timeseries · bq_by_country · bq_by_device · bq_page_queries · bq_query_pages · bq_custom_query
在 src/lib/tools.ts / src/lib/tools-bq.ts 中添加更多——每个工具一个条目;范围强制和两种传输方式都会自动识别。
BigQuery 连接器
Search Console 的批量数据导出会将你的完整、未采样的 GSC 数据持续流式传输到 BigQuery。SCMCP 查询该导出,以便 Claude 可以拉取超出实时 API 限制的历史/大型数据。
无需新密钥。 查询使用用户自己的 OAuth 令牌(SCMCP 添加
bigquery.readonly范围)针对用户自己的 Google Cloud 项目运行。无需存储服务账户密钥。设置(每个用户): 在 Search Console → 设置 → 批量数据导出中,将导出指向一个 GCP 项目。然后在 SCMCP 仪表板 → 分析 → BigQuery 中,输入你的项目 ID、数据集(以
searchconsole开头)和位置。由于 BigQuery 访问是一个新范围,现有用户需要退出并重新登录一次。安全性: 每个查询都使用 BigQuery 命名参数(防注入),限制计费字节数(
BQ_MAX_BYTES_BILLED,默认 10 GB),并遵循令牌的站点范围。bq_custom_query运行单个只读SELECT,并在站点范围的令牌上禁用。
询问 Claude:“从 BigQuery 中拉取 sc-domain:example.com 过去 12 个月的热门查询。”
分析仪表板
/dashboard/analytics 将你的数据渲染为图表(Recharts):带有上期差异的指标卡片、带指标切换的双轴性能折线图、可排序/可搜索的热门页面和热门查询表格,以及国家/设备条形图。来源切换可在实时 GSC API 和 BigQuery 之间切换整个视图。它采用会话认证——无需 MCP 令牌即可查看你自己的数据。
技术栈
Next.js 16 · NextAuth v5 (Google) · Prisma + Postgres · mcp-handler · @modelcontextprotocol/sdk · googleapis · zod.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityBmaintenanceConnects Google Search Console with Claude AI to enable SEO professionals to analyze their SEO data through natural language conversations, providing access to property information, search analytics, URL inspection, and sitemap management.1,349MIT
- AlicenseNot gradedqualityNot gradedmaintenanceConnects Claude AI to Google Search Console with OAuth 2.0 authentication, enabling users to analyze search performance, inspect URLs, manage sitemaps, and export analytics data through natural language conversations.2
- AlicenseNot gradedqualityDmaintenanceConnects Google Search Console with Claude AI to analyze SEO data through natural language, enabling search analytics reporting, URL inspection, indexing status checks, sitemap management, and data visualization for SEO professionals.MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to access Google Search Console data including search performance, URL indexation, sitemaps, and built-in SEO analysis tools such as trending queries, cannibalization detection, and traffic drop diagnostics.12311MIT
Related MCP Connectors
SEO research, audits, backlinks, GSC, and content workflow tools for AI agents.
Turn Search Console data into SEO actions, content, publishing, indexing, and AI insights.
Live SEO workflow tools for Claude Code, Codex, and AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/abhilashst/scmcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server