mcp_espn_ff CLAUDE.md

mcp_espn_ff CLAUDE.md is an instructions file for coding agents from KBThree13/mcp_espn_ff. It costs 812 tokens per session, scanned A, original, MIT.

Repository instructions for an MCP server that lets AI assistants use the ESPN Fantasy Football API. MCP is a standard way for AI clients to call external tools.

In plain words
What is it for?
Use them to start and test the server, understand its single-file structure, manage league sessions, and connect it to an MCP client.
Why use it?
They explain how the server works and how to run it, including handling credentials and separating public from private leagues.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/kbthree13/mcp_espn_ff/claude-md
Clone the repo
git clone --depth 1 https://github.com/KBThree13/mcp_espn_ff

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp_espn_ff CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/kbthree13/mcp_espn_ff/claude-md.svg)](https://agentmods.dev/instructions/kbthree13/mcp_espn_ff/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/kbthree13/mcp_espn_ff/claude-md"><img src="https://agentmods.dev/badge/instructions/kbthree13/mcp_espn_ff/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 812 This file is loaded in full into every session.
When invoked 812 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00812 $0.00812
Opus 5 $0.00406 $0.00406
Sonnet 5 $0.00162 $0.00162
Haiku 4.5 $0.00081 $0.00081

Measured 4d ago against content hash da805a8aa57d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp_espn_ff CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is an MCP (Model Context Protocol) server that provides LLMs like Claude with tools to interact with the ESPN Fantasy Football API. The server wraps the espn-api Python library and exposes its functionality through MCP tools.

Running the Server

The server is designed to be run by MCP clients like Claude Desktop. To test locally:

uv run espn_fantasy_server.py

Architecture

Single-File MCP Server

The entire server implementation is in espn_fantasy_server.py. It uses the FastMCP framework to define MCP tools.

Core Components

  1. ESPNFantasyFootballAPI Class (lines 29-72)

    • Manages ESPN league instances with caching
    • Handles per-session credential storage (ESPN_S2 and SWID cookies)
    • Uses cache keys that include authentication info to support both public and private leagues
  2. Session Management

    • Uses a simple SESSION_ID = "default_session" approach
    • Credentials are stored in memory per-session in the api.credentials dict
    • League instances are cached with keys that include auth info: {league_id}_{year}_{espn_s2}_{swid}
  3. Football Year Logic (lines 23-25)

    • Defaults to current calendar year
    • If before July, uses previous year (since NFL season spans calendar years)

MCP Tools

The server exposes 8 tools (all async functions decorated with @mcp.tool()):

  • authenticate() - Store ESPN credentials for accessing private leagues
  • get_league_info() - Basic league information
  • get_team_roster() - Player roster for a specific team
  • get_team_info() - Team statistics and transaction info
  • get_player_stats() - Stats for a specific player by name
  • get_league_standings() - Current standings sorted by wins/points
  • get_matchup_info() - Weekly matchup details
  • logout() - Clear stored credentials

Error Handling

All tools:

  • Use try/except blocks with logging to stderr via log_error()
  • Check for 401 errors or "Private" in exceptions to detect private league access issues
  • Return user-friendly string messages (not JSON) since MCP converts them

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 89 lines · 812 tokens per session scan A da805a8aa57d

Subscribe to this mod's changes

mcp_espn_ff CLAUDE.md is an instructions file published in the GitHub repository KBThree13/mcp_espn_ff (41 stars, last pushed 8mo ago), licensed MIT. It adds 812 tokens to every session, about $0.0041 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.