Skip to main content
Glama
kozmos-tech

yourtraffic

by kozmos-tech

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 install

Copy the example env file and fill it in.

cp .env.example .env
  • DATABASE_URL. Your Postgres connection string. The app fails to start without it.

  • BETTER_AUTH_SECRET. A long random secret. Generate one with openssl rand -base64 32. Never ship the default, since visitor hashes are salted from it.

  • BETTER_AUTH_URL. The public origin of your deployment, like https://analytics.example.com. Use http://localhost:3000 in 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_ID and GOOGLE_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 add BETTER_AUTH_URL + /api/auth/callback/google as an authorized redirect URI. Leave them blank to hide the Google button.

Create the database tables before the first run.

npm run db:migrate

Run it

vc dev
open http://localhost:3000

Sign 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: Gizmo Analytics

Deploy

npm install
vc deploy

Set 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:migrate

Reading 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.

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Privacy friendly, cookieless web analytics built MCP-first. "Add analytics to my Next.js app" → an AI agent runs the setup_analytics_for_site tool, picks the right install snippet, edits your layout file, and verifies the script is loading. OAuth onboarding, no API keys to paste.
    Last updated
    28
    61
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Privacy-first web analytics. Query pageviews, referrers, trends, and AI insights.

  • Agent-operated web + product analytics. 79 tools + 14 prompts; answers provably match the dashboard.

  • Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kozmos-tech/yourtraffic'

If you have feedback or need assistance with the MCP directory API, please join our Discord server