worldcup-ai-forecaster
An MCP server that enables LLMs to act as World Cup forecasting agents, pulling live odds, getting model forecasts, and simulating tournament brackets via natural language.
README
⚽ World Cup AI Forecaster
Can a time-series "foundation model" predict the 2026 FIFA World Cup? A hands-on, honest case study in when modern AI helps a prediction problem — and when a 50-year-old algorithm does just as well.
I tried to forecast the 2026 World Cup with the AI everyone's hyping — a foundation model (Google's TimesFM) that predicts any series of numbers, zero training required. A football rating formula from the 1960s (Elo) beat it. Then one small change — feeding it a smoother signal — flipped it from worst to best. The real twist: do it right, and everything ties — the old formula, the cutting-edge AI, a trained meta-model, even the live betting market — all jammed against the same ceiling.
📝 Read the full story:
docs/article.md· 🔬 Methodology:docs/METHODOLOGY.md· 📊 All results:docs/RESULTS.md
The one finding, in one chart
Same foundation model, two different inputs. Fed raw goal counts it's the worst model; fed a smooth signal (each team's Elo trajectory) the identical model becomes the best. The representation mattered more than the model.

What this is
A complete, reproducible forecaster for the 2026 World Cup that:
- Forecasts every match (win / draw / loss + expected score) from team strength,
- Simulates the whole tournament (groups → the official 48-team bracket → champion) via Monte-Carlo,
- Validates live against games already played and against a real prediction market (Polymarket),
- Pits a TimesFM foundation model against honest classical baselines (Elo, Dixon-Coles Poisson), a trained meta-model, and TabPFN (a tabular foundation model),
- Ships an MCP server so any LLM can use it as a forecasting agent.
Everything runs on free, no-key data (match history + fixtures from one public CSV; optional Polymarket odds from a public API).
Quickstart
git clone https://github.com/tpomerance/worldcup-ai-forecaster.git && cd worldcup-ai-forecaster
python -m venv .venv && source .venv/bin/activate
# install torch for your hardware first (https://pytorch.org), then:
pip install -r requirements.txt
# 1) pull data + show live group standings
python -m src.ingest
# 2) honest backtest: TimesFM vs Elo vs Poisson vs blend (add --timesfm)
python -m src.evaluate --timesfm
# 3) predict upcoming matches / a single match / the whole tournament
python predict.py --next 6
python predict.py --match "Spain vs Morocco"
python predict.py --simulate --sims 10000
# 4) full illustrated report (Markdown + PDF) and the figures
python -m src.report
python -m src.make_pdf
# tests
python tests/test_sanity.py
The forecaster's current call
| Model (simulation) | Live market (Polymarket) | |
|---|---|---|
| Favorite | Argentina ~30% | France ~18% |
| Then | Spain · France · England | Argentina · Spain · England |

(Numbers update as the tournament progresses — re-run python refresh.py.)
How well does it actually do?
Validated pre-kickoff on games already played, scored with RPS (lower = better):
| RPS | vs | |
|---|---|---|
| Our model | 0.168 | — |
| Polymarket (the market) | 0.152 | sharper (markets are hard to beat) |
| Clueless (1/3 each) | ~0.24 | we're far better than chance |
The model and the market agree on ~all match picks; its misses are genuine upsets that fooled the market too. See docs/RESULTS.md for the full tables and the surprise analysis.

Project structure
worldcup-ai-forecaster/
├── src/
│ ├── ingest.py # data: results + fixtures + live standings (no API key)
│ ├── elo.py # World-Football Elo ratings
│ ├── features.py # time-decayed attack/defense + per-team series
│ ├── match_model.py # Dixon-Coles / Poisson → W/D/L, scorelines
│ ├── forecast.py # TimesFM forecasting (goals & Elo trajectory)
│ ├── baselines.py # Elo, last-value Poisson, market-implied
│ ├── odds.py / polymarket*.py # bookmaker + Polymarket (champion & per-match)
│ ├── blend.py / meta_model.py # ensemble + trained stacker + TabPFN
│ ├── evaluate.py / validate_live.py # backtests & live validation (RPS/Brier)
│ ├── simulate.py / bracket2026.py # Monte-Carlo over the official bracket
│ ├── report.py / make_pdf.py / export_figures.py # reporting & figures
│ └── ...
├── predict.py # CLI: --match / --next / --simulate / --report
├── refresh.py # daily refresh of data + report + figures
├── polymarket_mcp.py # MCP server → LLM forecasting agent
├── agent_run.py # run the agent over the MCP tools
├── tests/ # sanity tests
├── docs/ # article, methodology, results, MCP/agent guide
└── assets/ # figures
The forecasting agent (MCP)
polymarket_mcp.py exposes the data + model + simulator as MCP tools, so any
MCP-capable LLM client becomes a World Cup forecasting agent — pull live
odds, get a model forecast, and simulate the bracket in plain English. Full
wiring and an honest take on what the agent does (it relays the market, it
doesn't out-predict it) in docs/MCP_AGENT.md.
Honest disclaimer
This is a study in forecasting methodology, not betting advice. The headline lesson is deliberately un-hyped: a foundation model is a tool with a shape — match it to the problem and it helps; otherwise a one-line baseline wins. The market remains the sharpest forecaster, and beating it is not the goal.
Acknowledgements
- Google Research — TimesFM
- martj42/international_results — match data
- Polymarket public API — prediction-market odds
- Prior Labs — TabPFN
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。