Fantasy Premier League stats (SQL) and BBC/Guardian press and injury news search for AI agents.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
An MCP server that gives any MCP-capable AI agent a queryable Fantasy Premier League (FPL) database: player and match stats, fixtures, gameweeks, and every player's injury/availability status. It runs locally in Claude Desktop, Claude Code, Cursor, VS Code Copilot, Windsurf, Gemini CLI and Codex; ChatGPT and other clients that only accept a URL can connect when you host it over HTTP.
| Tool | What it does |
|---|---|
query_historical_stats | Runs a read-only SQL SELECT against a PostgreSQL database of FPL player, fixture and gameweek stats (whatever seasons you've ingested), including each player's FPL status, chance of playing, and injury/news note |
An ingestion job keeps that data populated and current:
| Job | What it does |
|---|---|
ingest_match_data | Fetches teams, fixtures, players (with availability) and per-match player stats from the FPL API, and writes them to PostgreSQL |
What it doesn't do: press coverage. Match reports, manager quotes and press-conference news aren't included β publishers' terms don't allow their articles to be stored and served through an AI tool. The tool description tells the model to use its own web search for that, which Claude, ChatGPT and Gemini all have. The division of labour: this server answers "who's injured, who's in form, what are the fixtures"; the AI's web search answers "what did the manager say".
This server does not fetch live data per-question. The tool only reads whatever is already sitting in your PostgreSQL database. It starts out empty β you must run the ingestion job once to seed it, and then keep running it on a recurring schedule forever, or answers will silently go stale. This is not a one-time setup step. See Keeping data fresh (ongoing) β it's the single most important thing to get right before handing this to anyone.
The full path from zero to a working MCP tool, in order. Each step links to details further down.
pip install fpl-context-mcp β see Installation.db/schema.sql against a fresh Postgres database β see Provisioning your database..env.example to .env and fill in your DATABASE_URL and DATABASE_ETL_URL β see Configuration.fpl-context-mcp --check β confirms every credential works before you go further.| Requirement | Version |
|---|---|
| Python | 3.11+ |
| PostgreSQL | Any recent version, with a read-only role (e.g. fpl_readonly) and a read/write role (e.g. fpl_etl) |
You provision the database yourself β see the next sections. Free tiers (Neon, Supabase, etc.) are plenty: the data is a few MB per season.
This installs three CLI commands: fpl-context-mcp (the MCP server), fpl-context-ingest-match (the recurring ingestion job), and fpl-context-backfill-history (a one-time job for past seasons) β see Seeding data.
The server reads all secrets from environment variables. Copy .env.example to .env in your working directory (it's gitignored) and fill in your own values:
| Component | Variables required |
|---|---|
query_historical_stats tool | DATABASE_URL |
ingest_match_data job | DATABASE_ETL_URL (or DATABASE_URL) |
Run fpl-context-mcp --check any time to confirm all of the above are set correctly and reachable β see Verifying connectivity.
db/schema.sql creates the six tables query_historical_stats expects (seasons, teams, gameweeks, players, fixtures, gw_player_stats) and includes example CREATE ROLE statements for the read-only and read/write roles referenced in .env.example. It's a starting schema, not a full migration tool β adjust types/constraints as needed.
The tables start completely empty. Continue to Seeding data.
The ingestion jobs are plain commands you run directly β nothing runs automatically on pip install or on MCP server startup.
Run these once, right after configuring your .env, before registering the server with Claude Desktop. Run fpl-context-ingest-match before the backfill. Until you do, query_historical_stats returns Query returned no results. for any query, since the tables are empty.
ingest_match_data loads the current season: every team, gameweek, player and fixture, plus per-player stats for matches already played (the first run can take several minutes mid-season, since it fetches stats player by player). Later runs are quick β see What each run updates.
fpl-context-backfill-history adds past seasons (as far back as FPL has them, about 20). It reads FPL's per-player season history and writes one row per player per season into players. It's safe to re-run and only needs to run once, since past seasons don't change. Know its limits:
team_fpl_id set to NULL (FPL doesn't say which team a player was on), and fpl_id is the player's current FPL id.This is not a one-time step. Fixtures change weekly, player stats update after every match, and injury/availability news changes daily. If you seed once and never run the job again, a query a month later will hit a database that's missing every result, stat and injury update since your last run.
You need something to invoke fpl-context-ingest-match on a recurring schedule, indefinitely, for as long as the MCP server is in use. (The backfill is not part of this β run it once.) Pick whichever fits your setup:
Runs are on a clock, not tied to gameweeks β nothing triggers when a match ends. A result shows up in your database at the first run after FPL marks the fixture finished.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/fpl-context)<a href="https://allmcps.com/mcp/fpl-context"><img src="https://allmcps.com/api/badge/fpl-context?style=directory" alt="FPL Context on AllMCPs" /></a>