fpl-context-mcp
A zero-setup, read-only MCP server for live Fantasy Premier League data from the public FPL API.
Get the current/next gameweek and transfer deadline.
Fetch fixtures with FPL difficulty ratings by team, gameweek, or future window.
Analyze fixture runs: average FDR, home/away split, blank/double gameweeks, and rank all teams.
Search and rank players by name, team, position, max price, and stats like form, points, ownership, and ep_next.
Rank players by estimated expected points (xPts) with position, team, price, and gameweek filters.
Retrieve a player's current-season match history, opponent splits, last N matches, and past-season totals.
Get ranked gameweek stats for goals, assists, bonus, minutes, clean sheets, xG, and xA.
Look up a manager's squad, captain, bench, bank, transfers, and chips by FPL team ID.
Check live injury, suspension, and availability flags for all flagged players or specific names/statuses.
Stores ingested FPL player, fixture, gameweek and season data and provides read-only SQL querying for historical statistics.
Ingests official Fantasy Premier League fixture and player-stat data to answer historical Premier League and FPL questions.
Fetches press-conference summaries and injury updates from The Guardian API and indexes them for semantic search.
fpl-context-mcp
An MCP server that gives any MCP-capable AI agent live Fantasy Premier League (FPL) data: the current gameweek and deadline, fixtures with difficulty ratings, player stats and match history, any manager's squad and chips, expected points, and injury and suspension flags. It works with zero setup and needs no database: it reads the public FPL API directly. 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 |
| The current and next gameweek and the transfer deadline |
| Fixtures with FPL's difficulty rating (FDR, 1 to 5): every team, one team's run, or a single gameweek |
| How hard a team's next few fixtures are (average FDR, home/away, blank and double gameweeks), or a ranked fixture ticker for all 20 teams |
| Find and rank players by name, team, position and max price; sort by points, form, price, ownership, expected points and more |
| A player's matches this season (optionally against one opponent) and their season totals for past seasons |
| Every player's stats for one gameweek, ranked: top scorers, clean sheets, bonus |
| Estimated expected points for a gameweek by position, team and price, built from underlying stats, expected minutes, availability and fixture difficulty |
| A manager's squad, captain, bench, bank, transfers and chips used, from their FPL team ID |
| Every player's current injury, suspension and availability flags |
Plus three prompts (captain_pick, transfer_plan, chip_timing) that show up as slash commands in clients that support them, and a reference resource (fpl://glossary). See Prompts and resources.
Data limits. FPL serves match-by-match data for the current season only; past seasons are season totals. Questions like "how did X do against Arsenal in earlier seasons" can't be answered from FPL's data, and the tools say so rather than guess.
Contents
Related MCP server: FPL MCP Server
Quickstart
uvx fpl-context-mcpRegister it with your client (Claude Desktop config: {"mcpServers": {"fpl-context": {"command": "uvx", "args": ["fpl-context-mcp"]}}}) and ask "who should I captain this week?" or "show Arsenal's next five fixtures". That's it: no database, no account, no API key.
For other clients see Other AI clients. For ChatGPT and other URL-only clients, host it over HTTP.
Installation
Needs Python 3.11+ and outbound HTTPS access to fantasy.premierleague.com.
Without installing (uv)
uvx fpl-context-mcp runs it straight from PyPI. Requires uv.
From PyPI
pip install fpl-context-mcpThis installs the fpl-context-mcp command.
From source
git clone https://github.com/sbanthia92/fpl-context-mcp
cd fpl-context-mcp
pip install -e ".[dev]"As a dependency of another project
fpl-context-mcp @ git+https://github.com/sbanthia92/fpl-context-mcp.gitConfiguration
The server needs no configuration over stdio. Everything below applies only to the HTTP transport (--transport http), and can be set as environment variables or in a .env file (see .env.example):
Variable | Default | Purpose |
|
| Defaults for |
| (empty) | Require |
|
| Per-caller request limit on |
| (empty) | Header with the real client IP behind a trusted proxy |
Registering with Claude Desktop
Add the server to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
With uvx (recommended)
{
"mcpServers": {
"fpl-context": {
"command": "uvx",
"args": ["fpl-context-mcp"]
}
}
}If installed with pip
{
"mcpServers": {
"fpl-context": {
"command": "fpl-context-mcp"
}
}
}If running from source
{
"mcpServers": {
"fpl-context": {
"command": "python",
"args": ["/absolute/path/to/fpl-context-mcp/server.py"]
}
}
}Tip: If you use
uv, replace"python"with"uv"and prepend"run"toargs:"command": "uv", "args": ["run", "/absolute/path/to/fpl-context-mcp/server.py"]
Restart Claude Desktop. You should see fpl-context appear in the tools panel.
Other AI clients (local)
Any client that can launch a local MCP server (stdio) works the same way: run the fpl-context-mcp command (no configuration needed).
Claude Code
claude mcp add fpl-context -- uvx fpl-context-mcpCursor (~/.cursor/mcp.json), Windsurf (~/.codeium/windsurf/mcp_config.json) and Gemini CLI (~/.gemini/settings.json) all use the same mcpServers shape as Claude Desktop:
{
"mcpServers": {
"fpl-context": {
"command": "uvx",
"args": ["fpl-context-mcp"]
}
}
}VS Code (Copilot agent mode) — .vscode/mcp.json in your workspace:
{
"servers": {
"fpl-context": {
"type": "stdio",
"command": "uvx",
"args": ["fpl-context-mcp"]
}
}
}OpenAI Codex CLI — ~/.codex/config.toml:
[mcp_servers.fpl-context]
command = "uvx"
args = ["fpl-context-mcp"]uv not installed? pip install fpl-context-mcp, then use "command": "fpl-context-mcp" (no args) in any of the configs above.
Your own agent code — the MCP SDKs (Python, TypeScript) and agent frameworks such as the OpenAI Agents SDK can launch fpl-context-mcp as a stdio server, or connect to it over HTTP as below.
Remote access over HTTP (ChatGPT and other URL-only clients)
Some clients can't launch a local process — they only accept a server URL. That includes ChatGPT (Settings → Apps & Connectors → Advanced → Developer mode → create a connector) and custom connectors on claude.ai. For these, run the server with the streamable HTTP transport on a machine with a public HTTPS address:
MCP_AUTH_TOKEN=some-long-random-string \
fpl-context-mcp --transport http --host 0.0.0.0 --port 8000The MCP endpoint is
https://<your-host>/mcp;GET /healthreturnsokfor load-balancer and platform health checks.--transport,--hostand--portcan also be set withMCP_TRANSPORT,MCP_HOSTandMCP_PORT(or thePORTvariable that Render, Cloud Run, Heroku and Fly set).The server listens on plain HTTP. Put it behind something that terminates TLS — any of those platforms does, or
cloudflared tunnel/ngrokfor a quick test from your own machine.The default bind address is
127.0.0.1, so nothing is exposed until you pass--host 0.0.0.0.
Authentication. With MCP_AUTH_TOKEN set, every request to /mcp must send Authorization: Bearer <token>; others get HTTP 401. Clients that let you set headers can use it — for example Claude Code:
claude mcp add --transport http fpl-context https://your-host/mcp --header "Authorization: Bearer some-long-random-string"and the OpenAI Agents SDK / Responses API MCP tool (headers={"Authorization": "Bearer ..."}).
Several keys. MCP_AUTH_TOKEN accepts a comma-separated list (key-alice,key-bob). Each user can have their own key, and removing one from the list revokes it without touching the others. Rate limits are applied per key.
Rate limiting and load. Set these before exposing a server publicly:
Variable | Default | Purpose |
|
| Max requests per minute to |
| (empty) | Behind a proxy, every request appears to come from the proxy. Set this to the header your proxy fills with the real client IP ( |
ChatGPT and claude.ai connectors only support OAuth or no authentication — not a static bearer token. To use them you currently have to leave
MCP_AUTH_TOKENunset (the endpoint is then open to anyone who finds the URL) or put an OAuth-capable proxy in front. If you run it open, anyone who finds the URL can use it and spend your server's FPL API traffic, so set the rate limit below. The server logs a warning at startup when it's bound to a non-local address without a token or a rate limit.
Running a public endpoint? See the hosting guide: container, proxy setup, auth modes, and a canary that checks the endpoint every 15 minutes.
Container. A Dockerfile is included: docker build -t fpl-context-mcp ., then run it (optionally with MCP_AUTH_TOKEN set). It runs as a non-root user, listens on $MCP_PORT / $PORT / 8000, defaults to a rate limit of 120 requests a minute, and has a health check on /health.
Where the data comes from. A hosted server calls the public FPL API on behalf of whoever connects, and caches responses in memory. There is nothing to provision or keep fresh. Because you're now serving results to other people, see Data sources and disclaimer, and the hosting guide.
Running the server standalone
fpl-context-mcp # installed from PyPI
python server.py # from sourceBy default the server communicates over stdio: it is designed to be launched by an MCP client, and running it directly is mainly useful for smoke-testing. To run it as a persistent network service, use --transport http (see Remote access over HTTP).
Verifying connectivity (--check)
fpl-context-mcp --checkConfirms the FPL API is reachable from your machine and exits 0 on success, 1 on failure:
=== fpl-context-mcp check ===
✅ FPL API reachable (700 players, 20 teams)
✅ OKMCP tools reference
Live tools overview
These tools call the public FPL API directly and need no database or configuration. They share one cache: FPL's bootstrap-static data (every player and team) is downloaded once and reused for 5 minutes across tools; a manager's picks and a player's match history are cached for 2 and 5 minutes, and a finished gameweek's stats for an hour. If FPL can't be reached, the last cached copy is served and labelled as possibly out of date. All are read-only and advertise readOnlyHint, so clients can skip approval prompts. Team arguments accept a full name, a short name or a unique fragment (Arsenal, MCI, Man City).
get_current_gameweek
No parameters. Returns the current gameweek (in progress or finished), the next gameweek, and the next transfer deadline with the time left. "When is the next deadline?"
get_fixtures
Fixtures with FPL's difficulty rating (FDR): 1 easiest, 5 hardest, from each team's own point of view.
Parameter | Type | Description |
| string | Optional. Show that team's fixtures (opponent, home/away, its own FDR). Omit for all teams. |
| integer 1-38 | Optional. A single gameweek (includes scores once played). |
| integer 1-38 | Optional. Gameweeks to list from the next one to play (default 5). Ignored when |
"Arsenal's next six fixtures?", "What are the fixtures in gameweek 12?"
get_fixture_run
Parameter | Type | Description |
| string | Optional. Omit to rank all 20 teams, easiest run first. |
| integer 1-38 | Optional. Window length starting from the next gameweek to play (default 5). |
For one team you get the average FDR, home/away split, the fixture-by-fixture sequence and any blank or double gameweeks. "Who has the best fixtures for the next six gameweeks?", "Is Chelsea's run good enough to keep Palmer?"
search_players
Parameter | Type | Description |
| string | Part of a first, second or web name. |
| string | Team name or short name. |
|
| Optional. |
| number | Maximum price in £m, e.g. |
| string |
|
| integer | Rows to return (default 15, max 50). |
Each row has price, total points, form, ownership, FPL's expected points for the next gameweek (ep_next) and availability status. "Best midfielders under £8m by form?"
get_xpts
Parameter | Type | Description |
|
| Optional. |
| string | Optional. |
| number | Optional, in £m. |
| integer 1-38 | Optional. Defaults to the next gameweek to play. |
| integer | Rows to return (default 15, max 50). |
Ranks players by estimated expected points (xPts) next to the opponent and its FDR, expected minutes, and FPL's own ep_next. Double gameweeks count both fixtures; blank ones score zero; flagged players are discounted by FPL's chance of playing.
How xPts is computed. A simple, transparent baseline, not a forecast model: appearance points, plus the player's season xG, xA, clean-sheet, saves and bonus rates per 90 times FPL's scoring values, scaled by expected minutes (the share of available minutes played so far), multiplied by ±10% per FDR point from a neutral 3, and discounted by availability. It extrapolates the season so far, so it is noisy in the first few gameweeks and cannot see rotation, tactics or set-piece changes. Use it to build a shortlist, then cross-check with get_live_availability. "Top five midfielders under £8m by expected points?"
get_player_history
Parameter | Type | Description |
| string | Required. First, second or full name ( |
| string | Optional. Only this season's matches against that team. |
| integer 1-40 | Optional. Only the most recent N matches. |
Returns this season's match-by-match record (opponent, home/away, score, minutes, goals, assists, clean sheets, bonus, xG, xA, points), totals for the matches shown, and season totals for every past season FPL has on record. "How has Haaland done against Arsenal this season?", "Show Saka's last five matches."
What FPL does and doesn't have. FPL serves match-by-match data for the current season only. Past seasons are one row of totals each. So "how did X perform against Arsenal over the last few seasons" cannot be answered, and the tool says so instead of implying the player never faced them.
get_gameweek_stats
Parameter | Type | Description |
| integer 1-38 | Optional. Defaults to the latest gameweek with results. |
|
| Optional. |
| string | Optional. |
| string |
|
| integer | Rows to return (default 15, max 50). |
Every player with minutes in that gameweek, ranked. A gameweek still in progress is labelled, since points and bonus can still change. "Top scorers last gameweek?", "Which defenders kept a clean sheet in GW9?"
get_manager_squad
Parameter | Type | Description |
| integer | The manager's FPL team ID: the number in the URL of their FPL Points page ( |
| integer 1-38 | Optional. Defaults to the manager's current gameweek. |
Returns the 15-man squad with captain and vice-captain, bench, bank, squad value, transfers and any hit taken, the chip played that week, and every chip used so far this season. It reads only the public data FPL already shows anyone with the team ID; no login. "What chips has team 123456 used?"
get_live_availability
Current FPL injury, suspension and availability flags, fetched live from the FPL API. Use it before recommending or captaining a player, so a newly flagged player isn't missed.
Parameters (all optional)
Parameter | Type | Description |
| array of strings | Names to look up, e.g. |
| array of strings | Only return players with these FPL status codes: |
With no arguments it returns every player who currently has a flag (any status other than a, or a news note), newest news first, capped at 100 rows. Each row has the player, team, position, status, FPL's chance of playing next round, the news note and when it was added.
Example prompts
"Is Saka fit for this gameweek?"
"Who has been suspended or ruled out in the last few days?"
"Before I set my captain, check that Haaland and Salah have no flags."
How it behaves
One request to FPL's
bootstrap-staticendpoint returns every player, and the response is cached in memory for 5 minutes, so heavy use costs FPL only a few calls an hour per server process.If FPL can't be reached, the last cached copy is served and labelled as possibly out of date. With no cached copy it returns an error.
Prompts and resources
Prompts
Ready-made workflows. They contain instructions only, no data, so they never go stale: the tools fetch live FPL data when the prompt runs. Clients that support MCP prompts show them as slash commands (for example /mcp__fpl-context__captain_pick in Claude Code). Every argument is optional; without team_id the model asks for your squad or answers generally.
Prompt | Arguments | What it does |
|
| Ranks candidates with |
|
| Finds your weakest assets, compares fixture runs and expected points for replacements within budget, and recommends one or two transfers (and whether a hit is worth it) |
|
| Looks for double and blank gameweeks and suggests when to play each chip you have left |
Resources
URI | Contents |
| FPL status codes, FDR, positions, the data limits, and which tool answers what |
Architecture
How the server is built (layers, request flow, caching, transports) and why, including the design decisions and their trade-offs, is in docs/architecture.md.
Running tests
pip install -e ".[dev]"
pytest tests/ -v # all mocked: no network access needed
ruff check . && ruff format .Data sources and disclaimer
fpl-context-mcp is an independent open-source project. It is not affiliated with, endorsed by, or sponsored by the Premier League or Fantasy Premier League.
The package ships no data. It fetches it at run time, from your machine, from:
Source | Used for | Notes |
Fantasy Premier League API ( | Players, teams, fixtures, match stats, manager squads, injury/availability news | Unofficial and undocumented; it can change or rate-limit without notice. Responses are cached in memory for a few minutes to keep traffic low. |
You are responsible for complying with the source's terms of use for the data you retrieve and, if you host the server for other people, serve. This is especially relevant for commercial use and for public deployments. The MIT license below covers this project's code only, not any third-party content it retrieves.
License
MIT © 2026 Shubham Banthia
Available Tools
9 toolsget_current_gameweekARead-onlyIdempotent
The current and next FPL gameweek and the transfer deadline, live from the FPL API. Use it to anchor 'this week' / 'next week' questions and to say how long a manager has left to make transfers.
Inputs: no named parameters.
get_fixture_runARead-onlyIdempotent
How easy or hard a team's next few fixtures are, live from the FPL API: average FDR (1 easiest, 5 hardest), home/away split, and blank or double gameweeks. Pass team for its fixture-by-fixture run; omit it to rank all 20 teams, easiest run first. Prefer this over get_fixtures when judging transfers, captaincy or chip timing.
Inputs: team, gameweeks.
get_fixturesARead-onlyIdempotent
FPL fixtures with difficulty ratings (FDR, 1 easiest to 5 hardest), live from the FPL API. With no arguments lists the next 5 gameweeks for every team. Pass team to see one team's run from its own point of view, gameweek for a single round, or gameweeks_ahead for a longer window.
Inputs: team, gameweek, gameweeks_ahead.
get_gameweek_statsARead-onlyIdempotent
Every player's stats for one gameweek, ranked (default: the latest gameweek with results, sorted by points). Live from the FPL API. Use it for 'top scorers last week', 'which defenders kept clean sheets in GW9' or 'who got the most bonus'. Filter by position and team.
Inputs: team, limit, sort_by, gameweek, +1 more.
get_live_availabilityARead-onlyIdempotent
Current FPL injury, suspension and availability flags, fetched live from the FPL API. Call this before recommending, picking or captaining any player, so a newly flagged or suspended player isn't missed. With no arguments it lists every player who currently has a flag, newest news first. Pass player names to check specific players (returned even when fully available), and/or statuses to filter.
Status codes: a available, d doubtful, i injured, s suspended, u unavailable (left club / on loan), n not in squad. chance_of_playing is FPL's estimate for the next round.
Inputs: players, statuses.
get_manager_squadARead-onlyIdempotent
A manager's FPL squad for a gameweek, with captain, bench, bank, squad value, transfers and the chips they have used, looked up by their FPL team ID (live from FPL's public API, no login needed). The team ID is the number in the URL of the manager's FPL Points page. Use it as the starting point for transfer, captain and chip advice on their actual team.
Inputs: team_id (required), gameweek.
get_player_historyARead-onlyIdempotent
A player's match-by-match record this season (minutes, goals, assists, clean sheets, bonus, xG/xA, points), optionally only against one opponent or the last N matches, plus their season totals for past seasons. Live from the FPL API. Use it for 'how has Saka done against Spurs this season' or 'is his form real'. FPL provides match-level data for the current season only; past seasons are totals, so opponent splits for earlier seasons do not exist.
Inputs: player (required), last_n, opponent.
get_xptsARead-onlyIdempotent
Rank players by estimated expected points (xPts) for a gameweek, live from the FPL API. A transparent baseline built from season xG/xA/clean-sheet/save/bonus rates, expected minutes, availability and fixture difficulty, shown beside FPL's own ep_next. Filter by position, team and max price. Good for captain shortlists and finding transfer targets; it is noisy early in the season and ignores rotation, so cross-check availability with get_live_availability.
Inputs: team, limit, gameweek, position, +1 more.
search_playersARead-onlyIdempotent
Find and rank current-season FPL players, live from the FPL API: by name, team, position and maximum price, sorted by a chosen stat. Returns price, total points, form, ownership, FPL's expected points for the next gameweek (ep_next) and availability status. Use it for 'best midfielders under £8m', 'how is Palmer doing', or to find a replacement.
Inputs: name, team, limit, sort_by, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools have clearly distinct targets: availability, gameweek timing, player search, squad lookup, player history, and gameweek stats. The main overlap is get_fixtures versus get_fixture_run, both covering fixture difficulty, and to a lesser degree search_players versus get_xpts for player ranking; the descriptions explicitly guide usage, but an agent could still hesitate.
All tool names use consistent snake_case with a clear verb_noun pattern (get_current_gameweek, search_players, get_manager_squad, get_player_history). The single search_ prefix is still a standard verb and fits the same predictable convention.
Nine tools is well-scoped for an FPL context server, covering distinct query areas without obvious filler. Each tool appears to earn its place in the analytical workflow.
The surface covers the core FPL context needs: availability, current gameweek, fixtures/FDR, player search, xPts, player history, gameweek stats, and manager squad. Minor gaps remain, such as mini-league standings or more explicit player/team detail views, but agents can work around most questions with the existing tools.
Maintenance
Related MCP Connectors
Supabase-compatible Postgres for agents: projects, branches, SQL, auth, storage, email.
Store, query, and update structured data from any AI agent
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with Fantasy Premier League data through natural language queries. Supports retrieving fixtures, league standings, player performance, and other FPL statistics via the official FPL API.1616 npm3MIT
- AlicenseNot gradedqualityDmaintenanceConnects LLMs to the Fantasy Premier League API for intelligent team management, enabling natural language player research, competitor analysis, transfer decisions, and strategic planning using friendly names instead of IDs.3MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to analyze Fantasy Premier League data, providing tools for player search, fixture analysis, manager comparisons, and strategy prompts for transfer planning and lineup selection.1927 PyPI1MIT
- FlicenseNot gradedqualityDmaintenanceProvides tools and resources to interact with the Fantasy Premier League API, enabling player analysis, fixture insights, and team management through natural language.-