SofaScore MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SofaScore MCPShow me the World Cup group standings"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SofaScore ChatGPT App β½π
A ChatGPT App (OpenAI Apps SDK / MCP-UI) that answers football questions with rich, interactive widgets β centered on the 2026 FIFA World Cup (48 teams, hosted by the USA, Canada & Mexico) while still handling general football.
It's an MCP server (Streamable HTTP) whose tools each render a React widget
inside ChatGPT via the openai/outputTemplate + text/html+skybridge pattern.
Data comes from SofaScore's public JSON API.

What it does
Tool | What it answers | Widget |
| Anything about the World Cup β groups, knockout bracket, live/upcoming matches. Views: | Tabbed World Cup hub with a knockout bracket |
| "What football is on today?", live scores, a date's fixtures, one competition's matches. | Scoreboard grouped by tournament, live pulse |
| Full detail of one match: score, goal/card timeline, team stats, momentum. | Match page with momentum chart & stat bars |
| A competition's league table (by name or SofaScore id). | Standings table (multi-group aware) |
| Find a team / player / competition / manager by name. | Result list that drills into the other tools |
Widgets are theme-aware (light/dark follow window.openai.theme), use SofaScore
crest/flag images with an initials fallback, and are interactive β match rows and
search results call back into other tools via window.openai.callTool.
Related MCP server: wc26-mcp
Architecture
src/
server.ts Express + StreamableHTTPServerTransport (POST /mcp, /health)
mcp.ts McpServer factory: server instructions + resources + tools
resources.ts registers each built widget as a ui:// text/html+skybridge resource
sofascore/ data layer: SofaScore client (browser headers, TTL cache,
optional proxy, server-side image fetch) + ESPN fallback
source, both behind one FootballApi interface (provider.ts,
fallback.ts, espn.ts); rawβstructuredContent mappers, WC logic
api/index.ts Vercel serverless entry (re-exports the Express app)
shared/shapes.ts structuredContent types shared by server + widgets
tools/ list_matches Β· get_match Β· get_standings Β· world_cup Β· search_football
widgets/ React sources (built per-widget to one self-contained HTML)
shared/ window.openai bridge + hooks, theme, reusable components
scripts/ build-widgets Β· smoke (wiring) Β· screenshots (visual)
test/fixtures/ demo SofaScore responses for offline runsEach widget is built by vite + vite-plugin-singlefile into a single
dist/widgets/<name>/index.html (JS + CSS inlined), which is served verbatim as
the skybridge resource β no separate asset host needed.
Images (why they route through this server)
Team/tournament/player crests can't be loaded straight from api.sofascore.com
inside the ChatGPT Apps sandbox: the iframe's CSP (img-src) blocks the host,
and SofaScore itself 403s the referer-less cross-origin request. So the server
exposes an image proxy and the widgets point at it instead:
GET /img/team/:id β https://api.sofascore.com/api/v1/team/:id/image
GET /img/tournament/:id β β¦/unique-tournament/:id/image
GET /img/player/:id β β¦/player/:id/image
GET /img/flag/:alpha2 β β¦/img/flags/:alpha2.pngOnly these allow-listed shapes are proxied. resources.ts injects
window.__SOFA_BASE__ (from PUBLIC_BASE_URL) into each widget's <head>, and
widgets/shared/img.ts builds ${__SOFA_BASE__}/img/... URLs from it. If
PUBLIC_BASE_URL is unset (e.g. local MCP Inspector) the widgets fall back to
loading images directly from SofaScore.
Run it
npm install
npm run dev # builds widgets, then starts the server on :3000 (POST /mcp)Point an MCP client at http://localhost:3000/mcp, or run with SOFA_MOCK=1 to
serve the bundled fixtures instead of the live API:
SOFA_MOCK=1 npm run devEnvironment variables
Variable | Purpose |
| HTTP port (default |
|
|
| Public origin this server is reachable at (e.g. |
| Outbound HTTP(S) forward proxy for all SofaScore fetches (data + images). Point at a residential / unblocked proxy to defeat the Varnish/IP block. Falls back to |
|
|
# Live, behind a proxy, with images proxied through this origin:
PUBLIC_BASE_URL=https://sofa.example.com \
SOFA_PROXY=http://user:pass@proxy-host:port \
npm run devAdd it to ChatGPT (Developer Mode)
Expose the server over HTTPS (e.g.
ngrok http 3000).In ChatGPT β Settings β Connectors β Advanced β Developer mode, add a new connector pointing at
https://<your-tunnel>/mcp.Ask: "Show me the World Cup group standings" or "What football is live right now?" β the matching widget renders inline.
Deploy to Vercel
The repo is Vercel-ready: api/index.ts re-exports the Express app as a single
serverless function and vercel.json rewrites every path to it.
vercel deploy # first run links the project; prod: `vercel --prod`Build β
vercel.json'sbuildCommandrunsnpm run build, bundling the five widget HTML files intodist/widgets/;includeFilesships them with the function (the resource loader also resolves them fromprocess.cwd()).Base URL β
PUBLIC_BASE_URLdefaults to the deployment'sVERCEL_URL, so the image proxy works with no extra config. Set it explicitly for a custom domain.Data β ESPN fallback means live data works immediately. To keep SofaScore primary, add
SOFA_PROXYin the Vercel project's Environment Variables; to drop it, setESPN_ONLY=1.Connector URL β point ChatGPT at
https://<deployment>/mcp.
The function's maxDuration is 30s to cover ESPN's multi-league fan-out; the
landing page at / is served statically from public/.
Verify
All verification runs offline (no live network needed):
npm run typecheck # server + widgets typecheck
npm run build:widgets # bundle the 5 self-contained widget HTML files
npm run verify # build + wiring smoke test + Playwright screenshotsscripts/smoke.tsboots the server with fixtures, connects an in-process MCP client, and asserts every tool'sopenai/outputTemplateresolves to a registeredui://resource with non-emptystructuredContent.scripts/screenshots.tsrenders each built widget with the real server output (Chromium,window.openaiset exactly like the host) into.artifacts/shots/.
Note on data & this environment
The primary source is the live SofaScore API (api.sofascore.com), used with
browser-like headers. Its edge (Varnish) returns 403 to datacenter IPs and
flagged TLS fingerprints regardless of headers β so a cloud host, CI runner,
or this sandbox often can't reach it. This is an egress-IP block, not a missing
header.
So the server falls back to ESPN's public soccer API automatically. Every
data source sits behind one FootballApi interface; FallbackApi tries
SofaScore first (honouring SOFA_PROXY) and, on any 403 / timeout / empty
result, transparently serves the same request from ESPN β mapped into the exact
same shapes, so tools and widgets never know the difference. ESPN is reachable
from blocked networks, covers the FIFA World Cup + the top-5 European leagues,
and needs no API key. Result: live data flows out of the box, no proxy
required. Team crests come from a.espncdn.com via the same image proxy.
Ways to control the source:
Default β SofaScore β ESPN fallback. Just works anywhere.
ESPN_ONLY=1β skip SofaScore entirely (best on always-blocked hosts).SOFA_PROXY=<url>β give SofaScore a residential / unblocked egress so it stays primary (see below).SOFA_MOCK=1β bundled fixtures, fully offline (dev / tests / demos).
The World Cup season resolves dynamically (not hardcoded).
Getting a proxy endpoint
SOFA_PROXY takes a standard http(s)://[user:pass@]host:port URL. What you
need is an IP SofaScore hasn't blocked β in practice a residential or
mobile proxy (datacenter proxies are usually blocked too). Options:
Managed residential proxy providers β Bright Data, Oxylabs, Smartproxy, IPRoyal, Soax, etc. Sign up, create an endpoint, and they give you a
http://user:pass@gateway:portURL. Paste it intoSOFA_PROXY. Cheapest to start; billed per GB (crest images are tiny, JSON is tiny β usage is low).Your own home/residential IP β run the server on a machine at home, or tunnel through one (e.g. a small box on a home connection running
ngrok/tailscale+ a forward proxy liketinyproxyorsquid). Free if you already have the hardware.A cheap VPS on a residential-friendly ASP β some VPS/edge providers hand out IP ranges SofaScore doesn't block; try a
curlfrom the box first (below).
Test any candidate before wiring it in:
curl -x "http://user:pass@proxy-host:port" \
-H "User-Agent: Mozilla/5.0" -H "Referer: https://www.sofascore.com/" \
-o /dev/null -w "%{http_code}\n" \
https://api.sofascore.com/api/v1/sport/football/events/live200 β set that URL as SOFA_PROXY. 403 β that IP is blocked too; try another.
Not affiliated with SofaScore; uses their public endpoints for informational use.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/TejasQ/sofascore-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server