README.md
March 1, 2026 Β· View on GitHub
An immersive, AI-powered experience to explore the 2026 FIFA World Cup β 48 teams, 104 matches, 16 stadiums across 3 host nations πΊπΈπ²π½π¨π¦
Built with the AG-UI Protocol, the GitHub Copilot SDK, and MCP weather tools.
π Project documentation & configuration:
| File | Description |
|---|---|
/docs/README.md | Full documentation β problem β solution, prerequisites, setup, deployment, architecture diagram, RAI notes, GitHub Copilot SDK product feedback |
/docs/docs-architecture.puml | PlantUML architecture diagram (AG-UI, Copilot SDK, MCP layers) |
/presentations/AgentCopaAI.pptx | 2-slide presentation deck β business value & architecture |
AGENTS.md | Custom instructions for the Copa AI agent |
mcp.json | MCP server configuration (Open-Meteo weather) |

π¬ Demo
https://github.com/user-attachments/assets/5614e39e-7b5d-418f-8788-4aeb0faae347
πΊ Watch in High Quality on YouTube
π― What Can Copa Do?
Copa is a conversational AI sports commentator that turns the FIFA World Cup 2026 into a living, interactive experience. The entire page transforms in real time as you chat β colors, data, maps, and cards all react to your conversation.
π£οΈ Talk to Copa
| Try saying⦠| What happens on screen |
|---|---|
| "Show me France" | π«π· Full-page switch: blue theme, flag, roster, match schedule, stadiums on the SVG map |
| "Now show Germany" | π©πͺ Instant switch: black-red-gold theme, new players, new schedule |
| "Compare Brazil vs Argentina" | βοΈ Rich side-by-side comparison card rendered inside the chat |
| "Tell me about MetLife Stadium" | ποΈ Stadium card with capacity, location, hosted matches β in chat |
| "Show Group C" | π Interactive group view with all 4 teams, click any to navigate |
| "Show the tournament bracket" | π Full knockout bracket R32 β R16 β QF β SF β Final |
| "What's the weather in Houston?" | π€οΈ Live weather data via MCP (open-meteo) β real-time, not cached |
| "City guide for Miami" | ποΈ Fan tips: food, transport, must-see spots near the stadium |
π±οΈ Click & Explore
| Action | Effect |
|---|---|
| Click a team flag on the welcome screen | Page transforms with team's national colors and data |
| Click a player card | Modal with Wikipedia photo, bio, position & club |
| Click a stadium dot on the SVG map | Stadium details panel with weather & video buttons |
| Click π€οΈ Weather on a stadium | Popup with live 5-day forecast from Open-Meteo API |
| Click βΆοΈ Video on a stadium | Embedded YouTube player popup (no redirect) |
| Click a match row | Stadium pin highlights on the map |
| Click an opponent flag in the schedule | Triggers a compare prompt in Copa's chat |
| Click π² Simulate on the bracket | Simulates full tournament based on FIFA rankings |
| Navigate Groups / Bracket tabs | Interactive tournament views |
ποΈ Architecture Overview
Copa demonstrates a modern AI-native frontend pattern where a chat agent drives the entire UI.
Macro Architecture
π PlantUML source:
docs/architecture.puml
The 4 Layers
| Layer | What | Why |
|---|---|---|
| Next.js App | React 19 frontend with CopilotKit hooks | Rich UI components that react to agent state |
| AG-UI Protocol | Open standard for agent β frontend communication (SSE) | Streaming text, tool calls, state sync β all over one event stream |
| GitHub Copilot SDK | Node.js agent runtime with custom tools | Zero API keys β uses gh auth, custom tools, streaming |
| MCP Servers | Model Context Protocol for external data sources | Plug-and-play: live weather today, any data source tomorrow |
π AG-UI Protocol β How It Works
The AG-UI Protocol is an open standard for agent β frontend communication. Copa uses it to stream text, coordinate tool calls, and synchronize state β all over Server-Sent Events (SSE).
| AG-UI Event | Copa Usage |
|---|---|
TEXT_MESSAGE_START/CONTENT/END | Copa's commentary streams word-by-word |
TOOL_CALL_START/ARGS/END | Agent invokes tools β frontend tracks execution |
STATE_DELTA | Agent pushes state patches β useCoAgent updates React (team, bracket, group) |
RUN_STARTED / RUN_FINISHED | Lifecycle: loading indicators, error handling |
RUN_ERROR | Graceful error display in chat |
The CopilotSDKAgent class (in copilot-sdk-agent.ts) bridges Copilot SDK events to AG-UI:
Copilot SDK Event β AG-UI Event
βββββββββββββββββββββββββββββββββββββββββββββββββ
assistant.message_delta β TEXT_MESSAGE_CONTENT
tool.execution_start β TOOL_CALL_START + TOOL_CALL_ARGS
tool.execution_complete β TOOL_CALL_END + STATE_DELTA (for UI tools)
session.idle β TEXT_MESSAGE_END + RUN_FINISHED
session.error β RUN_ERROR
Data Flow β "Show me France"
π PlantUML source:
docs/sequence.puml
π§ GitHub Copilot SDK β Zero-Key AI
The GitHub Copilot SDK (@github/copilot-sdk) runs the LLM β no OpenAI/Azure API keys required.
| Benefit | Detail |
|---|---|
| Zero API keys | Uses your gh auth token β if you have Copilot, you're ready |
| Zero Python | Everything runs in the Next.js Node.js process |
| Custom tools | Define tools with JSON Schema; the model calls them automatically |
| Streaming | Real-time token-by-token streaming translated to AG-UI events |
| MCP support | Native mcpServers in session config β plug any MCP server |
Copa's 6 Custom Tools
All defined in src/lib/copilot-sdk-agent.ts:
| Tool | Type | What it does |
|---|---|---|
update_team_info | Server β STATE_DELTA | Loads a team β pushes state patch β page transforms |
get_stadium_info | Server + Generative UI | Returns stadium details β renders rich card in chat |
compare_teams | Server + Generative UI | Head-to-head comparison β renders comparison grid in chat |
get_group_standings | Server β STATE_DELTA | Returns group data β switches to GroupView |
show_tournament_bracket | Server β STATE_DELTA | Activates bracket view β switches to TournamentBracket |
get_city_guide | Server | Fan travel guide for a host city |
MCP Server β Live Weather
Copa connects to the open-meteo MCP server for real-time weather data at any World Cup venue. No API key, no configuration β it just works.
// In copilot-sdk-agent.ts β session config
mcpServers: {
weather: {
type: "sse",
url: "https://mcp.open-meteo.com/sse",
tools: ["*"], // All weather tools available
},
},
π‘ Extensible: Add any MCP-compatible server (news, sports stats, transit) by adding an entry to
mcpServers.
π οΈ CopilotKit β Features Used
CopilotKit provides the React integration layer between the AG-UI event stream and the UI components.
| Feature | Hook / Component | How Copa Uses It |
|---|---|---|
| Co-Agent State | useCoAgent<AgentState> | Bidirectional state: teamInfo, matches, tournamentView, selectedStadium |
| Generative UI | useCopilotAction with render | Rich stadium cards and comparison grids rendered inside the chat |
| Copilot Readable | useCopilotReadable | Provides current team context so the agent knows what the user sees |
| Chat Suggestions | useCopilotChatSuggestions | Dynamic follow-up prompts based on current state |
| Chat Management | useCopilotChat | Clicking an opponent flag auto-sends a compare prompt |
| Sidebar / Popup | CopilotSidebar / CopilotPopup | Desktop: persistent sidebar Β· Mobile: floating chat bubble |
| CSS Theming | CopilotKitCSSProperties | --copilot-kit-primary-color adapts to each team's national colors |
β¨ Key Features
| Feature | Description |
|---|---|
| π£οΈ Copa Agent | Passionate WC2026 commentator with 6 custom tools + MCP weather |
| π³οΈ 48 national teams | Full profiles: real flag images, key players, honors, FIFA ranking, national colors |
| π 104 matches | Complete schedule: group stage (72) β R32 (16) β R16 (8) β QF β SF β Final |
| πΊοΈ Interactive SVG map | 16 stadiums across USA / Canada / Mexico with clickable pins |
| π 12 groups | Responsive group view (AβL) with inter-team navigation |
| π Tournament bracket | Visual tree R32 β Final with π² Simulate button (FIFA ranking-based) |
| π¨ Dynamic theme | Entire UI changes colors based on the selected team's national colors |
| π¬ Generative UI | Rich cards rendered inside the chat (stadiums, comparisons) |
| π€οΈ Live weather | Real-time weather via MCP + inline popup with 5-day forecast (Open-Meteo API) |
| πΈ Player photos | Click any player β Wikipedia photo, bio & club info in a modal |
| βΆοΈ Stadium videos | Embedded YouTube player popup on each stadium (no redirect) |
| π‘ Smart suggestions | AI-driven follow-up questions based on current context |
| π± Mobile-first | Mobile tabs + CopilotPopup / Desktop sidebar |
| β±οΈ Live countdown | Real-time countdown to June 11, 2026 |
| ποΈ Playoff teams | 13 teams pending qualification shown with "Qualification Pending" message |
π Quick Start
Prerequisites
| Tool | Version | Install |
|---|---|---|
| Node.js | 20+ (v24 LTS recommended) | nodejs.org |
| GitHub CLI | latest | winget install GitHub.cli |
| GitHub Copilot | Active subscription | github.com/features/copilot |
1. Clone & install
git clone https://github.com/fredgis/foot-agui-sample.git
cd foot-agui-sample
npm install
2. Authenticate with GitHub
gh auth login
The Copilot SDK uses your GitHub auth token β no API keys needed.
3. Run
npm run dev
Open http://localhost:3000 and start chatting with Copa! β½
4. Try it
- π³οΈ Click a team flag β the page transforms with national colors
- π¬ Type: "Show me France" β blue theme, roster, schedule
- βοΈ Try: "Compare Brazil vs Argentina" β rich comparison card in chat
- ποΈ Ask: "Tell me about MetLife Stadium" β stadium card in chat
- π€οΈ Ask: "What's the weather in New York?" β live weather from MCP
- π Navigate Groups and Bracket views
π Project Structure
foot-agui-sample/
βββ src/
β βββ app/
β β βββ page.tsx # Main page β all CopilotKit hooks + components
β β βββ globals.css # Dark theme, animations, CopilotKit styles
β β βββ layout.tsx # CopilotKit Provider + metadata
β β βββ api/copilotkit/route.ts # CopilotRuntime β CopilotSDKAgent
β βββ components/
β β βββ team-card.tsx # Team profile (players w/ Wikipedia photos, honors)
β β βββ match-schedule.tsx # 104 matches with phase/group filters
β β βββ venue-map.tsx # SVG map β weather popup + YouTube video popup
β β βββ group-view.tsx # 12 groups (AβL) responsive grid
β β βββ tournament-bracket.tsx # Bracket R32 β Final + π² Simulate
β βββ lib/
β βββ types.ts # Types: TeamInfo, MatchInfo, AgentState
β βββ worldcup-data.ts # 48 teams, 16 stadiums, 12 groups, 104 matches
β βββ flags.ts # FIFA code β ISO β flagcdn.com images
β βββ copilot-sdk-agent.ts # CopilotSDKAgent β AG-UI β Copilot SDK bridge
βββ docs/
β βββ README.md # Detailed docs: problem/solution, setup, RAI notes
β βββ docs-architecture.puml # PlantUML β full architecture (AG-UI, SDK, MCP)
β βββ architecture.puml # PlantUML β macro architecture diagram
β βββ sequence.puml # PlantUML β data flow sequence diagram
βββ AGENTS.md # Custom agent instructions for Copa
βββ mcp.json # MCP server configuration (Open-Meteo weather)
βββ scripts/
β βββ deploy.ps1 # One-click Azure deploy (idempotent, PowerShell 7+)
β βββ deploy-config.env.example # Azure config template
βββ package.json
βββ README.md
π οΈ Available Scripts
| Command | Description |
|---|---|
npm run dev | Start dev server (Next.js Turbopack) on :3000 |
npm run build | Production build |
npm run lint | ESLint check |
βοΈ Azure Deployment
Copa deploys as a single Azure Static Web App β no backend containers needed.
One-click deploy (idempotent)
Copy-Item scripts\deploy-config.env.example scripts\deploy-config.env
# Edit with your Azure subscription details
pwsh scripts\deploy.ps1
The script is re-entrant: safe to run multiple times (4 idempotent steps).
To tear down:
az group delete --name rg-worldcup2026 --yes --no-wait
π§ Tech Stack
| Layer | Technology | Version |
|---|---|---|
| Frontend | Next.js + React + TailwindCSS | 16 + 19 + 4 |
| Chat UI | CopilotKit (Sidebar + Popup) | 1.50 |
| Protocol | AG-UI (SSE events) | 0.0.46 |
| AI Agent | GitHub Copilot SDK | 0.1.29 |
| LLM | GitHub Copilot (via gh auth) | β |
| Weather | Open-Meteo MCP Server + API | β |
| Deployment | Azure Static Web Apps | β |
| Flags | flagcdn.com (CDN) | β |
| Player Photos | Wikipedia REST API | β |
π Project Stats
| Metric | Value |
|---|---|
| Lines of code | ~7,500 (TypeScript + CSS) |
| React components | 7 |
| AI tools | 6 custom + MCP weather |
| WC2026 data | 48 teams Β· 104 matches Β· 16 stadiums Β· 12 groups |
π See
docs/README.mdfor detailed architecture documentation and Responsible AI (RAI) notes.π See
AGENTS.mdfor custom agent instructions andmcp.jsonfor MCP server configuration.
π€ This project was developed collaboratively with GitHub Copilot Agent β from planning through architecture, implementation, debugging, and documentation.
π License
MIT β see LICENSE
β½ Built for the 2026 FIFA World Cup πΊπΈπ²π½π¨π¦ Powered by AG-UI Protocol Β· GitHub Copilot SDK Β· CopilotKit Β· MCP