Skip to content

Connect an agent (MCP)

The product ships a native Model Context Protocol server so AI agents can use the World Cup API as tools — no glue code.

Endpoint  : https://worldcup-mcp.org.machina.gg/sse   (SSE transport)
Auth      : X-Api-Token: <your key>   (header on the connection)
Tools     : 16, all read-only

The server authenticates per request with your key, and every call goes through the same gateway as REST — auth, entitlement, credit gate and metering included. The toolset is curated: an agent holding your key can call these 16 tools and nothing else.

Claude Code

bash
claude mcp add --transport sse world-cup-intelligence \
  https://worldcup-mcp.org.machina.gg/sse \
  --header "X-Api-Token: YOUR_API_KEY"

Run /mcp inside Claude Code — the server appears as World Cup Intelligence API with 16 tools. Then just ask:

"get the betting signal for Brazil vs Morocco"

"fan pulse for Morocco"

"what are today's biggest market movers?"

Cursor

~/.cursor/mcp.json:

json
{
  "mcpServers": {
    "world-cup-intelligence": {
      "url": "https://worldcup-mcp.org.machina.gg/sse",
      "headers": { "X-Api-Token": "YOUR_API_KEY" }
    }
  }
}

Claude Desktop

Desktop config files can't send custom headers — bridge with mcp-remote in claude_desktop_config.json:

json
{
  "mcpServers": {
    "world-cup-intelligence": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://worldcup-mcp.org.machina.gg/sse",
        "--header", "X-Api-Token:YOUR_API_KEY"
      ]
    }
  }
}

Any MCP SDK

js
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js"

const transport = new SSEClientTransport(
  new URL("https://worldcup-mcp.org.machina.gg/sse"),
  {
    eventSourceInit: {
      fetch: (u, i) => fetch(u, { ...i, headers: { ...(i?.headers ?? {}), "X-Api-Token": KEY } }),
    },
    requestInit: { headers: { "X-Api-Token": KEY } },
  }
)
const client = new Client({ name: "my-agent", version: "1.0.0" }, { capabilities: {} })
await client.connect(transport)
const result = await client.callTool({
  name: "worldcup_get_signal",
  arguments: { event: "Brazil vs Morocco" },
})

Both header spots matter

With the JS SDK, send X-Api-Token on both the SSE handshake (eventSourceInit.fetch) and the message POSTs (requestInit.headers) — missing either yields 401.

How agents experience it

  • Natural language first — fixtures and players resolve from plain descriptions (event: "Brazil vs Morocco"); every response echoes the resolved event_urn so the next call can chain precisely.
  • Server instructions at initialize — the canonical flow (discover → context → cards → edge), the cost table and the informational-only disclaimer are pushed to the agent automatically.
  • Costs in every description — each tool states its credit cost and one example call, so cost-aware agents can budget.
  • Typed errorsinsufficient_credits, rate_limited (with retry_after_seconds), invalid_api_key, not_entitled, each with an actionable hint. See Errors.
  • Free smoke testworldcup_health costs 0 credits; agents can verify the key before spending.

Continue to the tool reference →