Skip to content

Agent Server API

Default address: http://127.0.0.1:48915

Configuration: TOOL_SERVER_PORT

The agent server is an internal loopback service. It owns the agent runtime, tracked tasks, execution adapters, and direct plugin execution. The main server exposes the supported browser-facing subset under /api/agent; callers outside the local process group should use that proxy instead of these routes.

The agent server also exchanges asynchronous session and task events with the main server over ZeroMQ. HTTP is therefore the control/query plane, while ZeroMQ is the event plane; the service does not use ZeroMQ instead of HTTP.

HTTP endpoint inventory

MethodPathContract
GET/healthN.E.K.O health fingerprint plus current agent flags
GET/capabilitiesCurrent capability snapshot
GET/agent/flagsCurrent master/sub-feature flags
POST/agent/flagsPartially update sub-feature flags
GET/agent/stateAuthoritative revision, flags, capabilities, notification, and task state
POST/agent/commandset_agent_enabled, set_flag, or refresh_state command
GET/computer_use/availabilityComputer Use readiness and reasons
POST/computer_use/runStart a tracked Computer Use task; body requires instruction, with optional screenshot_b64 and lanlan_name
GET/browser_use/availabilityBrowser Use dependency/model readiness
POST/browser_use/runRun one browser instruction; body requires instruction
GET/openclaw/availabilityOpenClaw/QwenPaw capability check
GET/openfang/availabilityOpenFang capability check
POST/openfang/runStart a tracked OpenFang task
POST/openfang/sync_configRefresh the OpenFang runtime configuration
GET/mcp/availabilityCompatibility response: MCP has been removed from the brain/ layer and is always unavailable here
POST/plugin/executeDirectly schedule a user-plugin entry; requires plugin_id, optional entry_id, args, character, and conversation IDs
GET/tasksList task-registry snapshots
GET/tasks/{task_id}Read one tracked task; missing task returns 404
POST/tasks/{task_id}/cancelCancel a tracked task; missing task returns 404
POST/api/agent/tasks/{task_id}/correctionInternal correction callback for a task result
POST/api/agent/tasks/{task_id}/completeInternal completion callback for a task result
POST/admin/controlAdministrative runtime control; currently action: "end_all" cancels active work
POST/notify_config_changedInternal notification after model/API configuration changes

Most run endpoints return {"success":true,"task_id":"...","status":"running","start_time":"..."} and continue asynchronously. Validation errors use 400; a disabled master/feature uses 403; unavailable adapters use 503; a detected duplicate Computer Use task uses 409. Task and plugin result bodies are internal schemas and may grow fields.

The two /api/agent/tasks/* callback routes and /notify_config_changed are process-internal. /admin/control, direct run routes, and /plugin/execute must not be exposed to an untrusted network.

ZeroMQ event plane

Addresses are loopback-only and can be overridden by the corresponding NEKO_ZMQ_*_PORT environment variables.

SocketDefault addressTypeDirection
Session eventstcp://127.0.0.1:48961PUB/SUBMain → Agent
Task and status eventstcp://127.0.0.1:48962PUSH/PULLAgent → Main
Reliable analyze queuetcp://127.0.0.1:48963PUSH/PULLMain → Agent

Events include session lifecycle/intent-restore signals, analyze requests, task updates, task results, proactive messages, and agent status snapshots. Event payloads are internal and versioned with the main/agent pair; they are not a public plugin wire protocol.

Execution adapters

AdapterCurrent role
Computer UseScreenshot-guided mouse and keyboard execution
Browser UseBrowser automation through the optional browser-use dependency
OpenClawDelegation to the OpenClaw/QwenPaw standalone agent channel
OpenFangDelegation to the OpenFang standalone agent channel
User pluginsDirect execution through the plugin runtime

MCP calls are no longer implemented in brain/; installable MCP integration lives under plugin/plugins/mcp_adapter/.

See Agent System for the architecture and Agent API for the main-server proxy.