liga-record-mcp
# Liga Record MCP
An MCP server I built to learn how the Model Context Protocol works, on a problem I actually have: managing my team in [Liga Record](https://liga.record.pt), the fantasy football game of Record, a Portuguese sports newspaper. The design rests on one split: the rulebook is arithmetic, so it lives in Python as pure functions (legal formations, the €40M budget, automatic substitutions), while judgement, like who to start or who to sell, stays with Claude. Claude gets 27 tools, 3 prompts for the weekly routine and the regulation as a resource generated from the same constants the code enforces, and every read carries an `as_of` timestamp so Claude can tell stored data from live data. The server is read-only on purpose: the site's buy and sell endpoints are known but not implemented, and a test checks it stays that way, so a transfer is always a human click. It later grew a points model, and a scheduled GitHub Action records its predictions before every round and scores them afterwards, so the model is only judged on calls made in advance.
## Run it
```bash
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
.\.venv\Scripts\python.exe -m pytest -q
```
The editable install creates the `liga-record-mcp` launcher that `.mcp.json` points at, so Claude Code starts the server when you open this folder. That path is absolute, so edit it after cloning. The squad lives in `data/squad.yaml` (start from `data/squad.example.yaml`), and the loader checks it against the regulation on every read. Then ask something like *"Is my current XI legal, and who comes on if Diogo Costa doesn't play?"*
More on the design in [docs/HOW-IT-WORKS.md](docs/HOW-IT-WORKS.md).
TDQS
Scored across 9 tools
Each tool has a clear and distinct purpose. check_transfer vs check_market_transfer and search_squad vs search_market are differentiated by their descriptions, preventing confusion. The others (get, validate, simulate, project) are uniquely scoped.
All tool names follow a consistent verb_noun pattern (check_transfer, get_squad, search_market, etc.), using lowercase with underscores. No mixed conventions or inconsistent verb usage.
Nine tools cover the core operations of a fantasy football assistant without redundancy. Each tool serves a distinct function, and the count is neither too sparse nor overwhelming for the domain.
The toolset covers reads, searches, validation, simulation, and pricing projections, but lacks an explicit 'execute transfer' or 'update squad' action. However, given the assistant's advisory role, this is a minor gap that doesn't hinder typical workflows.