Live league data for the agent you build

Build your own fantasy sports AI agent

To build your own fantasy sports AI agent, connect a model to your league's live data through an MCP server, give it your league's own rules, and choose where it answers.

League Loom is that data layer: one free MCP server URL that reads your Fantrax, ESPN and Sleeper leagues, so your agent answers from real rosters, standings, matchups, transactions and waivers instead of guessing. You pick the model, write the instructions and decide where it lives, such as a league Slack bot, a scheduled recap or a personal assistant.

Free connector · ESPN, Sleeper & Fantrax · Works with compatible AI tools

Looking for a finished league bot to learn from? See the Robby Slack bot case study.

Looking for the assistant without writing code? See Claude for every fantasy sport.

Looking for a fantasy agent in Meta's Muse Code? See League Loom in Muse Code.

Last updated

Before you start

What you need before you build

A model API that speaks MCP

Use a model API or agent SDK that can call a remote MCP server over Streamable HTTP and send an Authorization header. OpenAI's Responses API, Anthropic's Messages API MCP connector and the Claude Agent SDK all can. You pay your model provider for the model's usage.

A League Loom connection token

The setup wizard gives you a token for the leagues you chose. It is free, with fair-use request budgets. Staging or preview tokens do not open on the production server. If you edit and save your setup later, replace the older token in your agent.

Your league's access details

Sleeper needs only a username or league URL. Public ESPN leagues need a URL, and private ones also need espn_s2 and SWID cookies. Fantrax needs a league URL; private Fantrax leagues need your session cookie for matchup scores and transactions. Enter these only on League Loom's setup page.

Get connected

From your league to your AI tool

1

Choose your leagues

Open the League Loom setup wizard, pick Fantrax, ESPN or Sleeper, and load your leagues. Leave the personal team unselected for a league-wide bot, or select one for an assistant that advises a single team. Finish setup and copy your connection token.

2

Store the token as a secret

Save the token as an environment variable or secret in your bot's host, for example LEAGUE_LOOM_TOKEN. It works like a password. Never put it in the server URL, a prompt, a repository or a screenshot.

3

Point your model at the server

Add https://leagueloom.com/mcp as a remote MCP server in your model's API or SDK and send the token as a Bearer token. Allow only the League Loom tools your agent needs, then ask it to list your connected leagues to confirm the connection.

Remote connector URL

https://leagueloom.com/mcp

Add this URL in your AI tool, then follow the guided setup.

Open setup wizard →

Worked example

From an empty folder to a weekly recap

Illustrative build order. The same steps produced the Robby Slack bot described in the case study.

  1. Start with one question

    Ask your agent who leads the league and who plays whom this week. If it answers from fantasy_get_standings and fantasy_get_matchups, the data path works.

  2. Add your league's rules

    Load the rulebook text into the instructions and tell the model to cite the exact rule it relies on. Keep rules and live data separate so it can flag a conflict between them.

  3. Give it a home and a schedule

    Wire the agent to a Slack command or a chat mention, then add a scheduled job for the weekly recap or a waiver reminder. Keep the job league-wide so it suits everyone in the channel.

More about this connection

An agent is only as good as the data it can reach. Fantasy platforms change their sites and private endpoints often, and private leagues need cookies or session values that a scraper has to manage.

League Loom does that work once, behind one MCP server, so your agent calls named tools such as fantasy_get_standings instead of parsing pages. It reports what each platform returns and flags what it cannot read.

Coverage still differs by platform and sport, so check the capabilities page before you promise a feature to your league.

The big picture

How a fantasy agent works, in four boxes

Every fantasy agent is the same loop: someone asks, the model fetches live league data, and the answer lands where your league already talks. League Loom is the box that turns Fantrax, ESPN and Sleeper into tools a model can call.

From your league to your league chat
  1. Where the data lives

    Your leagues

    Rosters, scores, standings and waivers sit in Fantrax, ESPN and Sleeper.

    • Fantrax
    • ESPN
    • Sleeper
  2. The data layer

    League Loom

    One MCP server URL turns those leagues into named, read-only tools.

    • fantasy_get_standings
    • fantasy_get_matchups
    • fantasy_get_available_players
  3. The brain

    Your model

    Any model API that speaks MCP calls the tools it needs, with your league's rules in its instructions.

    • OpenAI
    • Claude
    • Your rulebook
  4. Where it answers

    Your league chat

    Your code posts the answer wherever the league already talks, on demand or on a schedule.

    • Slack
    • Discord
    • Weekly recap

Your code owns the first and last mile: it receives the question and posts the answer. League Loom never posts anywhere or changes a team.

Pick a shape

Three kinds of fantasy agent you can build

Most fantasy agents are one of three shapes. They share the same data connection and differ in who asks the questions and when the agent speaks.

Illustrative conversations with made-up teams, not real league answers

A league bot in Slack or Discord

Answers anyone in the league channel about standings, matchups, transactions, waivers and rules. Leave the personal team unselected at setup so answers stay league-wide.

#league-chat

Jordan

@leaguebot who's in first, and who do they play this week?

League bot

Taco Tuesday leads at 8 and 1. This week they face Waiver Wire Wizards, who are 6 and 3 and won three straight.

A scheduled league newsletter

Runs on a timer and posts the weekly recap, a waiver reminder before the deadline or a matchup preview. A cron job calls your agent with a fixed prompt and posts the answer.

#league-chat · Tuesday 9:00 AM

League bot

Week 9 recap: the Wizards won by 2.4 points on a Monday night field goal, and three teams are tied for the last playoff spot. Waivers run Wednesday at 3 AM.

A personal team assistant

Advises one manager on start/sit, waiver and trade decisions for the selected team. It can read every league you connected, across platforms and sports.

Direct message

You

Anything I should change before Sunday?

Assistant

Your flex starter is questionable. Two backups on your bench are active, and the best available receiver in your league is worth a look.

Sports

Which sports your agent can cover

League Loom reads 10 sports across three platforms. Fantrax goes furthest: besides the four big pro leagues it reads college football, college basketball, Premier League soccer, PGA golf and NASCAR leagues, so the same bot pattern works for a college football league or a golf league.

Sports League Loom reads, by platform
Fantrax
  • NFL
  • NBA
  • MLB
  • NHL
  • College football
  • College basketball
  • Premier League soccer
  • PGA golf
  • NASCAR
ESPN
  • NFL
  • NBA
  • MLB
  • NHL
  • WNBA
Sleeper
  • NFL
  • NBA

Only on Fantrax

In college, soccer, golf and NASCAR leagues the agent works from what Fantrax returns, and injury notes may be missing. The capabilities page lists what each platform returns.

OpenAI

Connect League Loom from the OpenAI Responses API

The Responses API accepts a remote MCP server as a tool. Give it the League Loom URL, pass your token in the authorization field, and list the tools your agent may call.

OpenAI's guide says it does not store the authorization value, so send it with every request.

Node.js, OpenAI Responses API with League Loom as a remote MCP tool
import OpenAI from "openai";

const client = new OpenAI();

const response = await client.responses.create({
  model: "YOUR_MODEL",
  input: "Who leads the league, and who plays whom this week?",
  tools: [
    {
      type: "mcp",
      server_label: "league_loom",
      server_url: "https://leagueloom.com/mcp",
      // The token from leagueloom.com/setup, kept in a secret, never in the URL.
      authorization: process.env.LEAGUE_LOOM_TOKEN,
      allowed_tools: ["fantasy_get_standings", "fantasy_get_matchups"],
      require_approval: "never",
    },
  ],
});

console.log(response.output_text);

Replace YOUR_MODEL with a model that supports remote MCP tools. allowed_tools keeps the agent to the league data it needs.

Claude API

Connect League Loom from the Claude API

Anthropic's Messages API connects to remote MCP servers through its MCP connector, a beta that needs the mcp-client-2025-11-20 beta header. Name the server in mcp_servers with your token as authorization_token, and add a matching mcp_toolset. The connector supports tools, which is all League Loom needs.

Node.js, Anthropic Messages API with the MCP connector
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();

const message = await client.beta.messages.create({
  model: "YOUR_MODEL",
  // Tool calls and a full answer share this budget, so leave plenty of room.
  max_tokens: 16000,
  betas: ["mcp-client-2025-11-20"],
  messages: [{ role: "user", content: "Which free agents fit my roster best?" }],
  mcp_servers: [
    {
      type: "url",
      url: "https://leagueloom.com/mcp",
      name: "league_loom",
      authorization_token: process.env.LEAGUE_LOOM_TOKEN,
    },
  ],
  tools: [{ type: "mcp_toolset", mcp_server_name: "league_loom" }],
});

for (const block of message.content) if (block.type === "text") console.log(block.text);

To allow only some tools, set default_config enabled to false on the toolset and enable each tool you want under configs.

Claude Agent SDK

Connect League Loom from the Claude Agent SDK

The Claude Agent SDK takes remote MCP servers in its mcpServers option, with the token in an Authorization header. MCP tools need explicit permission, so list the League Loom tools in allowedTools by their full mcp__ names.

TypeScript, Claude Agent SDK with League Loom over HTTP
import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "Write this week's league recap from the standings and matchups.",
  options: {
    mcpServers: {
      league_loom: {
        type: "http",
        url: "https://leagueloom.com/mcp",
        headers: { Authorization: `Bearer ${process.env.LEAGUE_LOOM_TOKEN}` },
      },
    },
    allowedTools: ["mcp__league_loom__fantasy_get_standings", "mcp__league_loom__fantasy_get_matchups"],
  },
})) {
  if (message.type === "result" && message.subtype === "success") console.log(message.result);
}

A wildcard such as mcp__league_loom__* also allows the tool that publishes a shareable league page, so list tools by name if your agent should only read.

Guardrails

Rules that keep a fantasy agent trustworthy

A league will forgive a slow bot but not a confident wrong one. These rules come from running a league bot all season.

Live data from tools only

Tell the model to call League Loom whenever an answer depends on current rosters, scores or waivers, and never to guess them.

Cite the rule

When an answer rests on your rulebook, have the agent name the exact rule or section heading, so managers can check it.

Say what is missing

Ask the agent to name data a platform did not return rather than fill the gap, for example scores in a private Fantrax league without a session cookie.

Keep moves with managers

League Loom's league tools retrieve and analyze. Lineups, waiver claims and trades stay in the fantasy app, made by the manager.

What League Loom does not do for an agent

  • It does not host your bot, post to Slack or Discord, or run your schedule. Your code does that.
  • It does not set lineups, submit waiver claims or accept trades.
  • It reads only the platforms and sports listed on the capabilities page, and coverage differs between them.
  • Requests have fair-use budgets, so a bot that polls every minute is the wrong design. Ask when someone asks, or on a schedule.

Sources checked . The code follows each vendor's own documentation as published on the date above. League Loom's side, the server URL and the Bearer token from /setup, follows our current implementation. Model names change often, so the samples use a placeholder.

OpenAI: remote MCP servers in the Responses API · Anthropic: the MCP connector in the Messages API · Claude Agent SDK: connect to MCP servers

Before you connect

Questions, answered

What is a fantasy sports AI agent?

A fantasy sports AI agent is a program that uses a language model plus live league data to answer questions or take on routine league chores, such as posting a weekly recap, reminding managers about the waiver deadline or explaining a rule. The model writes the answer; a data source such as League Loom supplies the current rosters, standings and matchups it answers from.

Do I have to scrape ESPN, Sleeper or Fantrax to build one?

No. League Loom is a free MCP server that reads Fantrax, ESPN and Sleeper leagues and returns structured results through named tools. Your agent calls those tools instead of scraping pages or managing each platform's private endpoints.

Which AI models can use League Loom in a custom agent?

Any model API or agent framework that can call a remote MCP server over Streamable HTTP and send an Authorization header. OpenAI's Responses API, Anthropic's Messages API MCP connector and the Claude Agent SDK are documented examples. The model choice is yours.

How does my agent authenticate to League Loom?

Complete the setup wizard at leagueloom.com/setup, copy the connection token, and send it as a Bearer token in the Authorization header (the authorization or authorization_token field in the OpenAI and Anthropic APIs). Use https://leagueloom.com/mcp as the server URL and never add the token to it. Treat the token like a password.

Can a commissioner build one bot for the whole league?

Yes. Leave the personal team unselected during setup and the tools answer league-wide: standings, every roster, the full scoreboard, transactions and the available-player pool. The Robby case study is a league-wide Slack bot built this way.

Can my agent make roster moves?

Not through League Loom. Its league tools retrieve and analyze data. Your agent can recommend a lineup, a waiver claim or a trade, and the manager makes the move in the fantasy app.

Is League Loom free for agents?

Yes. There is no paid tier, subscription or per-league fee, and fair-use request budgets apply. You pay your model provider for model usage and your host for running the bot.

Before you connect a league, read how League Loom is built, what the privacy policy says is stored, the terms of service and the full FAQ, or check the press kit with key facts and who builds it.