Skip to main content
HTTP Server is the local control API inside a Hiro Server process. It runs beside the message pipeline. Devices do not use it; device traffic goes through Hiro Gate, the devices channel plugin, Channel Manager, Communication Manager, and Agent Manager. The HTTP Server is for same-machine clients that need to inspect or control the already-running workspace server. The component also exposes the workspace Tool Registry over HTTP. Local clients can discover registered tools with GET /tools and invoke one by name with POST /invoke.

Responsibilities

Local status API - GET /status reports whether the workspace server process is running, the PID, gateway URL, and current gateway WebSocket connection state. Channel inspection - GET /channels returns connected channel plugin metadata from Channel Manager. This is live runtime state, not just workspace configuration. Tool Registry API - GET /tools exposes the registered tool schema. POST /invoke executes one registered tool by name with a flat params object. Character profile API - GET /characters, GET /characters/{id}/profile, and GET /characters/{id}/photo expose local character profile data and images. Metrics API - Metrics endpoints return the latest metrics snapshot, history, collector status, and runtime metrics configuration. Lifecycle control - POST /_shutdown and POST /_restart trigger graceful server shutdown or restart through ServerContext, allowing channel plugin subprocesses to be cleaned up.

Main components

FastAPI app

The HTTP app lives in runtime/http_server.py. It defines the local routes and runs under uvicorn inside the same asyncio event loop as the other server components.

ServerContext

The HTTP app reads ServerContext from app state. Lifecycle routes set stop_event and restart flags there; status routes use it to locate workspace files and runtime state.

Tool Registry

server_process.py builds a ToolRegistry, registers all Hiro tools, and attaches it to the HTTP app.
RoutePurpose
GET /toolsReturn all registered tool names, descriptions, and parameter schemas.
POST /invokeCall registry.invoke(tool, params) and return the tool result.
The CLI usually calls tool classes directly with .execute(...). The HTTP Tool Registry API is an additional local entry point, not the CLI’s normal dispatch path.

Channel info provider

The HTTP app receives a channel info provider from Channel Manager. GET /channels uses it to return connected plugin names, versions, and descriptions.

Metrics Collector

The Metrics Collector is attached to the HTTP app state. Metrics routes read its latest snapshot, history, and configuration.

Endpoint groups

Endpoint groupRoutesUsed for
StatusGET /statusProcess and gateway connection status.
ChannelsGET /channelsConnected channel plugin inspection.
ToolsGET /tools, POST /invokeTool discovery and tool execution over local HTTP.
CharactersGET /characters, GET /characters/{id}/profile, GET /characters/{id}/photoLocal character profile and image reads.
MetricsGET /metrics, GET /metrics/history, GET /metrics/status, POST /metrics/configureRuntime health snapshots and metrics settings.
LifecyclePOST /_shutdown, POST /_restartGraceful stop and restart.

Caller model

CallerUses HTTP Server for
Selected CLI commandsLive channel status, metrics, graceful stop/restart.
Local tool clientsDiscovering and invoking registered tools through /tools and /invoke.
Local browser or health checksReading /status and other inspection endpoints.
Local app surfacesReading local workspace runtime data and operational state.
Mobile devices and third-party communication apps do not call this HTTP server. They communicate through Hiro Gate and channel plugins.

Processing flow


Channel Manager

HTTP Server reads connected channel plugin metadata from Channel Manager for /channels. It does not route messages through Channel Manager.

Metrics Collector

HTTP Server exposes Metrics Collector snapshots and configuration over the metrics endpoints.

Tool Registry

HTTP Server provides a generic local API over the same tool implementations used by CLI commands, Admin UI services, and agent tooling.

ServerContext

HTTP Server uses ServerContext for lifecycle control and workspace-scoped runtime access.

See also

Hiro Server components

How the main server components relate to each other.

Channel Manager

The transport manager that owns channel plugins and WebSocket JSON-RPC.

Communication Manager

The internal message router between channels and the agent runtime.

Agent Manager

The assistant runtime that consumes agent-ready messages.