MLB stats · web + terminal + AI

The whole ballgame, in your browser and your terminal.

Diamond turns the public MLB Stats API into a fast web app and a beautiful terminal app — both backed by DiamondGPT, an assistant that pulls live data to answer questions in plain English. No API key required for stats.

Free · open source · not affiliated with MLB

diamondapp.xavidop.me
Diamond web app — today's MLB scoreboard dashboard

What's inside

Every box score, standing, and stat — one tap away.

The same data set, shaped for two places you actually work: a rich web app and a fast terminal UI.

Live

Scoreboard

Today's games with auto-refresh, linescores, boxscores, and probable pitchers.

Races

Standings

Division and wild-card standings by league, with run differential, for any season.

Profiles

Players & teams

Rosters, season and career stats, situational splits, game logs, and trend charts.

Stats

Leaders

Hitting and pitching leaders for any season and category, ranked at a glance.

AI

DiamondGPT

Ask in plain English — the assistant calls 18 live MLB tools to answer with real data.

Raw

API Explorer

Call every MLB Stats API endpoint from a dynamic UI with a raw JSON viewer.


The web app

A full front office in the browser.

Built with React, Tailwind, and Recharts for a fast, responsive experience — from the live scoreboard to deep player profiles with year-by-year trend charts.

  • Scoreboard, standings, teams, and player profiles
  • Game detail with live linescore, boxscores, and play-by-play
  • Stat leaders, streaks, and side-by-side comparisons
  • API Explorer for every MLB Stats API endpoint
Open the web app →
Diamond web app — division standings

DiamondGPT ✨

Ask baseball anything.

DiamondGPT answers in plain English by calling 18 live MLB tools — schedules, standings, leaders, player and team stats, splits, game logs, awards, the draft, win probability, and more. Real numbers, not guesses.

  • 18 live data tools wired to the MLB Stats API
  • In the web app and the terminal alike
  • Bring your own key, or use the server's
  • Switch providers mid-conversation
Google GeminiAnthropic ClaudeOpenAI
DiamondGPT answering a question about MLB home run leaders with live data

The terminal app

Same stats, no browser. Just diamond.

A Go CLI built with Bubble Tea. Run diamond for the interactive TUI, or jump straight to a view with a subcommand. Includes DiamondGPT and an MCP server.

Homebrew
brew install xavidop/tap/diamond
diamond
Docker
docker run --rm -it ghcr.io/xavidop/diamond:latest
# or a specific view:
docker run --rm -it ghcr.io/xavidop/diamond scores
Go install
go install github.com/xavidop/diamond/cli@latest
From source
cd cli && go build -o diamond .
./diamond

Live alerts

Box-score alerts, in the background.

Press n on any game in the scoreboard and Diamond watches it for you — native desktop notifications when a run scores or the game goes final, even while you're in another view or another app.

  • Desktop notifications on every run and the final
  • Polls live scores every 30 seconds in the background
  • Toggle per game with n — fires from any view
Run Scored
Blue Jays 3, Yankees 2
Diamond
Game Over
Final: Dodgers 5, Padres 4
Diamond

Model Context Protocol

Plug MLB into any AI client.

diamond mcp runs a Model Context Protocol server over stdio, exposing the same 18 live MLB tools DiamondGPT uses. Point Claude Desktop, your IDE, or any MCP client at it and your assistant can pull real baseball data — scores, standings, stats, and more.

  • The same 18 live MLB tools as DiamondGPT
  • stdio transport — works with Claude Desktop, Cursor, and friends
  • One command, no extra setup
Start the server
diamond mcp
Client config
{
  "mcpServers": {
    "diamond": {
      "command": "diamond",
      "args": ["mcp"]
    }
  }
}