For developers & AI agents
Run your league with your AI agent
Everything the in-app AI assistant can do is available to your agents: create leagues and seasons, add teams and rosters, generate round-robin schedules, record scores, and read standings — over MCP, a REST API, or the CLI.
1. Get an API key
In the dashboard, open Settings → API & Agents and create a key. Keys are scoped to your rink (organization) and come in two roles: admin (full league operations) and scorekeeper (read + record scores). Send the key as a bearer token:
Authorization: Bearer rk_...
Reads work on any plan; write operations require an active subscription — the same rules as the dashboard.
2. Connect over MCP (recommended)
The remote MCP server at https://hockeylineapp.com/api/mcp (streamable HTTP) exposes the tools below. Claude Code:
claude mcp add --transport http hockey-line https://hockeylineapp.com/api/mcp \ --header "Authorization: Bearer rk_..."
Claude Desktop, Cursor, or any MCP client (JSON config):
{
"mcpServers": {
"hockey-line": {
"url": "https://hockeylineapp.com/api/mcp",
"headers": { "Authorization": "Bearer rk_..." }
}
}
}Then just talk to your agent: “Set up a Winter 2027 season for the Sunday beer league with the same teams as last season and generate a weekly schedule starting January 10 at 8pm and 9:15pm.”
3. Or use the REST API
The same tools are exposed as RPC endpoints. Discover them at /api/v1/tools (JSON Schemas included), then invoke:
curl -X POST https://hockeylineapp.com/api/v1/tools/get_org_overview \
-H "Authorization: Bearer rk_..." \
-H "Content-Type: application/json" \
-d '{}'
curl -X POST https://hockeylineapp.com/api/v1/tools/record_score \
-H "Authorization: Bearer rk_..." \
-H "Content-Type: application/json" \
-d '{"gameId": "...", "homeScore": 4, "awayScore": 2, "isOvertime": true}'An OpenAPI 3.1 spec is generated from the same catalog.
4. Or the CLI
A tiny agent-friendly CLI (JSON in, JSON out) wraps the REST API — handy for scripts and terminal-based agents:
export HOCKEY_LINE_API_KEY=rk_...
npx hockey-line-cli me
npx hockey-line-cli tools
npx hockey-line-cli call get_org_overview
npx hockey-line-cli call add_teams '{"seasonId":"...","teamNames":["Ice Holes","Puck Hogs"]}'Available tools
Identical across MCP, REST, and CLI. Write tools need an active subscription; scorekeeper-role keys can only call reads and record_score.
| Tool | Type | Description |
|---|---|---|
| get_org_overview | read | List the org's existing leagues, seasons, and teams so you can reference real IDs. Call this before creating things that depend on existing entities. |
| create_league | write | Create a new league within the organization. |
| create_season | write | Create a season within a league. Teams join with the league's evergreen join code, which always points at the current season. Set carryOverTeams to bring all of the league's returning teams (with divisions, app links and rosters) into the new season. |
| add_teams | write | Add one or more teams to a season. |
| update_team | write | Rename a team or change its division or color (hex, e.g. "#1d4ed8"). Name and color changes carry to the team's persistent identity across seasons. |
| add_players | write | Add players to a team's roster. |
| set_season_status | write | Change a season's status: "setup" (pre-launch), "active" (in play, visible publicly), or "completed" (season over). |
| generate_round_robin | write | Generate a round-robin schedule for a season. Games are placed on game nights (every intervalDays) in the rink's local timezone, filling the night's time slots (gameTimes) without any team playing twice in one night. Teams only play opponents in their own division. Set replaceExisting to regenerate (deletes the season's scheduled-but-unplayed games first). |
| get_standings | read | Current standings for a season (per division): W/L/T/OTL, goals for/against, points, streak. Computed from finalized games using the season's configured point values. |
| get_schedule | read | A season's schedule and results: every game with date (UTC ISO — the rink's local timezone is in get_org_overview), teams, location, status, and score. |
| get_game | read | Full detail for one game: score, goals with scorers/assists, penalties, period shots, goalie stats. |
| get_roster | read | A team's roster: players with jersey numbers, positions, type, and eligibility. |
| schedule_game | write | Schedule a single game between two teams in a season. Date/time is ISO 8601 (UTC or with offset). |
| update_game | write | Reschedule a game, change its location, or mark it postponed/cancelled. |
| record_score | write | Record a game's final score and mark it final. Set isOvertime/isShootout when the game went past regulation (drives W vs OTL in standings). Updates standings, playoff series, and suspension served-counts. |
| update_player | write | Update a rostered player's jersey number, position, name, or eligibility. |
| remove_player | write | Remove a player from a team's roster. Their goals come off the board (scores adjust); assists on others' goals are kept without attribution. |
Notes for agents
- Never invent IDs — call
get_org_overviewfirst. - Typical setup flow: create_league → create_season → add_teams → add_players → generate_round_robin.
- Dates are ISO 8601; schedule times are interpreted in the rink's local timezone.
- Mutations return
{ ok: true, ... }or{ ok: false, error }with a human-readable reason. - Public, no-auth league data (standings, schedules, rosters) is also on each rink's public page at
/r/{slug}.