quiniela-mcp
v0.1.0
Published
MCP server for the FIFA World Cup 2026 quiniela + prediction markets — lets agents make predictions and trade markets.
Maintainers
Readme
World Cup 2026 — Quiniela + Prediction Markets
Two completely separate games in one dark, Polymarket-styled app:
- Quiniela — free score-prediction pool with stage-weighted scoring, Jokers, perfect-round and champion bonuses, a live leaderboard, and a dynamic knockout bracket.
- Prediction Markets — a peer-to-peer binary (YES/NO) exchange played with admin-granted credits, settled at the end of the tournament.
- Backend — FastAPI + SQLite + JWT auth (
backend/) - Frontend — React + Vite SPA, dark themed (
frontend/)
Quick start
Backend
cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --reloadAPI + Swagger docs at http://localhost:8000/docs. A seed admin (admin / admin123),
sample teams and matches across every stage are created on first startup.
Frontend
cd frontend
npm install
cp .env.example .env
npm run devApp at http://localhost:5173 (it proxies /api to the backend).
How scoring works
See backend/app/scoring.py and backend/app/bonuses.py.
Per match — accuracy scaled by a stage multiplier (group ×1 … final ×5):
| Result | Base points | |---|---| | Exact scoreline | 3 | | Correct outcome (win/draw/loss) | 1 | | Wrong | 0 |
match_points = round(base × stage_multiplier), then ×2 if you played your Joker on it.
Bonuses
- 🃏 Joker — one per group (and one per knockout round); doubles that match's points.
- 🎯 Perfect round — get every game in a group (or a full knockout round) correct → +5.
- 🏆 Champion — correctly pick the tournament winner → +10 (locks at first kickoff, or whenever the admin locks it).
All constants live in scoring.py and are easy to tune.
Data
Seeded from the real 2026 World Cup final draw (5 Dec 2025): 48 teams across Groups A–L with country flags (via flagcdn.com) and all 72 group-stage fixtures. Results are blank until entered.
Pages
Quiniela
- Predict — picks grouped by group → matchday, each with a live countdown + lock; one Joker per round; a champion picker. Once a match locks, reveal everyone's picks.
- Groups — live standings tables: P / W / D / L / GF / GA / GD / Pts.
- Bracket — knockout slots that populate dynamically; admins assign teams as they qualify (no preselection); predictable once both teams are set.
- Leaderboard — live, with a points breakdown (match / 🎯 / 🏆 / total).
- Profile — your stats.
Prediction Markets (credits, separate)
- Markets — per-match YES/NO markets as Polymarket-style cards with implied-probability bars.
- Market detail — order book: make an offer (pick a side + price + shares) or take the other side of any offer (partial fills). Admins resolve YES/NO.
- Wallet — balance, locked, granted, and net.
Shared / admin
- Rules — the full rules of each game, side by side.
- Admin — enter results, sync from the live feed, lock champion picks, set the winner.
- Dashboard (admin) — grant credits and view the settlement table (granted vs balance vs net).
Auto-syncing results
The Admin "Sync now" button calls POST /admin/sync-results, which pulls finished scores from a
free no-key feed (RESULTS_API_URL, default worldcup26.ir),
matches them to our fixtures by group + team names, and recomputes points. You can always enter
or override results by hand.
Typical flow
- Register / log in (a seeded
admin/admin123account can enter results). - Players enter scores, place a Joker per round, and pick a champion (before kickoff).
- Results arrive via the Admin Sync button (or manual entry /
POST /matches/{id}/result). - Points + bonuses recompute automatically — watch the live Leaderboard, Groups, and Profile.
