{
  "markdown": "# StatHead\n\n**An open NFL fantasy-football analytics platform** — live data, machine-learned\nprojections, dynasty values, and prospect grades, served as a web app **and** as\nan [MCP](https://modelcontextprotocol.io) server you can plug straight into\nClaude or any AI client.\n\n- 🌐 **Web app** — [stathead.app](https://stathead.app)\n  ([QA mirror](https://dachhack.github.io/stathead/))\n- 🤖 **MCP server** — 30 NFL tools for AI projects → [`mcp/`](mcp/)\n- 🧠 **ML pipeline** — projection / dynasty-value / prospect models trained from\n  10+ seasons of data\n- 📦 **MIT-licensed code.** ⚠️ The **data** has its own terms —\n  see [`DATA_SOURCES.md`](DATA_SOURCES.md) before redistributing anything.\n\n---\n\n## Use it in your own AI project (MCP)\n\nThe fastest way to build on StatHead. No clone, no build:\n\n```bash\nnpx -y stathead-mcp\n```\n\n**Claude Code:**\n\n```bash\nclaude mcp add stathead -- npx -y stathead-mcp\n```\n\n**Claude Desktop** (`claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"stathead\": { \"command\": \"npx\", \"args\": [\"-y\", \"stathead-mcp\"] }\n  }\n}\n```\n\nThen ask things like *\"Compare Bijan Robinson's and Jahmyr Gibbs' weekly\nconsistency in 2024\"* or *\"Top 10 dynasty WRs by StatHead value, with their\nages.\"* Full tool list and configuration: [`mcp/README.md`](mcp/README.md).\n\n## Run the web app locally\n\n```bash\nnpm install\nnpm run dev          # Vite dev server\n```\n\nOther useful scripts:\n\n| Script | What it does |\n| --- | --- |\n| `npm run build` | Production build (semantic layer → features → tsc → vite → Pages post-build) |\n| `npm run build:mcp` | Bundle the MCP server → `mcp/dist/server.mjs` |\n| `npm run mcp` | Run the MCP server from source (`tsx`) |\n| `npm run lint` | ESLint |\n| `npm run data:local` | Download data sources for local work |\n\nThe repo is a TypeScript/React (Vite) front end plus a TypeScript + Python data\n& ML pipeline under [`scripts/`](scripts/) and [`python/`](python/). The same\ntool layer (`src/tools.ts` → `src/data.ts`) backs both the app and the MCP\nserver.\n\n## Data\n\nStatHead pulls from many upstreams — open data (nflverse, DynastyProcess, CFBD),\npublic APIs (Sleeper, ESPN, FantasyFootballCalculator), proprietary community\nvalues (KeepTradeCut, FantasyCalc), and derived features from paid scouting\nproducts. **Licensing varies a lot by source.**\n\n👉 **Read [`DATA_SOURCES.md`](DATA_SOURCES.md) before redistributing data,\npublishing a dataset, or shipping a commercial product.** The short version:\nshare the open sources and StatHead's own model outputs freely; fetch the rest\nfrom the original source under your own access rather than rebundling it.\n\n## Data proxies (self-hosting)\n\nLive KeepTradeCut, FantasyCalc, and ESPN data is fetched through small\nCloudflare Worker CORS proxies, because those upstream APIs block direct\nbrowser requests. The worker source lives under [`workers/`](workers/) and a\ndeploy workflow is in\n[`.github/workflows/deploy-workers.yml`](.github/workflows/deploy-workers.yml).\n\nBy default the app points at the upstream project's workers, so it works as\nsoon as you clone it. **If you deploy your own copy, stand up your own workers**\n(so you don't depend on — or get rate-limited by — someone else's) and override\nthe URLs via env vars. Copy [`.env.example`](.env.example) to `.env.local` and set:\n\n| Var | Proxies |\n| --- | --- |\n| `VITE_KTC_PROXY` | KeepTradeCut dynasty values (`workers/ktc-proxy`) |\n| `VITE_FC_PROXY` | FantasyCalc values (`workers/fc-proxy`) |\n| `VITE_ESPN_NEWS_PROXY` | ESPN player news/overview (`workers/espn-news-proxy`) |\n| `VITE_VISIT_TRACKER` | Visitor analytics beacon (`workers/visit-tracker`) |\n\nEach falls back to the project's worker when unset. Deploy a worker with\n`cd workers/<name> && npx wrangler deploy` (or use the deploy workflow).\n\n### Visitor analytics\n\nThe app sends a first-party, cookie-less pageview beacon per tab view to\n[`workers/visit-tracker`](workers/visit-tracker), which writes to Cloudflare\nWorkers Analytics Engine. No third parties, no identifiers stored in the\nbrowser, no raw IPs kept — visitors are counted with a daily-rotating\nanonymous hash, and Do Not Track / Global Privacy Control are honored.\nAggregates (daily views/visitors, top pages, referrers, countries) are served\nby the worker's `/stats` endpoint and a small dashboard at its root URL. See\nthe worker's header comment for the data layout and the one-time\n`CLOUDFLARE_ANALYTICS_API_TOKEN` setup.\n\n## Environments\n\nTwo deploy targets, fed by the same codebase:\n\n| Env | URL | Host | Base path | Trigger |\n| --- | --- | --- | --- | --- |\n| **QA** | `dachhack.github.io/stathead/` | GitHub Pages | `/stathead/` | push to the dev branch ([`deploy.yml`](.github/workflows/deploy.yml)) |\n| **Production** | `stathead.app` | Cloudflare Pages | `/` | push to `production` ([`deploy-prod.yml`](.github/workflows/deploy-prod.yml)) |\n\nThe base path is set by the `BASE_PATH` env var in\n[`vite.config.ts`](vite.config.ts) (default `/stathead/`); the prod\nworkflow builds with `BASE_PATH=/`. Everything in the app reads\n`import.meta.env.BASE_URL`, so that one switch repoints every asset and\ndata URL.\n\n**Promote QA → prod by merging the dev branch into `production`.** That\npush builds for the root domain and uploads to Cloudflare Pages. See the\nheader of [`deploy-prod.yml`](.github/workflows/deploy-prod.yml) for the\none-time Cloudflare Pages + DNS setup.\n\n## License\n\nCode is [MIT](LICENSE). Data is **not** covered by that license — see\n[`DATA_SOURCES.md`](DATA_SOURCES.md). The name \"Stathead\" may conflict with\n[Sports Reference's Stathead](https://stathead.com) trademark; see the note in\nthat file.\n",
  "bytes": 5618,
  "sha": "b0f6f83f9e36efa903b82325c156c501a3024a48a7198cba1407c7f205d538e2",
  "repo_slug": "dachhack/stathead",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_dachhack_stathead_mcp_2f1f14b1/readme"
}