yourtraffic
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., "@yourtrafficshow me the stats for my main website"
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.
YourTraffic
Open-source, privacy-first web analytics. Unlimited websites, a first-class REST API and a native MCP server for agents. No cookies, no personal data, no consent banners.
Self-hosting
Prerequisites
Vercel CLI installed globally
A Postgres database
Node 20 or newer
Set up
Clone the repo and install dependencies.
git clone https://github.com/kozmos-tech/yourtraffic
cd yourtraffic
npm installCopy the example env file and fill it in.
cp .env.example .envDATABASE_URL. Your Postgres connection string. The app fails to start without it.BETTER_AUTH_SECRET. A long random secret. Generate one withopenssl rand -base64 32. Never ship the default, since visitor hashes are salted from it.BETTER_AUTH_URL. The public origin of your deployment, likehttps://analytics.example.com. Usehttp://localhost:3000in development. This is also the origin MCP clients discover for OAuth, so it must be the exact public URL with no trailing path.GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET. Optional. Set both to enable Google sign-in on the login and signup pages. Create OAuth credentials in the Google Cloud console and addBETTER_AUTH_URL+/api/auth/callback/googleas an authorized redirect URI. Leave them blank to hide the Google button.
Create the database tables before the first run.
npm run db:migrateRun it
vc dev
open http://localhost:3000Sign in, add a website, then drop the shown snippet into the <head> of your site. Stats appear within seconds of the first visit.
Related MCP server: GA4 MCP
Deploy
npm install
vc deploySet DATABASE_URL, BETTER_AUTH_SECRET and BETTER_AUTH_URL in your Vercel project settings, then run the migration against your production database.
Database
Schema lives in src/db/schema.ts. Generate a migration after changing it, then apply it.
npm run db:generate
npm run db:migrateReading your stats
Every project has an api key, shown under Settings in the dashboard.
REST API. Pass the key as a Bearer token to
/api/v1/stats. See llms.txt for the full guide.MCP server. Point an agent at
/mcp. It uses OAuth, so you sign in to approve access and no api key is needed.
This server cannot be deployed
Maintenance
Related MCP Connectors
Privacy-first cookieless web analytics with agent one-prompt setup via remote MCP OAuth.
Web and revenue analytics: traffic, goals, funnels, journeys and revenue by source. OAuth sign-in.
- cabinOAuthcom.withcabin
Privacy-first, cookie-free web analytics. Read stats and manage sites from your AI.
Privacy-first, cookie-free web analytics: create sites, install and verify tracking, read stats.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to access website analytics, including visitor sessions, UX friction, conversion funnels, and anomaly alerts.637 PyPIMIT
- FlicenseNot gradedqualityBmaintenanceEnables querying Google Analytics 4 properties, metadata, and reports—including realtime, overview, top pages, and traffic sources—through read-only per-user Google OAuth 2.1 authentication. It runs as its own OAuth resource/authorization server, keeping Google tokens encrypted and never exposed to the client.-
- AlicenseNot gradedqualityCmaintenanceEnables read-only access to cookieless web analytics aggregates such as sites, visitors, pages, sources, live activity, funnels, and uptime monitoring through OAuth 2.1-secured Streamable HTTP tools.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to query a privacy-focused analytics service for aggregate stats, breakdowns, realtime visitors, and time-series trends across cloud or self-hosted deployments. It also provides connectivity checks and guided analytics playbooks.8MIT