MatchBrief
by SpaceGravy
README.md
# MatchBrief
MatchBrief turns World Cup fixture and event feeds into sourced, plain-language context for fans and AI agents. It ships as:

- a public REST demo;
- a stateless MCP Streamable HTTP server;
- an Injective EVM USDC x402 route;
- an OKX / X Layer x402 route suitable for an A2MCP listing; and
- a portable Agent Skill with strict provenance and non-financial guardrails.
The bundled replay is intentionally synthetic and visibly labelled. Add official TxLINE credentials to switch the service to its live/historical World Cup adapter.
## Why it exists
Live sports feeds are optimized for machines, not ordinary fans. Raw actions, clocks, confirmation flags, and nested score objects need interpretation before an assistant can safely explain what changed. MatchBrief normalizes those updates, keeps the source and freshness attached, and never converts sports context into betting or investment advice.
## Quick start
```bash
cp .env.example .env
npm install
npm run dev
```
Open `http://localhost:4021`.
```bash
curl http://localhost:4021/health
curl http://localhost:4021/api/fixtures
curl http://localhost:4021/api/brief/demo-2026-001
curl http://localhost:4021/api/free/brief
curl http://localhost:4021/.well-known/agent.json
```
## MCP
The Streamable HTTP endpoint is `POST /mcp`. It exposes:
- `list_world_cup_matches`
- `get_match_brief`
- `explain_match_event`
The companion Agent Skill is at `skills/matchbrief-world-cup/SKILL.md`.
For an OKX listing that does not depend on payment credentials, use the free A2MCP-compatible endpoint `GET /api/free/brief`. A machine-readable service card is published at `/.well-known/agent.json`, and the OpenAPI document is at `/openapi.json`.
## Injective technology
MatchBrief uses `@injectivelabs/x402` to protect `GET /api/injective/brief` with USDC on Injective EVM. The default example configuration targets testnet (`eip155:1439`) and its documented USDC contract. Set `INJECTIVE_PAY_TO` to an EVM-compatible public payout address to enable the route.
The middleware returns an HTTP 402 challenge, verifies the EIP-3009 authorization through the configured facilitator, runs the brief handler, and settles only after a successful response. No private key belongs in the repository.
This project also uses the MCP server and Agent Skills patterns highlighted by Injective's AI developer materials. It does **not** claim a CCTP integration.
## OKX / X Layer technology
MatchBrief uses the official OKX TypeScript payment packages to protect `GET /api/okx/brief` on X Layer (`eip155:196`). It is enabled only when all of these are present:
- `OKX_PAY_TO`
- `OKX_API_KEY`
- `OKX_SECRET_KEY`
- `OKX_PASSPHRASE`
The public payout address is safe to configure; API credentials must stay in the deployment secret store. The route is designed for an OKX A2MCP service listing with fixed per-call pricing.
## TxLINE World Cup data
Live/historical mode uses the documented endpoints:
- `GET /api/fixtures/snapshot`
- `GET /api/scores/historical/{fixtureId}`
Set `TXLINE_GUEST_JWT` and `TXLINE_API_TOKEN` after completing TxLINE's free-tier activation flow. Keep both values secret. Until then, MatchBrief stays in deterministic demo mode and never passes synthetic events off as real.
## Environment and wallet safety
- Never commit `.env`.
- Never paste a seed phrase, private key, one-time code, or wallet recovery material into a form, issue, chat, or AI prompt.
- Use testnet for demonstrations unless you deliberately choose a real-money route.
- Review every wallet signature and network before approving it.
- MatchBrief provides match information only, not betting, trading, or investment advice.
## Tests
```bash
npm run typecheck
npm test
npm run build
```
## Hackathon mapping
### Injective Global Cup
- Functional World Cup tool: REST UI + MCP server.
- Meaningful Injective integration: x402 USDC route on Injective EVM.
- Additional new technology: MCP server and Agent Skill.
- Required deliverables still needed: public deployment, public GitHub repo, demo video, and disclosed X post.
### OKX.AI Genesis Hackathon
- ASP type: A2MCP.
- Category fit: Software Utility or Lifestyle Companion.
- Service: fixed-price, machine-callable match context.
- Approval-first path: list the working free endpoint, then enable the paid X Layer route after credentials are configured.
- Required deliverables still needed: OKX Agentic Wallet login, ASP registration/listing and approval, public deployment, sub-90-second X demo, and hackathon form.
These are contests, not guaranteed work. Prize decisions and payout timing are controlled by their organizers.
See `SUBMISSIONS.md` for the account-side checklist, disclosure language, and distinct contest posts.
## Primary documentation
- Injective x402: https://docs.injective.network/developers-ai/x402
- Injective AI developers: https://docs.injective.network/developers-ai
- MCP TypeScript SDK: https://ts.sdk.modelcontextprotocol.io/server
- OKX A2MCP guide: https://www.okx.ai/tutorial/asp
- OKX seller SDK: https://web3.okx.com/onchainos/dev-docs/payments/service-seller-sdk
- TxLINE World Cup free tier: https://txline.txodds.com/documentation/worldcup
- TxLINE fixtures API: https://txline.txodds.com/api-reference/fixtures/get-the-latest-snapshot-of-fixtures-optionally-starting-at-or-within-30-days-after-a-given-epoch-day
This server cannot be deployed
Maintenance
ActivityStale
ResponsivenessNo issues