mcp-marketing-analytics
Integrates with Google Ads, supporting raw GAQL queries, campaign performance, keyword performance with quality score, ad group metrics, and account summary with top campaigns.
Provides tools for interacting with Google Analytics 4, including listing accounts, running custom reports, retrieving real-time data, top pages, traffic sources, and user metrics with period-over-period comparison.
Offers tools for Google Search Console, such as listing sites, executing search analytics queries, retrieving top queries and top pages, inspecting URL indexing status, and listing sitemaps.
Enables access to Meta Ads data, with tools to list ad accounts, view account-level spend/performance, and drill into campaign, ad set, and individual ad metrics.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-marketing-analytics Show me my top pages for the last 30 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Marketing Analytics MCP Server
A Model Context Protocol (MCP) server that gives Claude access to Google Analytics 4, Google Search Console, Meta Ads, and Google Ads. Ask Claude about your marketing data in natural language.
Tools (23 total)
Setup
Tool | Description |
| Step-by-step setup instructions — shows what's configured and guides you through any missing API credentials |
Google Analytics 4 (6 tools)
Tool | Description |
| List all GA4 properties accessible to your Google account |
| Run a custom report with any dimensions/metrics |
| See active users right now |
| Most viewed pages |
| Traffic by source/medium |
| Summary with optional period-over-period comparison |
Google Search Console (6 tools)
Tool | Description |
| List all Search Console sites you have access to |
| Flexible search analytics query |
| Top search queries by clicks |
| Top pages in search results |
| Check indexing status of any URL |
| List submitted sitemaps |
Meta Ads (5 tools)
Tool | Description |
| List accessible ad accounts |
| Account-level spend/performance |
| Campaign metrics |
| Ad set metrics |
| Individual ad metrics |
Google Ads (5 tools)
Tool | Description |
| Execute raw GAQL queries |
| Campaign performance metrics |
| Keyword metrics + quality score |
| Ad group metrics |
| Account totals + top campaigns |
Related MCP server: google-search-console
Quick Start
1. Clone and build
git clone https://github.com/YOUR_USERNAME/mcp-marketing-analytics.git
cd mcp-marketing-analytics
npm install
npm run build2. Get your credentials
Run the interactive setup wizard:
npm run setupOr manually create a .env file (see .env.example).
Google APIs (GA4 + Search Console + Google Ads)
Go to Google Cloud Console
Create a project and enable:
Google Analytics Data API
Google Analytics Admin API
Google Search Console API
Google Ads API (optional)
Create OAuth 2.0 Client ID (Web application type)
Add
http://localhost:3847/callbackas an Authorized redirect URIRun
npm run setupto complete the OAuth flow and get your refresh token
Meta Ads (optional)
Go to Meta Graph API Explorer
Generate a token with
ads_readpermissionExchange for a long-lived token (60-day expiry)
Google Ads (optional)
Create a Manager Account
Get a Developer Token from Tools & Settings → API Center
Note your Customer Account ID (10 digits)
3. Add to Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (Mac):
{
"mcpServers": {
"marketing-analytics": {
"command": "node",
"args": ["/absolute/path/to/mcp-marketing-analytics/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}4. Add to Claude Code
claude mcp add marketing-analytics -- node "/absolute/path/to/mcp-marketing-analytics/dist/index.js"5. Restart Claude and start asking
"List my GA4 properties"
"Show me top pages for the last 30 days"
"What are my top search queries on Google?"
"How are my Meta ad campaigns performing?"
"Compare this month's traffic to last month"
Configuration
All API credentials are passed via environment variables. Only configure the APIs you need — unconfigured APIs will show a helpful message instead of crashing.
Variable | Required | Description |
| For Google APIs | OAuth 2.0 Client ID |
| For Google APIs | OAuth 2.0 Client Secret |
| For Google APIs | OAuth 2.0 Refresh Token |
| No | Default GA4 property (can be set per-request) |
| No | Default GSC site (can be set per-request) |
| For Meta Ads | Long-lived access token |
| No | For app secret proof |
| No | For app secret proof |
| For Google Ads | From API Center |
| For Google Ads | 10-digit account ID |
| No | MCC manager account ID |
Multi-Account Support
You don't need to hardcode property IDs or site URLs. Use the discovery tools:
ga4_list_accounts→ shows all GA4 properties you can accessgsc_list_sites→ shows all Search Console sites you can accessPass
propertyIdorsiteUrlto any tool to query a specific account
License
MIT
Available Tools
23 toolsga4_list_accountsA
List all GA4 properties accessible to the authenticated Google account. Use this to discover Property IDs for use with other ga4_* tools.
Inputs: no named parameters.
ga4_realtime_reportA
Get a realtime GA4 report showing current active users and activity from the last 30 minutes.
Inputs: limit, metrics, dimensions, propertyId.
ga4_run_reportA
Run a custom GA4 report with specified dimensions, metrics, and date range. Use GA4 API names like 'activeUsers', 'sessions', 'pagePath', 'sessionSource'. Dates: YYYY-MM-DD or relative like '7daysAgo', '30daysAgo', 'today', 'yesterday'.
Inputs: metrics (required), dimensions (required), limit, endDate, +5 more.
ga4_top_pagesA
Get the top pages by views for the specified date range. Returns page path, title, views, users, and average session duration.
Inputs: limit, endDate, startDate, propertyId.
ga4_traffic_sourcesA
Get traffic source breakdown showing sessions, users, and engagement by source/medium for the specified date range.
Inputs: limit, endDate, startDate, propertyId.
ga4_user_metricsA
Get a summary of key user metrics: total users, new users, sessions, page views, bounce rate, avg session duration, and engagement rate. Optionally compare with the previous period.
Inputs: endDate, startDate, propertyId, comparePreviousPeriod.
gads_account_summaryA
Get a high-level summary of the Google Ads account: total spend, clicks, impressions, conversions, and key averages, plus top 5 campaigns by spend.
Inputs: dateRange.
gads_ad_group_performanceA
Get performance metrics for Google Ads ad groups: impressions, clicks, cost, conversions grouped by ad group within campaigns.
Inputs: limit, orderBy, dateRange, campaignName.
gads_campaign_performanceB
Get performance metrics for Google Ads campaigns: impressions, clicks, cost, conversions, CTR, CPC, and conversion rate.
Inputs: limit, status, orderBy, dateRange, +1 more.
gads_keyword_performanceB
Get performance metrics for Google Ads keywords: search term, match type, clicks, impressions, cost, conversions, and quality score.
Inputs: limit, orderBy, dateRange, campaignName.
gads_queryA
Execute a raw Google Ads Query Language (GAQL) query. Use for custom queries not covered by other tools. Example: SELECT campaign.name, metrics.clicks FROM campaign WHERE segments.date DURING LAST_30_DAYS
Inputs: query (required).
gsc_inspect_urlA
Inspect a URL to see its Google indexing status, crawl info, mobile usability, and any issues. Useful for debugging why a page isn't appearing in search.
Inputs: url (required), siteUrl.
gsc_list_sitemapsA
List all sitemaps submitted for the site, including their status, last download date, and number of URLs submitted/indexed.
Inputs: siteUrl.
gsc_list_sitesA
List all Search Console sites/properties accessible to the authenticated Google account. Use this to discover Site URLs for use with other gsc_* tools.
Inputs: no named parameters.
gsc_search_analyticsC
Query Google Search Console search analytics data with flexible dimensions and filters. Returns clicks, impressions, CTR, and average position.
Inputs: endDate (required), startDate (required), siteUrl, rowLimit, +5 more.
gsc_top_pagesA
Get the top pages appearing in Google Search results, sorted by clicks. Shows page URL, clicks, impressions, CTR, and average position.
Inputs: endDate (required), startDate (required), limit, siteUrl, +1 more.
gsc_top_queriesA
Get the top search queries driving traffic to your site, sorted by clicks. Shows query, clicks, impressions, CTR, and average position.
Inputs: endDate (required), startDate (required), limit, siteUrl, +1 more.
meta_account_overviewA
Get a high-level performance overview for a Meta ad account: total spend, impressions, clicks, CTR, CPC, CPM, and conversions for the specified date range. Optionally break down by age, gender, country, placement, or device.
Inputs: endDate (required), accountId (required), startDate (required), breakdown.
meta_ad_insightsA
Get performance insights for individual ads. Shows each ad's name, ad set, campaign, spend, impressions, clicks, and conversions.
Inputs: endDate (required), accountId (required), startDate (required), limit, +2 more.
meta_adset_insightsA
Get performance insights for ad sets within a campaign or account. Shows spend, impressions, clicks, and conversions per ad set.
Inputs: endDate (required), accountId (required), startDate (required), limit, +1 more.
meta_campaign_insightsA
Get performance insights for all campaigns in a Meta ad account. Shows each campaign's spend, impressions, clicks, CTR, CPC, and conversions.
Inputs: endDate (required), accountId (required), startDate (required), limit, +1 more.
meta_list_ad_accountsC
List all Meta/Facebook ad accounts accessible with the current access token. Returns account ID, name, status, currency, and timezone.
Inputs: limit.
setup_guideA
Get step-by-step instructions for configuring the Marketing Analytics MCP server. Shows which APIs are configured and provides detailed setup guides for any that are missing.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Tools are clearly organized by platform prefixes (ga4_, gsc_, meta_, gads_), and each tool targets a distinct resource or action. There is minor overlap within platforms (e.g., ga4_top_pages vs. ga4_run_report, gsc_top_pages vs. gsc_search_analytics), but descriptions clarify when to use each.
Names follow a strong platform-prefix convention (ga4_, gsc_, meta_, gads_) which aids navigation. Within each platform, naming is mostly descriptive noun phrases (e.g., ga4_top_pages, meta_campaign_insights) with some verbs (list, run, inspect), creating minor inconsistency but no chaos.
23 tools is on the heavy side, but appropriate for a multi-platform analytics server covering four distinct services (GA4, Search Console, Meta Ads, Google Ads). Each platform receives a focused set of 5-6 tools, making the count reasonable for the scope.
The tool set provides solid read-only coverage across all four platforms: account discovery, standard reports, custom queries, and granular insights. Some advanced features (e.g., GA4 event diagnostics, Meta ad creative details) are absent, but core analytics workflows are well supported.
Maintenance
Related MCP Connectors
Read-only Google Ads, GA4 and Search Console data for Claude, with no Google Cloud setup.
GA4, Google Ads and Search Console in Claude. Read-only OAuth, multi-account for agencies.
Live Google Ads, GA4, Search Console, Meta Ads and GBP data in Claude, ChatGPT and any MCP client
Ask Claude about your ads: Meta, Google, TikTok, LinkedIn, GA4 & Shopify. No AI credits.
Related MCP Servers
- AlicenseAqualityBmaintenanceConnects Google Analytics 4 data to Claude, Cursor and other MCP clients, enabling natural language queries of website traffic, user behavior, and analytics data with access to 200+ GA4 dimensions and metrics.122,370 PyPI244MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying Google Search Console data, including search analytics, indexing status, and sitemap management, through natural language conversations with Claude.153 npm6MIT
- FlicenseNot gradedqualityDmaintenanceEnables interactive Google Analytics 4 visualizations inside Claude conversations, supporting ad-hoc queries with line, bar, pie charts and data tables.-

OQVA Marketing MCPofficial
AlicenseAqualityCmaintenanceConnect Claude to your marketing data from Google and Meta, enabling read and write operations on Search Console, Analytics, Tag Manager, Business Profile, and Meta platforms.351Apache 2.0