Skip to main content
Glama
NFL Analytics MCP

NFL Analytics MCP

by parthakker

🏈 NFL Analytics

A personal NFL analytics platform that runs entirely on your machine: a DuckDB warehouse of every NFL play since 1999, a dark token-themed web app ("Jarvis"), auto-updating data and news, a prediction-market tracker, and an AI analyst wired in through MCP. Questions get answered by running SQL against real data β€” computed answers, not vibes.

No API keys. No subscriptions for the core experience. One ~2 GB download.

CI

What's inside

Piece

What it does

Warehouse (nfl.duckdb)

1.28M plays 1999–2025, schedules with odds through 2026, player/team stats across the v1/v2 nflverse eras, advanced stats, NGS, snap counts, depth charts, personnel/participation, FTN charting, combine, ESPN QBR β€” plus curated venue coordinates powering true travel distances

Jarvis web app (web/)

FastAPI + React SPA: team HUDs, matchup cards (travel/rest/refs/coach-H2H/weather/market for any game 1999β†’upcoming), all-time H2H explorer, coaches with scheme fingerprints, referee intel, betting board (Vegas-vs-Kalshi dislocations), news, and a 16-chapter football Knowledge book

Derived views

SQL views for the common questions: team-game workhorse with haversine travel miles, H2H series with relocations merged, referee tendencies 1999+, coach PROE/4th-down aggression, one unified weather answer per game

News engine (news.duckdb)

ESPN + team feeds polled 6-hourly, categorized, player-tagged by gsis_id, full-text searchable

Kalshi tracker (kalshi.duckdb)

Market snapshots 6-hourly + Vegas line history per game

Prediction model

Trained, validated and surfaced on its own Model Lab page (/model: this week's model-vs-market with per-input reasons, report card, power ratings, experiment log) plus a seconds-fast nfl experiment loop. Betting surfaces stay market-vs-market β€” the model loses to the market on the holdout and says so

MCP server

Tools (query_warehouse, betting_board, coach_profile, referee_stats, news_search…) exposing all of it to Claude

Legacy dashboard (legacy/)

The original Streamlit UI, kept for friends β€” frozen

Related MCP server: Feyod MCP Server

Architecture

nflverse releases ──► scripts/refresh_data.py ──► data/*.csv
                                 β”‚
              Open-Meteo ──► fetch_weather.py
                                 β”‚
        build_warehouse.py ──► nfl.duckdb ◄── build_views.py (views, venues, macros)
                                 β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚                           β”‚                          β”‚
 MCP server              FastAPI (web/api)        pytest invariants (tests/)
     β”‚                           β”‚
  Claude Code            React SPA (web/ui) ── Playwright e2e
                                 β”‚
              kalshi.duckdb ── news.duckdb (sidecars, 6h pollers)

Five Windows Task Scheduler jobs keep it fresh: weekly data refresh, 6-hourly news + Kalshi pollers, a daily smoke test, and a nightly headless Claude health check that audits the data and runs the test suite.

Quick start

See SETUP.md. Short version:

git clone https://github.com/parthakker/nfl-analytics && cd nfl-analytics
uv sync --extra dev                               # or: pip install -e ".[dev]"
python -m nfl_analytics.cli refresh --bootstrap   # ~2 GB nflverse download
cd web/ui && npm ci && npm run build && cd ../..
python web/run_web.py                             # Jarvis on http://localhost:8000

Testing

Three pytest tiers: tests/unit (no database), tests/warehouse (invariants against the real DB β€” travel distances, H2H symmetry, venue resolution, era continuity), tests/api (contract tests for every endpoint). CI runs the unit tier plus warehouse/api against committed ~24 MB fixture databases (nfl fixture rebuilds them). Playwright e2e (web/ui/e2e/) runs locally against the real server: npm run e2e.

Design principles

  • Compute, don't retrieve β€” every answer is SQL with its filters cited.

  • Hand-curated where sources are wrong β€” data/stadiums.json fixes venues nflverse mislabels (all seven 2025 international games); curated files are version-controlled and never overwritten by refreshes.

  • Verification built in β€” row floors and sanity checks in the build, invariant tests in CI, a smoke test and an AI health check β€” both run by hand from the /ops page; nothing is scheduled.

  • Keep it simple β€” one machine, no cloud dependencies, boring tools.

Data credits

nflverse (play-by-play, stats, rosters), nfldata (schedules + odds), Open-Meteo (weather), ESPN (news, QBR), Kalshi (market data). MIT licensed; the data belongs to its sources.

Available Tools

19 tools
betting_boardC

Upcoming games: Vegas lines vs live Kalshi prices with dislocation flags (market-vs-market, fee-adjusted) and situational angles.

Inputs: week.

coach_profileC

Head coach career: records, playoffs, ATS, 4th-down aggressiveness, pass-rate-over-expected, scheme identity (curated), rivalry records.

Inputs: name (required).

data_statusA

Coverage and staleness: latest season/week per core table, last refresh-log lines, and whether a refresh looks needed.

Inputs: no named parameters.

describe_warehouseA

List tables/views (no arg) or show one table's columns plus the relevant data-dictionary notes (gotchas, join keys, conventions).

Inputs: table.

kalshi_market_detailB

One market's full picture: current prices, top-of-book depth, implied probability at bid/mid/ask, spread width, and estimated fee.

Inputs: ticker (required).

kalshi_marketsA

Open Kalshi NFL markets. kind: game | spread | total | win_totals | superbowl. Optional team filter (canonical code, e.g. DET). Prices are probabilities in dollars (0.64 = 64c = 64% implied).

Inputs: kind, team.

kalshi_price_historyC

Recorded price history for one market from accumulated snapshots.

Inputs: ticker (required).

kalshi_snapshot_nowA

Record a price snapshot of ALL open NFL markets into kalshi.duckdb (adds to line-movement history). Also runs on the 6h schedule.

Inputs: no named parameters.

league_newsA

Latest league headlines (optionally filtered to one team) from the polled ESPN news feed.

Inputs: days, team.

model_reportB

Backtest summary and the honest verdict from the last training run.

Inputs: no named parameters.

player_lookupA

Find a player (name substring or gsis_id), return id bridge, bio, and recent season stat lines from the cross-era weekly view.

Inputs: name_or_id (required), season.

player_newsA

Recent news and injury-report entries for a player (name or gsis_id), from the polled ESPN feeds in news.duckdb.

Inputs: name_or_id (required), days.

power_ratingsC

Current model power ratings for all teams (EPA/play units; ratings entering the next game). net = mean(off) - mean(def); lower def is better.

Inputs: top.

predict_gameA

Model prediction for a matchup: home win probability, predicted margin, feature inputs. Uses schedule rest days if the game is scheduled; attaches the market line when available. Early-season caveat applies (weeks 1-3).

Inputs: away_team (required), home_team (required).

query_warehouseA

Run a read-only SELECT against the NFL warehouse (DuckDB). Multiple statements are rejected. See describe_warehouse for tables and gotchas.

Inputs: sql (required), max_rows.

referee_statsA

Head referee tendencies 2015+: penalties/game, home penalty bias, over rate, home win/cover rates. Empty name = all refs ranked.

Inputs: name.

refresh_dataA

Download latest nflverse data and rebuild the warehouse (~1-2 min). Runs as a subprocess so the server holds no DB handle during rebuild.

Inputs: full.

team_formB

Team record, EPA splits (season-to-date and last 5 games), rest/travel profile, and next scheduled game. through_week=0 means whole season.

Inputs: team (required), season (required), through_week.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 19 tools

    Disambiguation5/5

    Every tool targets a distinct resource and action: player vs team vs game vs market vs warehouse. Even the news trio is separated by scope, and the kalshi quartet clearly separates listing, detail, snapshot, and history.

    Naming Consistency3/5

    Tool names mix conventions: some are verb-first (predict_game, refresh_data, query_warehouse, describe_warehouse), others are noun-first (team_form, player_lookup, kalshi_markets). The kalshi_ prefix provides local consistency, but the overall pattern is not uniform.

    Tool Count4/5

    With 19 tools, the server is slightly above the ideal 3-15 range, but the comprehensive scopeβ€”data ingestion, analytics, news, betting markets, and model reportingβ€”justifies the count. Each tool earns its place.

    Completeness5/5

    The tool surface covers the full lifecycle: data refresh and status, warehouse querying and schema discovery, player/team/coach/referee analytics, news search, betting market analysis, and model prediction/reporting. No obvious dead ends or missing key operations.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that provides access to over 12 years of NFL play-by-play data through a local DuckDB database. It enables users to query player performance, team statistics, and situational efficiency metrics like EPA and WPA using natural language.
      29 PyPI
      9
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables natural-language querying of historical NBA game data from a read-only SQLite database.
      ISC
    • A
      license
      C
      quality
      B
      maintenance
      Enables querying and replaying deterministic market data for crypto and US equities from a local Parquet lake via natural language.
      57
      4
      Apache 2.0