WP Analytics
БесплатноНе проверенWordPress plugin exposing Google Search Console and Google Analytics 4 data through a REST endpoint.
Описание
WordPress plugin exposing Google Search Console and Google Analytics 4 data through a REST endpoint.
README
A WordPress plugin that exposes a Model Context Protocol (MCP) endpoint, letting Claude Desktop query your Google Search Console and Google Analytics 4 data directly in natural language.
Table of Contents
- What It Does
- Installation
- Google Service Account Setup
- Google Analytics 4 Setup
- Google Search Console Setup
- Plugin Configuration
- Team Setup — Claude Desktop
- Available Tools
- Example Prompts
- Troubleshooting
What It Does
- Adds a REST endpoint at
https://yoursite.com/wp-json/mcp/v1/mcp - Authenticates Claude Desktop via a shared API key
- Connects to Google APIs server-side using a service account — credentials never leave your server
- Provides 7 tools across GSC and GA4, all with read-only access
Installation
- Upload the
wp-analytics-mcpfolder to/wp-content/plugins/ - Activate the plugin via WP Admin → Plugins
- Go to Settings → Analytics MCP to configure
Google Service Account Setup
You do this once. Your whole team connects through one shared service account.
A Google Cloud service account is like a bot user — it has its own email address and credentials, and you grant it read-only access to your analytics properties.
Step 1 — Create or Select a Google Cloud Project
- Go to console.cloud.google.com and sign in
- Click the project dropdown at the top of the page
- Either select an existing project, or click New Project, name it (e.g.
FooPlugins Analytics), and click Create
Step 2 — Enable the Required APIs
- In the left sidebar go to APIs & Services → Library
- Search for Google Analytics Data API → click it → click Enable
- Search for Google Search Console API → click it → click Enable
If you see "API already enabled" — nothing to do, move on.
Step 3 — Create the Service Account
- In the left sidebar go to IAM & Admin → Service Accounts
- Click + Create Service Account
- Fill in a Service account name — use something like
fooplugins-mcp - The Service account ID (email) will auto-fill — copy this email, you'll need it in the next two sections
- Click Create and Continue
- Skip the optional role/permissions step — just click Continue, then Done
Step 4 — Download the JSON Key File
- In the service accounts list, click on your new service account's name
- Go to the Keys tab
- Click Add Key → Create new key
- Select JSON and click Create
- A
.jsonfile downloads automatically — this is the file you paste into the plugin
⚠️ Keep this file safe. Never commit it to a public Git repo or share it over email/Slack. Anyone with it can read your analytics data. Treat it like a password.
Google Analytics 4 Setup
You need the service account email from Step 3 (looks like [email protected]).
Step 5 — Add the Service Account to GA4
- Go to analytics.google.com and sign in
- Click the Admin cog icon in the bottom-left
- In the Account column, click Account Access Management (grants access to all properties), or Property Access Management to restrict to one property
- Click the blue + button → Add users
- Paste the service account email into the Email addresses field
- Set the role to Viewer — read-only, cannot modify anything
- Click Add
💡 Find your GA4 Property ID: Go to Admin → Property → Property Settings. It's a number like
123456789. You'll need this when prompting Claude to run GA4 reports.
Google Search Console Setup
Same service account email as above.
Step 6 — Add the Service Account to Search Console
- Go to search.google.com/search-console and sign in
- Select the property you want Claude to access from the left sidebar
- Go to Settings → Users and permissions
- Click Add user
- Paste the service account email into the Email address field
- Set permission to Full — not Restricted (Restricted blocks URL inspection)
- Click Add
💡 Repeat Step 6 for each GSC property you want Claude to access. Each property needs to be added separately.
Plugin Configuration
Step 7 — Add Your Credentials
- Go to WP Admin → Settings → Analytics MCP
- Open your downloaded
.jsonfile in any text editor, select all, and copy - Paste the full JSON into the Service Account JSON field
- Click Save Settings — the page will confirm the service account email it loaded
Step 8 — Generate an API Key
- On the same settings page, click Generate New API Key
- The config block at the top of the page will update with your key
- Copy the full config block — this is what each teammate pastes into Claude Desktop
Team Setup — Claude Desktop
Each teammate does this once. Takes ~5 minutes. No Google account setup required on their end.
Step 9 — Configure Claude Desktop
- Open Claude Desktop → Settings → Developer → Edit Config
- Paste the config block from the plugin settings page into the JSON file:
{
"mcpServers": {
"analytics-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://yoursite.com/wp-json/mcp/v1/mcp",
"--header",
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}
- Save the file and fully quit and restart Claude Desktop
- Go to Settings → Developer — you should see
analytics-mcpwith status Running
Available Tools
| Tool | Source | Description |
|---|---|---|
gsc_list_sites |
GSC | List all Search Console properties the service account can access |
gsc_query_search_analytics |
GSC | Query clicks, impressions, CTR, and average position |
gsc_inspect_url |
GSC | Check the indexing status of a specific URL |
gsc_list_sitemaps |
GSC | List submitted sitemaps for a property |
ga4_run_report |
GA4 | Run a full analytics report — sessions, users, conversions, etc. |
ga4_run_realtime_report |
GA4 | Real-time active users in the last 30 minutes |
ga4_list_metadata |
GA4 | List all available GA4 dimensions and metrics |
Example Prompts
Google Search Console
- "List all my Search Console properties"
- "Show me the top 20 queries for fooplugins.com with more than 50 impressions last month"
- "Which pages have high impressions but low click-through rate?"
- "Is https://fooplugins.com/foogallery/ indexed in Google?"
Google Analytics 4
- "Give me a traffic summary for GA4 property 123456789 for the last 30 days"
- "What are my top 10 pages by sessions this month?"
- "Compare sessions by device category over the last 90 days"
- "How many active users do I have right now, broken down by country?"
Troubleshooting
| Error | Fix |
|---|---|
"No service account JSON configured" |
Paste the full .json file contents into the plugin settings and save |
"Could not load private key" |
Make sure you copied the entire JSON — don't truncate the private_key field |
| HTTP 403 from Google | The service account hasn't been added to the GA4 or GSC property yet — check the setup sections above |
"Invalid or missing API key" |
The key in Claude Desktop's config doesn't match the one on the settings page — regenerate and update |
| Status shows "Failed" in Claude Desktop | Go to WP Admin → Settings → Permalinks and click Save Changes to flush routes |
| Tools appear but return no data | Verify the service account email is added as Viewer in GA4 and Full User in GSC |
rest_no_route on the /mcp endpoint |
Plugin isn't active, or permalinks need flushing — see above |
Health check URL: https://yoursite.com/wp-json/mcp/v1/health — should return {"status":"ok"} if the plugin is running correctly.
Установка WP Analytics
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/bradvin/wp-analytics-mcpFAQ
WP Analytics MCP бесплатный?
Да, WP Analytics MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для WP Analytics?
Нет, WP Analytics работает без API-ключей и переменных окружения.
WP Analytics — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить WP Analytics в Claude Desktop, Claude Code или Cursor?
Открой WP Analytics на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare WP Analytics with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
