
Yourtraffic
io.github.kozmos-tech由 GitHub 帳號 kozmos-tech 發布v0.1.1更新於 Oct 24, 2026
Open-source, privacy-first web analytics for tracking your sites' traffic.
概覽
讓助理透過受 OAuth 保護的 MCP 端點,讀取自架、隱私優先的網站分析部署中的流量統計資料。
- 可以做什麼
- YourTraffic 是一套開放原始碼、不使用 Cookie 的網站分析應用程式,同時提供原生 MCP 伺服器。助理連線到該部署的 /mcp 端點,透過 OAuth 登入授權後讀取該執行個體中所追蹤網站的統計資料。同樣的資料也可透過 /api/v1/stats 的 REST API,使用每個專案的 API 金鑰取得。它的定位是讀取分析資料,而不是管理網站本身。
- 適用情境
- 當你已經自架或打算自架 YourTraffic,並希望助理直接取得網站流量資料、不必從儀表板手動複製時使用。如果你沒有在運作 YourTraffic 執行個體,它就沒有用處,因為 MCP 端點位於你自己的部署上。
- 執行需求
- 需要一個助理可連線的自架 YourTraffic 部署,以及該部署本身的前置條件:Node 20 或更新版本、Vercel CLI 和一個 Postgres 資料庫。伺服器需要設定 DATABASE_URL、BETTER_AUTH_SECRET 和 BETTER_AUTH_URL,且 BETTER_AUTH_URL 必須是精確的公開來源網址,因為 MCP 用戶端會據此探索 OAuth。選用的 Google 登入需要 GOOGLE_CLIENT_ID 和 GOOGLE_CLIENT_SECRET。npm 套件透過 stdio 在本機執行,僅支援桌面端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Yourtraffic,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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.
Copy the example env file and fill it in.
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.
Run it
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
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.
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.
來源:README.md,提交 c50080e
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分