The Model Context Protocol is how an assistant calls something outside itself. This server implements it over stdio, as a package the client downloads and runs locally, so there is nothing to host and nothing to authorise a second time: it reads the same PITCHAPI_API_KEY you already use and sends the same X-API-KEY header to the same base URL.
Nine tools cover the reference, each mapping onto one to four endpoints — a league search, a date or a season of fixtures, a match, its shots, its box score, its analytics, its lineups, and the live snapshot. One resource carries the metric glossary as markdown. The tools are deliberately coarse: a model chooses between get_match_shots and get_match_analytics, not between sixteen endpoints it has to already understand.
Every response is trimmed on the way through. A live snapshot is about 50 kB from the API and under 3 kB after the per-player stat lines and the duplicate lineup object are removed, which is the difference between a usable answer and a truncated one. Nothing is recalculated: the numbers are the pipeline's.
The server is part of the Pro and Data plans. A free key still reaches every data endpoint over HTTP, but an MCP request is refused with 403 PLAN_UPGRADE_REQUIRED naming the feature, so the assistant is a paid integration rather than a way around the API.
Add it to your assistant
The server is a local process the client starts for you, so there is no hosted endpoint to trust and no OAuth flow: it takes the same X-API-KEY header as every other request and calls api.pitchapi.dev directly. Node 20 or newer, and a Pro or Data key, because the server is one of the paid features.
{
"mcpServers": {
"pitchapi": {
"command": "npx",
"args": ["-y", "pitchapi-mcp"],
"env": { "PITCHAPI_API_KEY": "pk_live_..." }
}
}
}claude mcp add pitchapi \ --env PITCHAPI_API_KEY=pk_live_... \ -- npx -y pitchapi-mcp
{
"servers": {
"pitchapi": {
"type": "stdio",
"command": "npx",
"args": ["-y", "pitchapi-mcp"],
"env": { "PITCHAPI_API_KEY": "pk_live_..." }
}
}
}On Windows, wrap the command as cmd with /c npx -y pitchapi-mcp. Claude Desktop reads claude_desktop_config.json from Settings → Developer → Edit Config; Cursor reads ~/.cursor/mcp.json, same mcpServers shape. Anything else that speaks MCP over stdio — Zed, an editor extension, your own client — starts the same binary. The source is pitchapi/mcp on GitHub, the package is pitchapi-mcp on npm, and the entry in the official MCP registry is dev.pitchapi/mcp — which is where hosted clients will look for it.
What the model can call
Nine tools and one resource. Every response is trimmed before the model reads it — image URLs, the per-player stat lines inside a live snapshot and the graph measures of a pass network all go, which is what keeps a live match under 3 kB instead of 50.
find_league- Search the 77-league catalogue by name or country code. Returns the opaque l_ IDs the other tools take.
list_matches- Fixtures and results for one date, or across a competition's season with an optional from/to window and a row limit.
get_match- One match: sides, score, status, kickoff, season, round name, referee and stadium.
get_match_stats- The box score — possession, shots, corners, fouls, cards, duels — including for matches with no analytics.
get_match_shots- Every shot with pitch coordinates and xG, in order, extra time included. The only source of goal times.
get_match_analytics- xT, VAEP, PPDA, field tilt, xG chain, xG buildup, pass networks and momentum, behind an include list.
get_lineups- Formations, starting elevens, benches and coaches, with the confirmed-versus-predicted distinction intact.
get_live_match- The live snapshot: clock, score, who is on the pitch, and the full event list while the match is in play.
get_metric_definition- What a metric means and where our definition differs from the usual one. Answers from the packaged glossary.
pitchapi://metrics- The whole metric glossary as markdown, for clients that expose resources to the model rather than only tools.
Calls spend the same quota as a curl request, against the same key: 1,200 requests a minute on Pro, and 600 live snapshots a minute, so a model polling a match can poll every ten seconds and stay well inside it. An analytics question with all four parts selected is four requests.
A metric that was never computed stays null rather than becoming zero, and a match that was never rated returns no analytics at all — reported as which parts are missing, not as a failed call. The scoreline, shots and box score are still there.
The raw event feed and the heatmaps are deliberately absent: both are large, and neither reads well inside a conversation. A finished match has no minute-by-minute timeline either, so goal times come from the shotmap. For those payloads, call the REST endpoints directly.
Common questions
- Which plan includes the MCP server?
- Pro and Data. The gate reads the client, not the endpoint: the server identifies itself in its User-Agent, and a request carrying it from a free key is refused with 403 PLAN_UPGRADE_REQUIRED. Upgrade and the same key works — nothing to reinstall.
- Is there a hosted MCP endpoint?
- No. The server runs on your machine as a local process the client spawns, and it talks to the ordinary REST API. That keeps your key off a third party's servers and means there is no session, no OAuth flow and no proxy to be a bottleneck.
- Does it spend the same quota as the API?
- Yes — same key, same allowances: 15,000 requests a day and 600 a minute on the free plan, and 60 live snapshots a minute. An analytics question with all four parts selected is four requests.
- Which clients work?
- Anything that speaks MCP over stdio: Claude Desktop, Claude Code, Cursor, VS Code, Zed and editor extensions. The configuration is a command and an environment variable, and the page has a copy-paste block for each.
- Why are events and heatmaps missing?
- Both are large payloads that read badly inside a conversation. A finished match also has no minute-by-minute timeline, so goal times come from the shotmap rather than an event feed. Use the REST endpoints directly when you need those documents.
- What does an unrated match look like?
- The analytics parts come back empty and the tool says which ones, rather than failing. The scoreline, shots and box score are still served, so the assistant can answer the question that is actually answerable.