Skip to main content
Glama
Eduardo-Lucas

worldcup-2026-mcp

README.md
# ⚽ FIFA World Cup 2026 β€” MCP Server & Dashboard

An MCP server built with **FastMCP** to query FIFA World Cup 2026 data directly from any AI compatible with the MCP protocol (Claude, Cursor, etc.), plus a **Streamlit dashboard** for standalone use.

Data is sourced from [openfootball/worldcup.json](https://github.com/openfootball/worldcup.json) β€” open source, no API key required.

## πŸš€ Available Tools

| Tool | Description | Parameters |
|------|-------------|------------|
| `recent_matches` | Scores from the most recent matches | `count` (default: 5) |
| `upcoming_matches` | Upcoming scheduled matches | `count` (default: 5) |
| `group_standings` | Standings for a specific group | `group` (A–L) |
| `search_team` | Full info for a team: group, stats, and all matches | `team_name` (in English) |
| `all_groups` | Summary of all 12 groups | β€” |
| `cup_statistics` | Goals, averages, top scorers, and highlights | β€” |

## πŸ“¦ Installation

```bash
git clone https://github.com/Eduardo-Lucas/worldcup-2026-mcp
cd worldcup-mcp

pip install fastmcp httpx streamlit
```

## πŸ–₯️ Streamlit Dashboard

A visual dashboard with English/Portuguese language switching (πŸ‡ΊπŸ‡Έ / πŸ‡§πŸ‡·):

```bash
streamlit run src/app.py
```

Open [http://localhost:8501](http://localhost:8501) in your browser.

**Pages:**
- πŸ† Recent Matches β€” scores and goal scorers
- πŸ“… Upcoming Matches β€” schedule with venues
- πŸ“Š Standings β€” all 12 groups with W/D/L/GF/GA/GD
- πŸ” Team Search β€” full team history and upcoming fixtures
- πŸ“ˆ Statistics β€” top scorers, biggest win, goals per game

## βš™οΈ MCP Server β€” Claude Code

```bash
claude mcp add worldcup-2026 python -- -m src.server
```

## βš™οΈ MCP Server β€” Claude Desktop

Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "worldcup-2026": {
      "command": "python",
      "args": ["-m", "src.server"],
      "cwd": "/absolute/path/to/worldcup-mcp"
    }
  }
}
```

Restart Claude Desktop. The tools will be available automatically.

## πŸ’¬ Usage Examples

Once connected, ask Claude:

- *"What were yesterday's World Cup results?"*
- *"How is Brazil doing in the standings?"*
- *"Show me Group C table"*
- *"Who are the top scorers so far?"*
- *"What are Brazil's upcoming matches?"*

## πŸ§ͺ Tests

```bash
pip install pytest pytest-asyncio
pytest tests/ -v
```

## πŸ—οΈ Project Structure

```
worldcup-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ server.py          # MCP server (FastMCP tools)
β”‚   └── app.py             # Streamlit dashboard
β”œβ”€β”€ tests/
β”‚   └── test_server.py     # Tool unit tests
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ claude_desktop_config.json
└── README.md
```

## πŸ“ How It Works

- **`@mcp.tool()`** β€” exposes Python functions as AI tools
- **Docstrings** β€” become the tool description the AI reads
- **Type hints** β€” define the parameter schema
- **`mcp.run()`** β€” starts the server over stdio
- **Standings** β€” calculated dynamically from match results (no separate endpoint needed)
- **Placeholder resolver** β€” knockout stage codes like `W73`, `1G`, `3A/B/C/D/F` are automatically resolved to real team names as results come in

---

Built with [FastMCP](https://github.com/jlowin/fastmcp) Β· Data: [openfootball/worldcup.json](https://github.com/openfootball/worldcup.json)