Building an FPL MCP Server

AI MCP FPL

The Problem

My friends play Fantasy Premier League. I merely dabble.

Actually, let’s be honest: I’m terrible at it. Not for lack of trying (says I), but for lack of patience. While my mates spend hours analyzing FPL stats and debating whether Salah is “essential”, I’m the guy who forgets to set his lineup until five minutes before deadline…then proceeds to not touch his team for five months.

Then it hit me: Why not get AI to do it for me?

The Plan

Before diving in, I set some requirements. Without these, I’d just end up building random features until 3am:

What I Actually Needed

  • Cloud hosting (no laptop/me dependency)
  • Automated email updates (daily/weekly)
  • An AI agent that can actually make transfers
  • Something that researches Reddit and FPL forums

Building the MCP Server

Here’s where it gets interesting. At StackOne, we’ve been developing disco.dev - a tool for building AI integrations.

So I raised a ticket: “Hey @claude, build me an MCP server for FPL using this repo: https://github.com/rishijatia/fantasy-pl-mcp

And it… actually worked? Kind of. I had read access to FPL data. Great start.

But I needed write access to actually make transfers. Claude tried the obvious approach, but FPL’s authentication had other plans:

The session-based authentication is connecting successfully (getting a 302 redirect which is expected), but it's not getting session cookies back...

Translation: FPL had changed their auth flow. Amazing.

The Hacky Solution

Time for Plan B: browser automation.

I built a script that grabs the BEARER token from your browser when you login. Yes, it’s hacky. No, I’m not proud… Well no if it works it works. The server now runs locally, built from a connector config. It even checks and re-authenticates before each tool run.

Testing Locally

With disco handling the MCP and DuckDuckGo providing web search, I crafted the ultimate prompt:

“Find good players. Maximize value. Look for easy fixtures. Check Reddit for GW1 advice. Read FPL articles. Do everything I’m too lazy to do myself.”

Then came the infrastructure: Lambda functions, SMTP for emails, Terraform to manage it all.

The Tech Stack

  • Lambda: Hosts the resolution agent
  • Disco: Manages the MCP connections
  • Claude: The brains of the operation
  • Terraform: Infrastructure as code

Game Week 1: The Moment of Truth

I deployed everything and let Claude pick my team. Then I waited.

The result? Better than average?! Not bad for an AI’s first attempt.

My GW1 Team Performance

The Wissa Incident

Then I looked closer at my team.

“Why is Wissa in my squad?”

blank stare

He’s £7.5m. He’s a transfer risk. He’s not playing. :sigh: :ugh-really-deep-sigh:

Team Evaluation Showing the Problem

Here’s my completely calm and measured response to Claude:

My Panic Message to Claude

And Claude’s wonderfully obvious reply:

Claude's Response

Another blank stare

The Fix

Right. Time to actually solve this properly.

I needed to ensure the AI was getting ALL the player information - injuries, form, everything. Back to the API documentation:

API Investigation

Success! The system now pulls complete player data:

Wissa Status Updated Correctly

Lessons Learned

The Good:

  • Disco.dev is genuinely useful for building AI integrations
  • Claude can manage an FPL team better than I expected
  • Automation beats forgetting to set your lineup

The Reality Check:

  • AI responses can be unpredictable … shocking I know
  • Validate your code
  • Double-check everything before trusting an AI with your reputation

What’s Next

The Lambda deployment is ready. The email newsletter is configured.

Will it beat my friends? Probably not.

Will it save me from deadline panic? Absolutely.

Will it only make great decisions from now on?

longest blank stare yet

Let’s hope so.

On: The Philosophy of Using AI in FPL

Is it moral to use AI to manage my team? This is a learning experience and it’s fun to see how much an AI can do. There are a whole host of sites that someone can use to get the best transfer information. So it’s not any different using an LLM versus data science / machine learning to get the best transfer information. It’s just a different way of doing it. I’d love to dive into this in more detail in a future post, so let me know if you’re interested in that! But otherwise my stance on this is mostly aligned with the Iain M. Banks book “The Player of Games”, where the Culture AI are the best players of some games, but some games have something so intrinstically human about them that the AI isn’t always the best player. This project is both an engineering experiment and a philosophical one - maybe AI can do better than me, but maybe my partaking in the playing of the game is what brings enjoyment to it. I think the answer is somewhere in the middle, but I don’t know where exactly that is yet.