Yourtraffic

io.github.kozmos-techPublished by GitHub account kozmos-techv0.1.1Updated Oct 24, 2026

Open-source, privacy-first web analytics for tracking your sites' traffic.

VerifiedSTDIODesktop onlyDeveloper ToolsData & Analytics

Overview

AI-generated overview

Lets an assistant read traffic statistics from a self-hosted, privacy-first web analytics deployment over an OAuth-protected MCP endpoint.

What you can do
YourTraffic is an open-source, cookie-free web analytics application that also exposes a native MCP server. Agents connect to the deployment's /mcp endpoint and use OAuth sign-in to read stats for the sites tracked in that instance. The same data is also reachable through a REST API at /api/v1/stats using a per-project API key. It is aimed at reading analytics rather than managing the sites themselves.
When to use it
Use it when you already run or plan to self-host YourTraffic and want an assistant to pull traffic numbers for your sites without copying them out of the dashboard. It is not useful if you do not operate a YourTraffic instance, since the MCP endpoint lives on your own deployment.
Requirements
A self-hosted YourTraffic deployment reachable by the agent, plus the deployment's own prerequisites: Node 20 or newer, the Vercel CLI, and a Postgres database. The server needs DATABASE_URL, BETTER_AUTH_SECRET and BETTER_AUTH_URL configured, and BETTER_AUTH_URL must be the exact public origin because MCP clients discover OAuth from it. Optional Google sign-in needs GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET. The npm package runs locally over stdio and is desktop-only.
Before you install
The MCP endpoint uses OAuth, so approving an agent grants it access to your analytics data; review which client you authorize. BETTER_AUTH_SECRET salts visitor hashes, so a weak or default value weakens privacy and should never be shipped as-is. DATABASE_URL is a full Postgres connection string and is a credential. Google OAuth credentials are optional but are secrets if enabled. The README notes no cookies and no personal data are collected.

Installation

In SourceWeft

  1. Open Yourtraffic in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

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/yourtrafficcd yourtrafficnpm 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 devopen 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.

Deploy

npm installvc 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:generatenpm 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.

Source: README.md at commit c50080e

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.1LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts