mcp-tennis
# mcp-tennis 🎾
An MCP server for professional tennis data: player profiles, head-to-heads, recent matches, and ATP rankings. Ask your AI assistant things like:
- *"What's the head-to-head between Sinner and Alcaraz?"*
- *"Show me Zverev's last 10 matches."*
- *"Who are the top 20 men's players right now?"*
- *"Who are Spain's best players?"*
The data comes from a [pipeline](https://github.com/mileslander/tennis-data-pipeline) that rebuilds the database daily. The server keeps a local copy and checks for a newer one each time it starts.
<!-- mcp-name: io.github.mileslander/tennis-mcp -->
## Install
You need [uv](https://docs.astral.sh/uv/getting-started/installation/). Nothing else needs installing or cloning.
**Claude Code**
```sh
claude mcp add tennis -- uvx mcp-tennis
```
**Claude Desktop** and other MCP clients: add this to your MCP config (for Claude Desktop, `claude_desktop_config.json`):
```json
{
"mcpServers": {
"tennis": {
"command": "uvx",
"args": ["mcp-tennis"]
}
}
}
```
On first start the server downloads the database (about 110 MB). Tools ask you to retry while that's in progress. After that, it only downloads again when a newer version is published.
## Tools
| Tool | What it does |
| --- | --- |
| `search_player` | Find a player's id by full name. Most other tools take this id. |
| `get_player_profile` | Birthdate, height, nationality, playing hand, backhand, coaches, and more. |
| `head_to_head` | Career head-to-head record between two players (ATP and WTA). |
| `recent_matches` | A player's most recent matches, optionally up to a given date (ATP only). |
| `current_ranking` | A player's current ATP ranking and points. |
| `ranking_at_date` | A player's ATP ranking on a given date. |
| `top_n_players` | The ATP rankings from any starting rank, now or at a past date. |
| `best_national_players` | A country's highest-ranked players, by IOC code (e.g. `ESP`, `USA`). |
Every result includes `last_updated` and `latest_tournament_week`, so your assistant can tell you how current the data is. Matches are dated by their tournament's start week, so events still in progress may have partial results.
## Data coverage
- **Matches:** ATP from 1967 and WTA from 1990, through the latest completed tournament week.
- **Rankings:** ATP singles only, from 2026-08-31 onwards. Earlier dates aren't available yet.
## Where the data is stored
The database is kept in your user cache folder:
- macOS: `~/Library/Caches/mcp-tennis/`
- Linux: `~/.cache/mcp-tennis/`
- Windows: `%LOCALAPPDATA%\mcp-tennis\mcp-tennis\Cache\`
Delete it at any time. The server downloads it again on the next start.
## Data sources
- Match and player data: [TennisMyLife](https://stats.tennismylife.org/)
- ATP rankings: the ATP's published rankings
## Development
```sh
git clone https://github.com/mileslander/tennis-mcp
cd tennis-mcp
uv sync
uv run pytest
```
Tests run against a small fixture database built from `tests/data/test_db.sql`, so they don't need the real data or a network connection. To run the server from source, use `uv run mcp-tennis`.
## License
MIT. See [LICENSE](https://github.com/mileslander/tennis-mcp/blob/main/LICENSE).
TDQS
Scored across 8 tools
Each tool targets a distinct query: name→id lookup (search_player), profile by id, head-to-head, country leaders, current vs. historical ranking, top-N list, and recent matches. The closest pair, current_ranking and ranking_at_date, is clearly separated by 'current' vs. 'at a specified date'. No two tools appear to do the same thing.
All names are lowercase snake_case and readable, with consistent verb_noun for the action-style tools (search_player, get_player_profile, best_national_players, top_n_players). Minor deviation: several tools use noun-phrase names (head_to_head, current_ranking, ranking_at_date, recent_matches), but the style is still predictable.
Eight tools is well-scoped for a tennis data server, and each one maps to a distinct query type (search, profile, H2H, country leaders, rankings, matches). No obvious redundancy or filler.
The surface covers player discovery, profiles, rankings (current and historical), top-N and country leaderboards, H2H, and match history — enough for most agent workflows. Gaps remain: recent_matches is ATP-only, and there is no tournament/draw or upcoming-schedule data.