[GH-ISSUE #5147] Server admin API: players, events and metrics (roadmap: server-admin) #1571

Open
opened 2026-11-02 15:48:05 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @Akirabane on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5147

🤖 Filed by both Akirabane's AI agent (Claude Code) and Akirabane himself, after his review.

Tracking issue for the roadmap item Server console, bans and a full admin API (Next, roadmap:server-admin), which has no owner and no issue yet. This is a plan to land it in small pull requests, starting with the players endpoint.

What exists today (checked on origin/main 01bbb4c65)

  • The game's console runs ban, ban-ip, pardon, pardon-ip, banlist, op, deop and whitelist with vanilla's messages (#4680), so horizon-server cmd ban NAME works, and horizon-server op|deop|whitelist edit vanilla's files while the server is stopped.
  • /api/v1 has status, metrics (graph samples), logs, command, stop, restart, backups (list and create), restore, update and the panel login.
  • The engine's server-status already answers with the players (name, uuid, address, ping) and the tick numbers.

What is missing

docs/api/server.md lists it under "Not there yet": the players as endpoints (today only through cmd and the files), the log and events as a stream, and a plain-text metrics endpoint. The roadmap adds config GET and PATCH, backup delete and download, horizon-server console, ban/pardon/ban-ip while stopped, and mcp.

Plan

Each step is its own pull request under about 500 lines, an addition to /api/v1 (stable, stability.md), with its route in ROUTES and the generated reference updated.

  1. GET /api/v1/players and horizon-server players [--json]: name, uuid, address and ping from server-status; position and dimension after a small engine change.
  2. POST /api/v1/players/... for kick, ban, pardon, op and deop: validated names, running the console commands so the lookup and the messages stay vanilla's.
  3. GET /api/v1/events: log lines and metrics as server-sent events.
  4. A plain-text metrics endpoint.
  5. config GET and PATCH, backup delete and download.
  6. horizon-server console, ban, pardon and ban-ip while stopped (as op does), and mcp.

Out of scope here: vanilla's own JSON-RPC management protocol, which deserves its own issue.

How each step is checked

Unit tests for each route (the ROUTES test checks the table against the router), the regenerated reference, and a check as a player on a real server: join, see yourself in the list with your ping, get kicked or refused with vanilla's own text. No bots and no benchmark are needed.

I'm taking step 1 first and will claim each next step before starting it.

Originally created by @Akirabane on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5147 > 🤖 Filed by both Akirabane's AI agent (Claude Code) and Akirabane himself, after his review. Tracking issue for the roadmap item **Server console, bans and a full admin API** (Next, `roadmap:server-admin`), which has no owner and no issue yet. This is a plan to land it in small pull requests, starting with the players endpoint. ## What exists today (checked on `origin/main` 01bbb4c65) - The game's console runs `ban`, `ban-ip`, `pardon`, `pardon-ip`, `banlist`, `op`, `deop` and `whitelist` with vanilla's messages (#4680), so `horizon-server cmd ban NAME` works, and `horizon-server op|deop|whitelist` edit vanilla's files while the server is stopped. - `/api/v1` has `status`, `metrics` (graph samples), `logs`, `command`, `stop`, `restart`, `backups` (list and create), `restore`, `update` and the panel login. - The engine's `server-status` already answers with the players (name, uuid, address, ping) and the tick numbers. ## What is missing [docs/api/server.md](https://github.com/horizon-rust/horizon/blob/main/docs/api/server.md) lists it under "Not there yet": the players as endpoints (today only through `cmd` and the files), the log and events as a stream, and a plain-text metrics endpoint. The roadmap adds config GET and PATCH, backup delete and download, `horizon-server console`, `ban`/`pardon`/`ban-ip` while stopped, and `mcp`. ## Plan Each step is its own pull request under about 500 lines, an addition to `/api/v1` (stable, [stability.md](https://github.com/horizon-rust/horizon/blob/main/docs/api/stability.md)), with its route in `ROUTES` and the generated reference updated. 1. `GET /api/v1/players` and `horizon-server players [--json]`: name, uuid, address and ping from `server-status`; position and dimension after a small engine change. 2. `POST /api/v1/players/...` for kick, ban, pardon, op and deop: validated names, running the console commands so the lookup and the messages stay vanilla's. 3. `GET /api/v1/events`: log lines and metrics as server-sent events. 4. A plain-text metrics endpoint. 5. `config` GET and PATCH, backup delete and download. 6. `horizon-server console`, `ban`, `pardon` and `ban-ip` while stopped (as `op` does), and `mcp`. Out of scope here: vanilla's own JSON-RPC management protocol, which deserves its own issue. ## How each step is checked Unit tests for each route (the `ROUTES` test checks the table against the router), the regenerated reference, and a check as a player on a real server: join, see yourself in the list with your ping, get kicked or refused with vanilla's own text. No bots and no benchmark are needed. I'm taking step 1 first and will claim each next step before starting it.
Author
Owner

@Akirabane commented on GitHub (Oct 31, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6543831247 --> @Akirabane commented on GitHub (Oct 31, 2026): 🤖 Agent: /claim
Author
Owner

@Akirabane commented on GitHub (Oct 31, 2026):

🤖 Agent: the first steps of this plan landed through other pull requests: #5163 (GET /api/v1/players, the moderation endpoints, the Prometheus text metrics), #5166 (the players, kick, ban, pardon, ban-ip and pardon-ip commands) and #5186 (the events stream). My own pull request for the players command (#5154) is closed as a duplicate of #5166. I'm releasing my claim next: nothing of the rest (config GET and PATCH, backup delete and download, horizon-server console, mcp) is started on my side.

<!-- gh-comment-id:6545264894 --> @Akirabane commented on GitHub (Oct 31, 2026): 🤖 Agent: the first steps of this plan landed through other pull requests: #5163 (`GET /api/v1/players`, the moderation endpoints, the Prometheus text metrics), #5166 (the `players`, `kick`, `ban`, `pardon`, `ban-ip` and `pardon-ip` commands) and #5186 (the `events` stream). My own pull request for the `players` command (#5154) is closed as a duplicate of #5166. I'm releasing my claim next: nothing of the rest (config GET and PATCH, backup delete and download, `horizon-server console`, `mcp`) is started on my side.
Author
Owner

@Akirabane commented on GitHub (Oct 31, 2026):

🤖 Agent: /unclaim

<!-- gh-comment-id:6545265176 --> @Akirabane commented on GitHub (Oct 31, 2026): 🤖 Agent: /unclaim
Author
Owner

@TiggerTakkyTTT commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6557867168 --> @TiggerTakkyTTT commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
Author
Owner

@TiggerTakkyTTT commented on GitHub (Nov 1, 2026):

🤖 Agent: /unclaim

<!-- gh-comment-id:6565551269 --> @TiggerTakkyTTT commented on GitHub (Nov 1, 2026): 🤖 Agent: /unclaim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#1571
No description provided.