euroleague-open-data
This server provides natural-language access to a EuroLeague/EuroCup basketball data warehouse, enabling player/team search, advanced stats, fantasy draft tools, game/shot analysis, and ad‑hoc SQL queries.
Player Lookup & Stats
search_players– fuzzy name search to get canonical IDs.get_player_stats– season/career totals, per-game, per‑36, true shooting%, eFG%, usage%.get_player_fantasy_log– game‑by‑game fantasy points to assess form and role changes.get_shot_chart– shot‑zone aggregates, with optional raw x/y coordinates (from 2007 on).
Team Stats & Game Data
search_teams– partial name/sponsor-rename search for team IDs.get_team_stats– offensive/defensive ratings and Four Factors.get_game_boxscore– full boxscore with completeness flags.
Coaching & Roster Analysis
get_coach_rotation– minute distribution and rotation depth.get_role_outlook– vacated minutes/production by position.get_transfers– announced squad changes.get_squad_outlook– club’s coming‑season view with minutes freed/claimed.
Fantasy Draft Tools
get_draft_board– ranks by value over replacement, tailored to league settings.plan_snake_draft– plans picks based on your slot and draft order.compare_draft_candidates– head‑to‑head comparison for a pick decision.
Advanced & Escape Hatch
run_sql– read‑only SELECT queries against the DuckDB warehouse for any unanticipated question.Resources (
euroleague://schema,coverage,data-quality) – understand data completeness and known limitations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@euroleague-open-data Who had the best true shooting percentage in EuroLeague last season, minimum 20 games?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
euroleague-open-data
An open EuroLeague / EuroCup basketball data warehouse, and an MCP server that lets an LLM query it in natural language.
Unofficial. Not affiliated with, endorsed by, or approved by Euroleague Basketball. Data originates from Euroleague Basketball and is retrieved from publicly accessible endpoints. For research and educational use. See DISCLAIMER.md.
Why this exists
The upstream EuroLeague API is undocumented, unversioned, and rate-limited at roughly 10 requests per minute by Cloudflare. That makes it unusable for interactive analysis: three questions in a row from one user would black out everyone else for five minutes.
So this project inverts the problem. A slow, polite, resumable crawler pulls the data into a local DuckDB warehouse once. Everything else — the MCP server, the Parquet exports — reads that snapshot.
The MCP server never contacts upstream. It holds no HTTP client. No amount of traffic to this project can generate load on Euroleague Basketball's infrastructure.
Related MCP server: College Basketball Stats MCP Server
Status
Four seasons loaded: EuroLeague E2024 and E2025, EuroCup U2024 and U2025. Plus the announced 2026-27 EuroLeague squads, so the draft tools work before a game has been played.
Component | State |
Throttled crawler with permanent cache | working |
DuckDB warehouse, 8 base tables | working |
Validation suite, 8 reconciliation checks | working |
Derived analytics (TS%, eFG%, usage, Four Factors, shot zones) | working |
MCP server, stdio transport, 15 tools + 3 resources | working |
HTTP transport + landing page, Docker image build-tested | working |
Public deployment on Render (free instance, sleeps when idle) | live |
Full backfill (52 seasons, 12 122 games) | not started, ~50h of crawling |
Dataset publishing to GitHub Releases / HuggingFace | not started |
Quick start
Requires uv and Python 3.12+.
git clone https://github.com/McNews11/euroleague-open-data && cd euroleague-open-data
uv sync --extra etl--extra etl pulls in the crawler's dependencies. Plain uv sync installs only what is
needed to serve an existing warehouse, which is what the deployed image does — it keeps
polars, pyarrow and httpx out of the container and halves its size.
Build the warehouse. The crawl is deliberately slow — about two hours for one season — and it is safe to interrupt and rerun, because every response is cached permanently.
uv run euroleague-etl --season E2025Already have the cache and only changed the schema? Skip the network entirely:
uv run euroleague-etl --season E2025 --skip-crawlConnect it to Claude
Claude Code
claude mcp add euroleague --env EUROLEAGUE_DB=$PWD/data/euroleague.duckdb -- $PWD/.venv/bin/python -m euroleague_open_data.mcp_serverRemote, for sharing with other people
A hosted deployment serves the same tools over HTTPS, so anyone can connect by URL with nothing installed — and it is the only way to use this from ChatGPT, which cannot run local MCP servers.
claude mcp add --transport http euroleague https://euroleague-open-data.onrender.com/mcpIt runs on a free instance that sleeps after 15 minutes idle, so the first request after a
quiet spell takes about a minute. Everything after it is fast. To host your own, see
docs/DEPLOY.md — the landing page at / fills in whatever hostname it
is served from, so a fork needs no edit.
Note that ChatGPT custom connectors require a paid plan (Plus, Pro, Business, Enterprise or Edu) with Developer mode enabled. Claude Code and Claude Desktop work on any plan.
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"euroleague": {
"command": "/absolute/path/to/euroleague-open-data/.venv/bin/python",
"args": ["-m", "euroleague_open_data.mcp_server"],
"env": {
"EUROLEAGUE_DB": "/absolute/path/to/euroleague-open-data/data/euroleague.duckdb"
}
}
}
}Things to ask it
Who had the best true shooting percentage in EuroLeague last season, minimum 20 games?
Compare Vezenkov and Nwora on efficiency and usage.
Which team had the best defensive rating, and which Four Factor drove it?
Show me Micic's shot chart by zone.
Which games are unreliable for lineup analysis?
Who changed clubs this summer, and which of them scored well last season?That last one matters. The warehouse tracks its own completeness, so the model can say "this game has no shot data" instead of inventing a number.
Fantasy drafting
Built for BasketNews Fantasy draft mode: private leagues of 3–12 managers, 13-player rosters, unique squads, snake or reverse-snake order.
Fantasy points are recomputed exactly from boxscores, not estimated. Every term in the modern scoring system maps onto a stored field, so a player's score here is the score the game would award.
Ranking is by value over replacement, not by average. In a draft each manager gets a unique roster, so what decides a pick is how much better a player is than the next one available at the same position — and that depends on league size. An 8-team league and a 12-team league produce different boards from the same data.
uv run python -m euroleague_open_data.fantasy --teams 8 --scoring classicTwo things about scoring are worth knowing before you trust a late-round pick:
The "classic" formula is not published for draft mode, so it was reverse-checked against the live site. Vezenkov, E2025 round 1: PIR 27 in a win scores 29.7 there, and 27 × 1.1 = 29.7 here. The PIR base and the win multiplier are confirmed. The loss multiplier is still inferred — and measured to be immaterial: rebuilding the board with 1.0 instead of 0.9 gives rank correlation 0.9996, an unchanged top 7, and an average move of 1.4 places.
It matters less than it looks. Rank correlation between classic and modern is 0.99 and seven of the top eight are the same players. The disagreement shows up in the middle: one player moves 94th to 61st, which in an 8×13 draft is a different round.
Tools
Tool | Purpose |
| fuzzy name → canonical |
| fuzzy name → canonical |
| season or career, totals / per-game / per-36, plus TS%, eFG%, usage |
| ratings and Four Factors, team and opponent |
| full game detail with completeness flags |
| zone aggregates, optionally raw x/y coordinates |
| read-only DuckDB SELECT — the escape hatch for unanticipated questions |
| draft ranking by value over replacement, sized to your league, adjusted for minute pressure, with EuroCup and NBA arrivals converted and labelled |
| your picks in snake order, and who should survive until each |
| head to head for a specific pick decision |
| game-by-game fantasy points, for form and role changes |
| how deep a coach's rotation runs — the ceiling on minutes |
| minutes and production a club vacated, by position |
| announced 2026-27 squads: who moved, who stayed, who is unsigned |
| a club's coming season: minutes freed, minutes claimed, who has no history |
Resources: euroleague://schema, euroleague://coverage, euroleague://data-quality.
run_sql runs on a read-only connection, permits a single SELECT/WITH, caps rows, and
cancels after 15 seconds.
Correcting what the data cannot know
The API lists who is on a roster. It never says why someone is absent, so a player who
signed in the NBA looks identical to one still negotiating — and the first should not
appear on a draft board at all. data/overrides.csv is where a
human records the difference:
player,status,note
"DIALLO, ALPHA",left_league,signed in the NBA after Monaco left the EuroLeagueuv run euroleague-overridesRows that match no player, or match two, raise rather than being skipped — a correction that silently fails to apply is worse than none, because it looks like it worked.
Data quality
Validation runs as part of every ETL run and writes
docs/data-quality-report.json, which is committed so
regressions show up in git log.
Three findings worth knowing about, all documented in
docs/api-notes.md:
Shot coordinates and play-by-play begin at the 2007 season. Earlier seasons have boxscores only. This is a property of the source, not of this project.
Period buckets and event sequence numbers disagree in roughly 40% of games.
NUMBEROFPLAYis unique and reliable; the per-quarter arrays upstream returns are not. Affected games are flaggedlineup_safe = false.Player identifiers differ across endpoints. Boxscores use
TGB, the live feed usesPTGB. Normalisation is source-aware, and there is a regression test for it.
Coverage
Measured across all 52 seasons on 2026-08-10 (docs/coverage.json):
Segment | Seasons | Games | Boxscore | PBP + shots |
EuroLeague | E2000–E2006 | 1 563 | yes | no |
EuroCup | U2002–U2006 | 896 | yes | no |
Both | 2007–2025 | 9 059 | yes | yes |
Total | 52 | 12 122 |
Development
uv run pytest
uv run ruff check src tests
uv run mypy srcLicence and contact
Code is MIT — see LICENSE. The licence covers the code only. It grants no rights in the underlying match data, which belongs to Euroleague Basketball and its data partners. Commercial use of the data may require a licence from them.
Takedown: if you represent a rights holder and want this changed or removed, open a
GitHub issue titled TAKEDOWN. We will respond within 7 days and will take published
datasets down on request while any disagreement is discussed. No formal legal process is
needed to get our attention.
Prior art
giasemidis/euroleague_api— Python wrapper. The shot-coordinate endpoint used here was reverse-engineered there first.FlavioLeccese92/euroleaguer— R wrapper, useful for cross-checking endpoint coverage.bsamot10/EuroleagueDataETL— existing ETL patterns for this data.vtzimpl/euroleague-api-mcp— an earlier MCP server that proxies the API directly. Given the rate limit measured here, proxying is the thing this project deliberately avoids.
Available Tools
13 toolscompare_draft_candidatesA
Compare named players side by side for a draft pick decision.
Use when the user is choosing between specific players ("Vezenkov or Milutinov?").
Resolve names to person_codes with search_players first.
Args:
person_codes: two or more canonical ids.
season: season code, e.g. "E2025".
teams: managers in the league, used to set replacement level.
Inputs: person_codes (required), teams, season, scoring. Returns: object
get_coach_rotationA
How a coach distributes minutes. Use this to judge a player's minutes ceiling.
Rotation depth is the strongest lever on fantasy output that is not the player
himself: the same player scores more under a coach who plays nine men heavy minutes
than under one who rides seven. Rotation habits travel with the coach between clubs,
so this is keyed on the coach, not the team.
`rotation_style` is a tercile RELATIVE TO THIS COMPETITION, not an absolute standard.
Coaches with fewer than 10 games are labelled `insufficient_data` rather than guessed
at. `minute_concentration` is a Herfindahl index of minute shares: higher means
minutes are concentrated in fewer players.
Args:
season: season code, e.g. "E2025".
team_code: optional club code from search_teams.
coach_name: optional partial coach name.
Inputs: season, team_code, coach_name. Returns: object
get_draft_boardA
Rank players for a BasketNews Fantasy DRAFT by value over replacement.
Use this for "who should I pick", "best available guard", or any draft ordering
question. Do NOT rank by points per game for a draft: every manager gets a unique
roster, so what matters is how much better a player is than the next player at the
SAME position who will still be available. That is `vorp_per_game`, and it is the
correct sort order.
Scoring is the BasketNews modern system, recomputed exactly from boxscores.
Fields worth reasoning about:
vorp_per_game - value over replacement. The draft ranking.
modern_per_game - raw fantasy average.
modern_floor_p25 - bad-night floor. Matters more in a draft than in a budget
league, because you keep the pick all season.
consistency_ratio - mean divided by standard deviation. Higher is steadier.
replacement_level - what is still gettable at this position late in the draft.
Args:
season: season code, e.g. "E2025".
teams: managers in the league, 3-12. This changes replacement level and therefore
the ranking, so ask the user if it is unknown. BasketNews recommends 7-8.
roster_size: players per roster. BasketNews draft mode is 13.
position: optional filter, "Guard", "Forward" or "Center".
min_games: exclude players below this many appearances.
limit: rows to return.
Inputs: limit, teams, season, scoring, +3 more. Returns: object
get_game_boxscoreA
Full boxscore for one game: final score, both team totals, and every player line.
Args:
season: season code such as "E2025".
game_code: the game's numeric code within that season.
Inputs: season (required), game_code (required). Returns: object
get_player_fantasy_logA
Game-by-game fantasy points for one player, for judging form and reliability.
A season average hides the thing that decides drafts: whether a player's role changed.
Someone averaging 20 who went 8, 9, 10, then 35, 38, 40 is a different asset from
someone who scored 20 every night. Read the sequence, not only the mean.
Args:
person_code: canonical id from search_players.
season: season code, e.g. "E2025".
last_n: return only the most recent N games. 0 returns the whole season.
Inputs: person_code (required), last_n, season. Returns: object
get_player_statsA
Season stats for one player: traditional totals plus true shooting, eFG and usage.
Requires a person_code from search_players. Returns one row per season the player
appears in, so omit `season` to get a career view.
Args:
person_code: canonical id from search_players, e.g. "006590".
season: optional season code such as "E2025".
per_mode: "total", "per_game", or "per_36". Rate stats (true_shooting_pct,
efg_pct, usage_pct) are identical in all three modes.
Inputs: person_code (required), season, per_mode. Returns: object
get_role_outlookA
What minutes and production a club has vacated, by position, plus who remains.
This is the tool for "how will player X do at his new club" and for drafting anyone
without history in this competition.
Be honest about what this can and cannot do. If a player arrives from the NBA or a
domestic league, this warehouse holds ZERO rows for him and no projection is possible
from it. What IS knowable is the role he is walking into: the minutes and fantasy
production the club lost at his position, and how stable the surviving players' minutes
are. State the vacated role, state that the player's own level is an input you do not
have, and let the user supply it. Do not invent a projection.
Returned per position: vacated minutes and fantasy points per game from players whose
roster spell has ended, alongside the remaining players' minute stability.
Args:
team_code: club code from search_teams.
season: season code, e.g. "E2025".
Inputs: team_code (required), season. Returns: object
get_shot_chartA
Shot-zone breakdown, optionally with raw x/y coordinates.
Shot data exists from the 2007 season onward only; earlier seasons have boxscores but
no coordinates. Zone letters are upstream's own coding and the human-readable names
are provisional -- see the data-quality resource.
Args:
season: season code such as "E2025".
person_code: optional player id from search_players.
team_code: optional club code from search_teams.
include_raw: also return individual shots with coordinates. Capped at 500 rows.
Inputs: season (required), team_code, include_raw, person_code. Returns: object
get_team_statsA
Team season statistics including offensive/defensive rating and the Four Factors.
Four Factors are returned for the team and for its opponents, which is what makes them
interpretable: a good `tov_pct` is low, a good `opp_tov_pct` is high.
Args:
team_code: canonical code from search_teams, e.g. "MAD", "ZAL".
season: optional season code such as "E2025".
Inputs: team_code (required), season. Returns: object
plan_snake_draftA
Work out which overall picks you own and who should be there when your turn comes.
Use this when the user knows their draft slot and wants a plan ("I pick 3rd of 8,
what should I target?").
Snake order: odd rounds run 1..N, even rounds run N..1, so a late slot gets a fast
turnaround between picks and an early slot waits. BasketNews also offers a reverse
snake, where rounds 1 and 2 are the normal snake and the direction then repeats in
pairs; set reverse_snake for that.
`likely_available` assumes every manager drafts strictly off this board, which nobody
does. Treat it as the centre of a distribution, not a prediction. Its real use is
spotting where a positional tier runs out between two of your picks -- that is the
signal worth acting on.
Args:
pick_slot: your position in round one, 1 to `teams`.
season: season code, e.g. "E2025".
teams: managers in the league.
rounds: roster size. BasketNews draft mode is 13.
reverse_snake: use BasketNews reverse-snake order instead of standard snake.
scoring: "classic" or "modern". BasketNews leagues choose one; ask the user.
Inputs: pick_slot (required), teams, rounds, season, +2 more. Returns: object
run_sqlA
Run a read-only SQL SELECT against the warehouse.
Use this for any question the other tools cannot answer.
Read the `euroleague://schema` resource first to see table and column names.
Only a single SELECT or WITH statement is permitted. The connection is read-only,
results are capped, and queries are cancelled after 15 seconds.
Args:
sql: a single SELECT (or WITH ... SELECT) statement.
limit: maximum rows to return, capped at 500.
Inputs: sql (required), limit. Returns: object
search_playersA
Find a player's canonical person_code from a partial or misspelled name.
Call this FIRST whenever the user names a player. Every other player tool takes a
person_code, not a name. Matching is case-insensitive and substring-based, so
"doncic", "Luka", and "DONCIC, LUKA" all work.
Args:
name: any part of the player's name.
season: optional season code such as "E2025" to restrict to players active then.
limit: maximum results, default 10.
Inputs: name (required), limit, season. Returns: object
search_teamsA
Find a club's canonical team_code from a partial name.
Clubs are renamed by sponsors between seasons ("Kosner Baskonia" vs "Baskonia"), so
match against both the seasonal name and the permanent club name.
Args:
name: any part of the club name, e.g. "zalgiris", "real", "efes".
season: optional season code such as "E2025".
Inputs: name (required), season. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools have clearly distinct purposes (search_players vs search_teams, get_player_stats vs get_player_fantasy_log). The fantasy draft tools (get_draft_board, compare_draft_candidates, plan_snake_draft) could be confused at a glance, but their descriptions provide clear triggers for when each should be used.
Names follow a consistent verb_noun pattern with lowercase and underscores. There is a mix of verbs (search_, get_, run_, compare_, plan_) but each verb is semantically appropriate for its action, so the variation is minor and not chaotic.
13 tools is well within the ideal 3-15 range and covers both general data retrieval (stats, boxscores, shot charts) and specialized fantasy draft features. Each tool adds distinct value without redundancy.
The domain of Euroleague basketball data and fantasy drafting is well covered: search, player/team stats, boxscores, shot charts, coach rotations, and fantasy draft tools. Minor gaps like a game schedule or standings list exist, but the run_sql tool can address these ad hoc.
Maintenance
Related MCP Connectors
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Hosted MCP server for live public-data APIs and Skills for AI agents.
API-first CRM for LLMs - contacts, companies, deals and activities over a native MCP server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP-Server from your Database optimized for LLMs and AI-Agents. Supports PostgreSQL, MySQL, ClickHouse, Snowflake, MSSQL, BigQuery, Oracle Database, SQLite, ElasticSearch, DuckDB550Apache 2.0
- FlicenseNot gradedqualityDmaintenanceAn MCP server for accessing college basketball statistics through the SportsData.io CBB v3 Stats API, enabling AI agents to retrieve and analyze college basketball data through natural language interactions.-
- FlicenseNot gradedqualityBmaintenanceAn MCP server that enables natural language querying of over 10 million ball-by-ball cricket deliveries stored in a local DuckDB database. It provides 26 tools for analyzing player matchups, situational stats, and historical records across all major cricket formats and tournaments.3-
- AlicenseNot gradedqualityCmaintenanceAn 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.28 PyPI9MIT