npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ga4-mcp

v1.0.1

Published

GA4 + Google Search Console MCP server for Claude, Copilot, Cursor, Codex, Gemini, and any MCP-compatible AI agent.

Downloads

295

Readme

ga4-mcp

npm version npm downloads License: MIT

GA4 + Google Search Console MCP server. Works with Claude, Copilot, Cursor, Codex, Gemini, and any MCP-compatible AI agent.

16 tools for Google Analytics 4, Search Console, and the Indexing API — run reports, inspect URLs, submit sitemaps, manage properties, and request indexing, all from your AI agent.

Quick Start

npx -y ga4-mcp

Or install globally for faster startup:

npm install -g ga4-mcp
ga4-mcp

Prerequisites

Authenticate with Google (includes all required scopes):

gcloud auth application-default login \
  --scopes="https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/analytics.edit,https://www.googleapis.com/auth/webmasters,https://www.googleapis.com/auth/indexing"

Or set GOOGLE_APPLICATION_CREDENTIALS to a service account JSON key file.

Agent Configuration

Claude Code

{
  "mcpServers": {
    "ga4-analytics": {
      "command": "npx",
      "args": ["-y", "ga4-mcp"]
    }
  }
}

Cursor / Windsurf / Continue

Add to .cursor/mcp.json or equivalent:

{
  "mcpServers": {
    "ga4-analytics": {
      "command": "npx",
      "args": ["-y", "ga4-mcp"]
    }
  }
}

Load only specific tool groups

{
  "mcpServers": {
    "ga4-analytics": {
      "command": "npx",
      "args": ["-y", "ga4-mcp", "--tools", "ga4,gsc"]
    }
  }
}

CLI Options

ga4-mcp [options]

--tools <groups>     Tool groups to enable: ga4, gsc, indexing, admin, all (default: all)
                     "ga4" = read-only analytics. "admin" = write/delete mega-tool.
--transport <type>   Transport: stdio (default) or http (Streamable HTTP)
--port <number>      HTTP port (default: 3000)
--version            Show version
--help               Show help

Environment variables: GA4_MCP_TOOLS, GA4_MCP_TRANSPORT, GA4_MCP_PORT

Tools (16 total)

Utility (1 tool)

| Tool | Description | |------|-------------| | ping | Health check — returns pong (always registered) |

GA4 Analytics (6 tools) — group: ga4

| Tool | Description | |------|-------------| | get_account_summaries | List all GA4 accounts and properties | | get_property_details | Property details (name, timezone, currency) | | run_report | Run GA4 Data API reports | | run_realtime_report | Run GA4 realtime reports | | get_custom_dimensions_and_metrics | Custom dimensions and metrics | | list_google_ads_links | Google Ads links for a property |

GA4 Admin (1 mega-tool, 14 actions) — group: admin

| Tool | Description | |------|-------------| | ga4_admin | Create/update/delete properties, streams, key events, audiences |

Google Search Console (6 tools) — group: gsc

| Tool | Description | |------|-------------| | gsc_list_sites | List all GSC properties | | gsc_search_analytics | Query search analytics (impressions, clicks, CTR, position) | | gsc_inspect_url | URL inspection (index status, crawl info, mobile usability) | | gsc_list_sitemaps | List submitted sitemaps | | gsc_add_site | Add a site to GSC | | gsc_submit_sitemap | Submit a sitemap |

Indexing API (2 tools) — group: indexing

| Tool | Description | |------|-------------| | indexing_notify | Notify Google to crawl/remove a URL | | indexing_status | Check notification status for a URL |

License

MIT