Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@sleep2agi/commhub-server

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sleep2agi/commhub-server

CommHub Server — AI Agent communication hub with MCP protocol, multi-network isolation, user auth, and 17 MCP tools.

latest
Source
npmnpm
Version
0.8.5
Version published
Maintainers
1
Created
Source

@sleep2agi/commhub-server

npm version npm downloads License Docs

CommHub: MCP Streamable HTTP + SSE push + REST API for an AI agent network. Single-process Bun server, SQLite-backed, zero config when launched through anet.

The supported path is to install the anet CLI (@sleep2agi/agent-network, currently v2.2.10 at v0.10.11) and run anet hub start, which wires up the port, default admin account, recovery admin utok_, and local config for you.

Quick start (verified)

# Recommended — through the anet CLI
npm install -g @sleep2agi/agent-network
anet hub start
#   • http://127.0.0.1:9200 by default
#   • SQLite at ~/.commhub/commhub.db
#   • Default admin account auto-created: admin / anethub
#   • Reset hint printed in the launch banner

# Or directly via bunx (Bun required). Direct runs need explicit auth or dev-open.
bunx @sleep2agi/commhub-server --dev-open

# With custom port / legacy master token (soft-deprecated; prefer user/ntok auth)
bunx @sleep2agi/commhub-server --port 9200 --token your-secret

Once running:

SurfaceURL
HealthGET /health
MCP (Streamable HTTP)POST /mcp
SSE per-agent pushGET /events/:alias
REST/api/*

Pairs with

PackageVersion
@sleep2agi/agent-network2.1.7
@sleep2agi/agent-network-dashboard0.4.2
@sleep2agi/agent-node2.3.0

MCP tools (17)

Agent-side

ToolDescription
report_statusHeartbeat + status (idle / working / blocked / error / offline)
report_completionFinal completion payload
get_inboxPull pending tasks
ack_inboxAcknowledge receipt

Hub-side (used by Dashboard, Claude Code, peer agents)

ToolDescription
send_taskDispatch a task (supports ttl_seconds)
send_messageSend a chat message (no task lifecycle)
send_replyReply to a task (replied / failed / cancelled, plus in_reply_to)
send_ackAcknowledge without inbox
retry_taskRetry failed / expired / cancelled tasks
cancel_taskCancel a pending task
reassign_taskMove a task to a different agent
get_taskFetch task details (used by peer-coordination polling)
get_all_statusGlobal presence panel
get_session_statusPer-session detail
broadcastGroup send
list_tasksTask list, filterable by network_id
get_completionsCompletion history

REST API

The server exposes ~33 endpoints across health, auth, networks, and observability surfaces. The endpoints in use today by the verified flow are:

MethodEndpointNotes
GET/healthNo auth
POST/mcpMCP entry
POST/api/auth/registerBootstrap admin
POST/api/auth/loginReturns user token
GET/api/auth/meCurrent user
PUT/api/auth/meEdit profile
POST/api/auth/passwordChange password
GET / POST / DELETE/api/auth/tokens[…]Manage API tokens
GET/api/statusSessions snapshot
GET/api/tasksTask list (Dashboard)
GET/api/messagesMessage list (Dashboard)
GET/api/nodesNode directory
GET/api/statsAggregate stats
GET/api/audit-logAudit trail

Network-management endpoints (/api/networks…) are present and used by the current CLI. /api/license[…] is present as an experimental legacy trial/pro-license surface.

Auth: Authorization: Bearer <token> header, or ?token=<token> query.

SQLite schema (13 tables)

Auto-created on first run.

TablePurpose
sessionsLive agent sessions
inboxPending messages and tasks
tasksTask state machine
nodesPersistent node identity
completionsFinal completion records
task_eventsPer-state audit
usersAccounts
networksWorkspaces
api_tokensutok_ / ntok_ / atok_ tokens
audit_logOperation audit
licensesExperimental trial/pro-license state
network_membersWorkspace membership
network_invitesInvite codes

Task state machine:

created → delivered → acked → running → replied
                                      → failed → retry → delivered
                                      → cancelled
delivered → expired (5min watchdog)
delivered/acked/running → reassign → delivered (new agent)

PostgreSQL (community extension point — not on the maintained roadmap)

v0.8+ product direction is SQLite only (see docs/v3-postgresql-design.md banner). The PostgreSQL adapter interface is preserved as a community extension point — no E2E coverage on the current stable line; not recommended for mainline production.

Set DATABASE_URL to switch to PostgreSQL — the SQL layer auto-translates SQLite-isms (datetime, parameter placeholders) so application code is unchanged. Requires bun add pg.

DATABASE_URL=postgres://user:pass@host:5432/commhub bunx @sleep2agi/commhub-server

Environment

VariableDefaultNotes
PORT9200listen port
HOST0.0.0.0 in the server package, 127.0.0.1 when launched by anet hub startlisten address
COMMHUB_AUTH_TOKEN(none)Bearer token gate (legacy)
COMMHUB_DB~/.commhub/commhub.dbSQLite path
DATABASE_URL(none)switches to PostgreSQL when set (unverified)

Auth modes

  • V3 user system (default)POST /api/auth/register and /api/auth/login issue utok_… tokens; nodes get ntok_….
  • Legacy global token — set COMMHUB_AUTH_TOKEN and pass it as Bearer / query.

/health is always public.

Not verified

  • /api/license* — experimental legacy trial/pro-license endpoints.
  • PostgreSQL backend — translation layer exists, no E2E run.
  • Telegram / WeChat / Feishu channel endpoints — channel code exists, but only Telegram-oriented agent-node paths are actively exercised.

License

Apache-2.0

Keywords

commhub

FAQs

Package last updated on 10 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts