Pug MCP Server
Query events, funnels, retention and profiles in Pug product analytics, and build dashboards.
Pug scores 48 (Fair), licensed AGPL-3.0 and written in Go. It can be reached as a remote MCP endpoint. It does not declare tools yet. Filed under Databases, Web scraping. GitHub shows 120 stars. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.
Fair trust
48 of 100 from six public signals. Nobody can buy a point.
- OSI-style license: agpl-3.0.
License, quality and maintenance
License: Grade C
AGPL-3.0 is a strong copyleft license: derived works must use the same license.
How license is gradedQuality: Grade C
65/100 for listing completeness. Lost points: no listed tools, short summary.
How quality is graded
Where the 48 comes from
0 + 20 + 7 + 10 + 4 + 7 = 48. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 0 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 7 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "pug-sh-pug": { "url": "https://api.pug.sh/mcp" } }}
Environment variables
This server does not declare environment variables.
Tools
All capabilitiesTools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.
About
Pug
Pug is an open-source product analytics platform. Capture events, identify the people behind them, and explore behavior through funnels, retention, trends, segmentation, and user-flow analysis, all surfaced on customizable dashboards.
Built in Go on PostgreSQL, ClickHouse, and NATS.
Features
- Event ingestion: a NATS-backed capture pipeline with automatic geo, user-agent, bot-detection, and web-attribution enrichment.
- Web analytics: an overview auto-built from your events: visitors, sessions, pageviews, bounce rate, and traffic sources, with no tile to wire up.
- Live view: every visitor on a real-time world map, down to the person and the event they just fired.
- Profiles: identify and alias the users behind events, with a ClickHouse-backed profile and activity API.
- Insights: trends, funnels, retention, segmentation, user flow (Sankey), and top-K breakdowns, with filtering, breakdowns, and period-over-period comparison.
- Dashboards: compose insight and markdown tiles on a grid with a board-level time window, accelerated by a pre-aggregated rollup fast path.
- MCP server: Claude, ChatGPT, or any MCP client can query your insights, events, and profiles, and build dashboards for you.
- Privacy & compliance: GDPR/DPDP data-subject erasure of a person's events and profile.
MCP server
Pug serves a Model Context Protocol server, so an AI assistant can query your analytics. Sixteen tools read projects, dashboards, insights, events, sessions, and profiles, and one creates and edits dashboards.
| Environment | Endpoint |
|---|---|
| Pug Cloud | https://api.pug.sh/mcp |
| Self-hosted | /mcp on your API host, e.g. http://localhost:3000/mcp |
In Claude, add Pug from the connectors directory.
Other clients take the endpoint as a custom connector. Connect by signing in to
Pug, or with a project's private (prv_) API key in the x-api-key header. A
self-hosted server offers sign-in only once PUG_API_BASE_URL is set. Setup
steps for each client are in the MCP docs.
Tech stack
- Go: backend services and workers, exposed over Connect RPC (HTTP/2)
- PostgreSQL: relational store (orgs, projects, dashboards, auth)
- ClickHouse: analytical store for events, insights, and profiles
- NATS: messaging backbone for the ingestion and worker pipelines
Self-hosting
See the self-hosting guide. A Pug
instance is this repo's backend, published as container images on
ghcr.io/pug-sh, plus the dashboard from
pug-sh/app, served as static files.
Quick start
# Build the binary into bin/pug
make build
# Start dev infrastructure (PostgreSQL, NATS, ClickHouse)
make infra
# Run migrations (Postgres, NATS, ClickHouse)
./bin/pug migrate
# Seed the demo project with events, profiles, and dashboards
# (resets the local Postgres and ClickHouse databases; see "Demo data" below)
./bin/pug seed
# Start the dev server + workers together
./bin/pug dev
docs/development.md walks through each step, including
signing in as the demo org's admin.
Environment variables are documented in .env.example.
Google and generic OIDC sign-in are documented in
docs/authentication.md, with a ready-to-copy
config.example.json.
Demo data
./bin/pug seed fills a "Pug & Pals" demo project with ~6 months of history, so
dashboards, insights, and profiles have something to show. Profiles are seeded
only for users that produced events, so the data is internally consistent.
Local databases only. By default
seedmigrates Postgres and ClickHouse all the way down and back up, dropping every table, not just the demo rows. There is no confirmation prompt and no environment check: it connects to whateverDATABASE_URLandCLICKHOUSE_URLresolve to, and an already exported variable beats.env. Point it at a disposable local or demo database.
Pass --no-reset to keep the schema; it then deletes the demo project's own
events and profiles before re-seeding them, leaving other projects untouched.
Volume is tunable with --count (default 500,000 events) and --batch (default
10,000 events per insert). Run it from the repo root; it reads the same .env
as the rest of the CLI.
Two read-only accounts are seeded, plus an admin if you ask for one:
woof@pug.showns the demo org and its data. It has no password.snoop@pug.shis a viewer with no password; open/demowithPUG_DEMO_ENABLED=trueto sign in as it.admin@pug.exampleis the demo org's admin, seeded only whenPUG_DEMO_ADMIN_PASSWORDis set (16 characters to 72 bytes, no surrounding whitespace), with that password. The address can't receive mail. Nothing logs the password, and later runs never change it, so change it in the dashboard, to 16 characters or more, and update the variable to match, since the seeder restores the admin's role only while they match. A defaultpug seedresets the database, though, and so recreates the admin from the current value.
For a live stream of traffic instead of a one-shot backfill, set
PUG_DEMO_ENABLED=true: ./bin/pug dev then also runs the demo worker. It
backfills an empty project once, so after pug seed it skips straight to
playing new sessions out in real time. If you seed with a smaller --count,
lower PUG_DEMO_SEED_COUNT to match: the worker reads a project holding fewer
events than that as an interrupted backfill and warns rather than topping it up.
Development
make test # run tests (race detector enabled)
make cover # run tests and write coverage.out
make lint # lint Go code
make sqlc # regenerate sqlc queries after editing SQL
make rpc # regenerate protobuf code after editing .proto files
make templ # regenerate templ email templates
Architecture
Per-subsystem documentation lives in docs/architecture/
(insights, ClickHouse, profiles, ingestion, email, telemetry). Contributor
guidance and conventions are in CLAUDE.md.
License
Copyright (C) 2025 pug.sh contributors.
Pug is licensed under the GNU AGPL v3.0, or (at your option) any later version. Contributors sign a CLA before their first pull request is merged; see CONTRIBUTING.md.
Frequently asked questions
What is Pug MCP Server?
Query events, funnels, retention and profiles in Pug product analytics, and build dashboards.
How do I install Pug MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. Pug MCP Server connects to the remote endpoint https://api.pug.sh/mcp, so there is nothing to install locally.
Is Pug MCP Server free and open source?
Yes. Pug MCP Server is released under the AGPL-3.0 license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does Pug MCP Server support remote (HTTP) connections?
Yes. Pug MCP Server offers a hosted endpoint over Streamable HTTP, so HTTP-capable clients can connect to it without running anything locally.
How is Pug MCP Server's trust score calculated?
Pug MCP Server scores 48 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.