io.github.kozmos-tech/yourtraffic
Open-source, privacy-first web analytics for tracking your sites' traffic.
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
@kozmos-tech/yourtrafficclaude mcp add yourtraffic -- npx -y @kozmos-tech/yourtraffic@0.1.1
{
"mcpServers": {
"yourtraffic": {
"command": "npx",
"args": [
"-y",
"@kozmos-tech/yourtraffic@0.1.1"
]
}
}
}
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
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 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: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.
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.
Questions fréquentes
Qu'est-ce que io.github.kozmos-tech/yourtraffic ?
Open-source, privacy-first web analytics for tracking your sites' traffic.
Comment installer io.github.kozmos-tech/yourtraffic ?
Il s'exécute sur votre machine. Dans Claude Code : claude mcp add yourtraffic -- npx -y @kozmos-tech/yourtraffic@0.1.1. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour io.github.kozmos-tech/yourtraffic ?
Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.
io.github.kozmos-tech/yourtraffic est-il open source ?
Oui. Son code est sur GitHub sous licence MIT.
Qui maintient io.github.kozmos-tech/yourtraffic ?
Il est publié par kozmos-tech. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.