Skip to main content
Glama
lukejbyrne

world-cup-stats-mcp

by lukejbyrne

World Cup Stats MCP

A read-only MCP server that gives compatible AI clients structured access to a World Cup SQLite database. It supports local stdio development and authenticated Streamable HTTP deployment from the same codebase.

AI host
  └── MCP client
        ├── stdio ── local server process
        └── HTTPS ── remote server on Fly.io
                          └── read-only SQLite

Production scope

For this project, production-ready means a private, single-tenant, read-only service with:

  • typed tools and bounded result sizes;

  • read-only database access and safe tool errors;

  • automated data, protocol and authenticated HTTP tests;

  • a health endpoint and structured server logs;

  • a pinned, non-root Docker image;

  • TLS deployment on Fly.io with a pre-shared bearer token.

This is not an OAuth service for arbitrary third-party users. A public, multi-user MCP product should replace the pre-shared token with a real OAuth authorization server and add its own usage limits and monitoring.

Related MCP server: World Cup History MCP

Available tools

  • list_tournaments lists available men’s or women’s tournaments.

  • get_team_history returns a country’s tournament records and totals.

  • get_head_to_head finds World Cup meetings between two countries.

  • get_player_record returns appearances, starts, goals and knockout statistics.

All tools are read-only. The server does not expose arbitrary SQL.

Dataset

The project includes the SQLite edition of The Fjelstul World Cup Database:

  • 22 men’s tournaments from 1930–2022;

  • 8 women’s tournaments from 1991–2019;

  • matches, teams, squads, appearances, goals, cards and standings.

Attribution, licence and the exact checksum are in data/README.md. The database and schema are distributed under CC BY-SA 4.0.

Local setup

Requirements:

  • Python 3.12 or newer;

  • uv;

  • Node.js if using MCP Inspector.

Install the locked dependencies:

cd "/Users/lukebyrne/Documents/builds/world-cup-stats-mcp"
uv sync --no-editable

Run all tests:

uv run --no-editable pytest

Run an ordinary Python query before introducing MCP:

uv run --no-editable python scripts/demo_query.py

Test the local stdio server

Launch MCP Inspector:

npx -y @modelcontextprotocol/inspector \
  uv \
  --directory "/Users/lukebyrne/Documents/builds/world-cup-stats-mcp" \
  run \
  --no-editable \
  world-cup-stats-mcp

In Inspector, open Tools, list the tools and call get_player_record with Kylian Mbappe.

The ready-to-use stdio configuration is in mcp.json.

Test Streamable HTTP locally

Create a temporary token and start the HTTP transport:

export MCP_API_TOKEN="$(openssl rand -hex 32)"
export MCP_TRANSPORT="streamable-http"
export MCP_PUBLIC_BASE_URL="http://127.0.0.1:8000"
export MCP_ALLOWED_HOSTS="127.0.0.1:8000,localhost:8000"
uv run --no-editable world-cup-stats-mcp

The endpoints are:

Health: http://127.0.0.1:8000/health
MCP:    http://127.0.0.1:8000/mcp

In Inspector, select Streamable HTTP, enter the MCP URL and paste the token into Bearer Token. An omitted or incorrect token receives HTTP 401.

The repeatable command-line smoke test is:

MCP_SERVER_URL="http://127.0.0.1:8000/mcp" \
MCP_API_TOKEN="$MCP_API_TOKEN" \
uv run --no-editable python scripts/remote_smoke_test.py

Build the container

The Docker image contains the immutable database snapshot and runs as a non-root user:

docker build -t world-cup-stats-mcp .
docker run --rm \
  -p 8000:8000 \
  -e MCP_API_TOKEN="$MCP_API_TOKEN" \
  -e MCP_PUBLIC_BASE_URL="http://127.0.0.1:8000" \
  -e MCP_ALLOWED_HOSTS="127.0.0.1:8000,localhost:8000" \
  world-cup-stats-mcp

Fly can build the same Dockerfile remotely, so a local Docker daemon is not required for deployment.

Deploy to Fly.io

Install and authenticate Fly’s CLI:

brew install flyctl
fly auth login

The repository contains a checked-in fly.toml. Set the bearer token as a Fly secret, then deploy:

fly secrets set MCP_API_TOKEN="$MCP_API_TOKEN"
fly deploy

Check the deployment:

fly status
fly logs
curl --fail "https://world-cup-mcp-luke.fly.dev/health"

Run the authenticated MCP smoke test:

MCP_SERVER_URL="https://world-cup-mcp-luke.fly.dev/mcp" \
MCP_API_TOKEN="$MCP_API_TOKEN" \
uv run --no-editable python scripts/remote_smoke_test.py

Recording prompts

Start with:

Compare Lionel Messi and Kylian Mbappé’s World Cup records through 2022. Include appearances, starts, total goals, knockout goals, final appearances and final goals. Use only the connected World Cup tools.

Then demonstrate a multi-tool question:

Compare Argentina and France at the men’s World Cup since 1990. Include each team’s tournament record and their head-to-head matches, then give me an evidence-based verdict. Use only the connected World Cup tools.

The second prompt should call get_team_history twice and get_head_to_head once.

Data conventions

  • Match wins and losses follow the source database’s convention. A knockout match decided on penalties counts as a win for the shootout winner.

  • Shootout wins and losses are also returned separately.

  • Own goals are excluded from personal goal totals.

  • Germany and West Germany remain separate source teams.

  • SQLite is opened with mode=ro and PRAGMA query_only.

  • Set WORLDCUP_DB_PATH only when moving the database file.

Available Tools

4 tools
get_head_to_headB

Find every World Cup meeting between two countries and aggregate the results.

ParametersJSON Schema
NameRequiredDescriptionDefault
genderNomen
team_aYesFirst country to compare.
team_bYesSecond country to compare.
to_yearNo
from_yearNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
genderYes
team_aYes
team_bYes
matchesYes
summaryYes
to_yearYes
from_yearYes

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose all behavioral traits. It mentions 'aggregate the results' but does not explain the aggregation method (e.g., win/loss/draw counts) or other behaviors like data freshness, read-only status, or rate limits. The statement 'every World Cup meeting' clarifies scope but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is front-loaded with the core action and resource. There is no redundant information; every word contributes to the purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description does not need to detail return values. However, it lacks context on the aggregation nature (e.g., summary statistics) and does not mention the optional parameters or their defaults. It is minimally complete for a simple tool but could be more informative.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 40% (only team_a and team_b have descriptions). The tool description adds no parameter-specific details beyond the schema, such as clarifying from_year, to_year, or gender usage. It does not compensate for the missing schema descriptions for other parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Find' and resource 'every World Cup meeting between two countries', with 'aggregate the results' specifying the outcome. It distinguishes from sibling tools like get_team_history (single team) and list_tournaments (list tournaments).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a user wants head-to-head history, but provides no explicit guidance on when to use it vs. alternatives (e.g., get_team_history for a single team's matches). No when-not-to-use or prerequisite information is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_player_recordB

Get a player's appearances, starts, goals, and knockout record by tournament.

ParametersJSON Schema
NameRequiredDescriptionDefault
genderNomen
playerYesPlayer name, such as Lionel Messi or Kylian Mbappé.
to_yearNo
from_yearNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
teamsYes
genderYes
playerYes
totalsYes
to_yearYes
from_yearYes
birth_dateYes
tournamentsYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden, but it only states what data is retrieved without mentioning side effects, authentication needs, or rate limits. It does not disclose that this is a read-only operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently conveys the tool's function with no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema is present, so return values need not be described, but the description lacks context for parameter usage and does not mention the optional parameters or default values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 25%, and the description does not explain parameters beyond the minimal information in the schema. The 'by tournament' hint does not clarify the gender or year range parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool retrieves a player's appearances, starts, goals, and knockout record by tournament, using specific verbs and resource. It distinguishes from sibling tools like list_tournaments, get_team_history, and get_head_to_head.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description does not mention any prerequisites or limitations for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_team_historyC

Get a country's tournament-by-tournament record and aggregate World Cup totals.

ParametersJSON Schema
NameRequiredDescriptionDefault
teamYesCountry name, such as Argentina, France, England, or Japan.
genderNomen
to_yearNo
from_yearNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
teamYes
genderYes
totalsYes
to_yearYes
from_yearYes
best_finishYes
tournamentsYes

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description carries full burden but only states purpose. Fails to disclose any behavioral traits like permissions, idempotency, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence is concise and front-loaded. However, could include a brief note on parameters without sacrificing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, the description lacks context for filtering (year range, gender) and does not mention the output structure. Minimal completeness for a moderately complex tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is low (25%), and description adds no parameter-specific context. The only parameter description in schema is for 'team'; description omits details about gender, date range, or defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'Get' and specific resource: a country's tournament-by-tournament record and aggregate World Cup totals. Unambiguously distinguishes from sibling tools like list_tournaments and get_head_to_head.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. Does not mention prerequisites, filters, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tournamentsC

List the World Cup tournaments available in the local database.

ParametersJSON Schema
NameRequiredDescriptionDefault
genderNomen

Output Schema

ParametersJSON Schema
NameRequiredDescription
countYes
genderYes
tournamentsYes

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states a simple list operation. It does not disclose pagination, ordering, or whether the output includes full tournament details. The existence of an output schema helps but the description adds no behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, but it sacrifices necessary detail. It is appropriately front-loaded but lacks parameter and behavioral information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, output schema exists), the description should at least mention the gender filter and the type of data returned. It fails to do so, making it incomplete for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the description does not mention the 'gender' parameter at all. The agent receives no explanation of what the parameter does, despite it having an enum and default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List'), resource ('World Cup tournaments'), and scope ('in the local database'). It distinguishes from sibling tools which focus on teams, head-to-head, and players.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description does not mention any prerequisites, filtering options beyond what's implied, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.2.0
    • First observedget_head_to_head
    • First observedget_player_record
    • First observedget_team_history
    • First observedlist_tournaments

TDQS

B3.3/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: listing tournaments, team history, head-to-head matchups, and player records. No overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (list_tournaments, get_team_history, get_head_to_head, get_player_record), using 'get' for data retrieval and 'list' for enumeration.

Tool Count4/5

With 4 tools, the server is slightly under-scoped for a World Cup stats domain, but each tool covers a meaningful query. The count is reasonable and not problematic.

Completeness3/5

The tool surface covers team history, head-to-head, and player records, but lacks individual match details or tournament standings, which are notable gaps for a stats MCP.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    MCP server for FIFA World Cup 2026 data: matches, teams, venues, city guides, fan zones, visa info, injuries, odds, standings, bracket, and historical matchups. 18 tools, zero external API dependencies.
    18
    529
    34
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Exposes sqlite3 database functionality as MCP tools, enabling SQL query execution, schema management, and CRUD operations.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides comprehensive SQLite database interaction through MCP, enabling CRUD operations, custom SQL queries, and database exploration.
    545
    127
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lukejbyrne/world-cup-stats-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server