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.
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
Quickstart
Register 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
This installs the fpl-context-mcp command.
From source
As a dependency of another project
Configuration
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):
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)
If installed with pip
If running from source
Tip: If you use uv, replace "python" with "uv" and prepend "run" to args:
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
Cursor (~/.cursor/mcp.json), Windsurf (~/.codeium/windsurf/mcp_config.json) and Gemini CLI (~/.gemini/settings.json) all use the same mcpServers shape as Claude Desktop:
VS Code (Copilot agent mode) — .vscode/mcp.json in your workspace:
OpenAI Codex CLI — ~/.codex/config.toml:
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:
- The MCP endpoint is
https://<your-host>/mcp; GET /health returns ok for load-balancer and platform health checks.
--transport, --host and --port can also be set with MCP_TRANSPORT, MCP_HOST and MCP_PORT (or the PORT variable 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 / ngrok for 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:
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:
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_TOKEN unset (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
By 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)
Confirms the FPL API is reachable from your machine and exits 0 on success, 1 on failure:
MCP 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.
"Arsenal's next six fixtures?", "What are the fixtures in gameweek 12?"
get_fixture_run
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
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
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
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
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
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)
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-static endpoint 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.
Resources
Running tests
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:
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