World Cup Stats MCP

World Cup Stats MCP

Enables querying FIFA World Cup player and team statistics for 2010, 2014, 2018, and 2022 through natural language, providing tools for top scorers, player comparisons, team summaries, and more via a Claude-powered CLI.

Category
Visit Server

README

World Cup Stats MCP ⚽

An automated Python ETL pipeline that extracts FIFA World Cup player and team statistics from fbref.com into a local DuckDB warehouse, exposes it through a Model Context Protocol (MCP) server, and ships a custom Claude-powered CLI assistant so you can ask questions about the data in plain English.

Covers the 2010, 2014, 2018, and 2022 World Cups — ~2,490 players with full scoring, shooting, discipline, goalkeeping, and playing-time stats.

Architecture

fbref.com ──(soccerdata: rate-limited, cached, resumable scrape)──▶  ETL pipeline (Python)
                                                                         │  clean / flatten / load
                                                                         ▼
                                                                 DuckDB warehouse
                                                                 (players, team_tournament, …)
                                                                         │
                                                       ┌─────────────────┴──────────────────┐
                                                       ▼                                      ▼
                                              MCP server (FastMCP)                 Custom Claude-API CLI client
                                       7 read-only tools over the data       "Compare Ronaldo & Messi across all 4 WCs"

Features

  • Resilient scrapersoccerdata over fbref with built-in rate-limiting, on-disk caching, and per-table fetching so a run is fully resumable.
  • Analytics warehouse — staging tables modelled into clean marts: a wide players table (one row per player per World Cup) and team_tournament aggregates.
  • MCP server — exposes the warehouse as 7 read-only tools (FastMCP); run_sql rejects anything that isn't a SELECT.
  • Conversational assistant — a custom MCP client that wires the tools into Claude's tool-use loop for natural-language Q&A.

Tech stack

Python 3.13 · soccerdata · DuckDB · MCP / FastMCP · Anthropic Claude API (Sonnet 4.6) · prompt caching

Project layout

etl/         extract (soccerdata) → load (DuckDB) → pipeline (CLI) → model (marts)
mcp_server/  FastMCP server exposing the warehouse as MCP tools
assistant/   custom Claude-API CLI that connects to the MCP server
config.py    paths, seasons, league, stat types
data/        DuckDB warehouse + scrape cache (gitignored)

Setup

python3.13 -m venv .venv
source .venv/bin/activate
pip install --prefer-binary -r requirements.txt   # --prefer-binary avoids a cryptography source build
cp .env.example .env                               # add your ANTHROPIC_API_KEY (for the assistant only)

The scraper drives a headless Chrome via soccerdata, so Google Chrome must be installed.

Usage

Build the warehouse (scrape → load → model):

python -m etl.pipeline            # all configured World Cups
python -m etl.model               # build the players / team_tournament marts

Explore the data directly (no API key needed):

python -c "import duckdb,config; print(duckdb.connect(str(config.DUCKDB_PATH),read_only=True).sql('SELECT player,team,goals FROM players WHERE season=2018 ORDER BY goals DESC LIMIT 10'))"

Run the MCP server (stdio transport):

python -m mcp_server.server

Chat with the assistant (requires ANTHROPIC_API_KEY):

python -m assistant.cli

Then ask things like:

  • "Who were the top 5 scorers in 2014?"
  • "Compare Cristiano Ronaldo and Messi across all four World Cups."
  • "Which goalkeeper kept the most clean sheets?"

MCP tools

list_tables · list_seasons · top_scorers · player_stats · compare_players · team_summary · run_sql (read-only)

Data notes

  • Source: fbref.com (Sports Reference), used for personal, non-commercial, educational purposes via soccerdata's rate-limiting and caching.
  • The World Cup competition on fbref exposes standard, keeper, shooting, playing_time, and misc player tables (no passing/defense/possession — those are league-only).
  • There is no expected-goals (xG) for the World Cup, and shot counts are unavailable for the 2010 and 2014 tournaments.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured