SEO Analytics MCP

SEO Analytics MCP

An MCP server that integrates Google Search Console and Google Analytics 4 to provide unified SEO and web traffic analysis. It allows users to fetch search performance data, merge page metrics, and generate automated trend reports or actionable insights through tool calls.

Category
访问服务器

README

SEO Analytics MCP

MCP server for Google Search Console (GSC) + Google Analytics 4 (GA4).

How It Works

What .venv Means

  • .venv is this project's private Python environment.
  • It contains its own Python interpreter and dependencies for this repo only.
  • run-local.sh activates .venv so the MCP server runs with the correct package versions.

What stdio Means

  • stdio means the MCP client and server communicate through standard input/output streams.
  • The client starts run-local.sh, sends tool requests in, and reads JSON responses out.
  • No web server or HTTP endpoint is required for the default local setup.
  1. Your MCP client (Claude/Codex) launches run-local.sh as a stdio server process.
  2. run-local.sh prepares .venv, installs dependencies, loads config/.env, and validates config/service-account.json.
  3. The Python server (seo-analytics-mcp) receives tool calls, fetches data from GSC/GA4 using the service account, and computes merged analysis outputs.
  4. Results are returned to the MCP client as structured JSON.

Deployment Model

  • This project is deployed as a local process on your machine via stdio.
  • It is not an HTTP API service by default and does not require cloud hosting.
  • To "deploy" it for another environment, clone the repo there, provide config/.env and config/service-account.json, then register that machine's run-local.sh path in the MCP client.

Prerequisites

  • Python 3.11+

Quick Start

  1. Create local config files from templates:
cp config/.env.example config/.env
cp config/service-account.example.json config/service-account.json
  1. Fill required values:
  • config/.env
    • DEFAULT_GSC_SITE_URL (required format: sc-domain:example.com)
    • DEFAULT_GA4_PROPERTY_ID
  • config/service-account.json
    • Replace all REPLACE_WITH_... fields with real Google service-account values.
  1. Run the server:
./run-local.sh

The script creates/uses .venv, installs dependencies, loads config/.env, validates credentials, and starts seo-analytics-mcp over stdio.

MCP Client Setup

Use the local launcher script as the MCP server command:

/absolute/path/to/analytics/run-local.sh

Codex App

Add server:

codex mcp add seo-analytics -- /absolute/path/to/analytics/run-local.sh

Verify:

codex mcp list

Remove:

codex mcp remove seo-analytics

Claude Code CLI

Add server:

claude mcp add -s project seo-analytics -- /absolute/path/to/analytics/run-local.sh

Verify:

claude mcp list

Remove:

claude mcp remove seo-analytics

Claude Desktop App (macOS)

  1. Quit Claude Desktop completely.
  2. Edit ~/Library/Application Support/Claude/claude_desktop_config.json.
  3. Add this server entry (merge into existing mcpServers if present):
{
  "mcpServers": {
    "seo-analytics": {
      "type": "stdio",
      "command": "/absolute/path/to/analytics/run-local.sh",
      "args": []
    }
  }
}
  1. Start Claude Desktop again.
  2. In a new chat, run tool capabilities to confirm connection.

Main Tools

  • capabilities
  • gsc_list_sites
  • gsc_top_pages
  • gsc_top_queries
  • ga4_landing_pages
  • analytics_merge_page_metrics
  • analytics_generate_action_items
  • analytics_trend_report
  • analytics_data_quality_report

Screenshots

These screenshots are example outputs produced by using Claude Code with this MCP server. The MCP provides the underlying GSC/GA4 data and analytics tools; dashboard rendering is not generated by default by the server itself. For privacy reasons, values shown in the screenshots are randomized; the actual workflow was executed against real data.

MCP Dashboard View 1 MCP Dashboard View 2 MCP Dashboard View 3

Troubleshooting

  • service-account.json still contains placeholder values
    • Replace all REPLACE_WITH_... fields in config/service-account.json.
  • No such file or directory: .../credentials/service-account.json
    • You have a stale credential env override from an older setup.
    • Re-add the MCP server so it runs the latest run-local.sh and uses config/service-account.json.
  • Operation not permitted when Claude Desktop starts MCP
    • macOS is blocking execution from protected folders (commonly ~/Documents).
    • Either grant Claude Desktop access in System Settings -> Privacy & Security (Files and Folders and/or Full Disk Access) or move the repo to a non-protected path like ~/dev/analytics.
    • After changing permissions/path, restart Claude Desktop and re-add the MCP entry if needed.
  • Missing property_id and DEFAULT_GA4_PROPERTY_ID is not set
    • Set DEFAULT_GA4_PROPERTY_ID in config/.env.
  • Missing site_url...
    • Set DEFAULT_GSC_SITE_URL in config/.env.
  • GSC permission error on https://... property
    • This server enforces GSC properties in sc-domain:<domain> format to avoid URL-prefix mismatch issues.
    • Use a Domain property in Search Console and grant your service account access there.

Security

  • Never commit config/service-account.json or config/.env.
  • Commit only template files:
    • config/service-account.example.json
    • config/.env.example

推荐服务器

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

官方
精选