npm @kozmos-tech/yourtrafficstdioMITupdated 1mo ago
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.
yourtraffic 能做什么?
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.
安装
把 yourtraffic 添加到你的客户端。选择你正在使用的那个。
claude mcp add yourtraffic -- npx -y @kozmos-tech/yourtrafficcodex mcp add yourtraffic -- npx -y @kozmos-tech/yourtrafficamp mcp add yourtraffic -- npx -y @kozmos-tech/yourtraffic{
"mcpServers": {
"yourtraffic": {
"command": "npx",
"args": [
"-y",
"@kozmos-tech/yourtraffic"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"yourtraffic": {
"command": "npx",
"args": [
"-y",
"@kozmos-tech/yourtraffic"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"yourtraffic","command":"npx","args":["-y","@kozmos-tech/yourtraffic"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"yourtraffic": {
"command": "npx",
"args": [
"-y",
"@kozmos-tech/yourtraffic"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"yourtraffic": {
"command": "npx",
"args": [
"-y",
"@kozmos-tech/yourtraffic"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"yourtraffic": {
"command": "npx",
"args": [
"-y",
"@kozmos-tech/yourtraffic"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"yourtraffic": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@kozmos-tech/yourtraffic"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"yourtraffic": {
"command": {
"path": "npx",
"args": [
"-y",
"@kozmos-tech/yourtraffic"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @kozmos-tech/yourtrafficRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
评分
39 / 100
不完整
- 文档22/25
- 维护16/25
- 可信度16/20
- 能力0/15
- 安装体验12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 43 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
版本历史
| 版本 | 发布于 |
|---|---|
| 0.1.1最新 | 2026年7月6日 |
| 0.1.0 | 2026年7月6日 |