SDK Node
HTTP server that exposes the full consensus-tools protocol as a REST API.
Overview
@consensus-tools/sdk-node is an HTTP server that exposes the entire consensus-tools protocol as REST endpoints. It covers jobs, ledger, guards, agents, workflows, cron scheduling, webhooks (GitHub, Linear, Slack, Teams, Discord, Telegram), and credential management. Use it when you need to run a consensus-tools backend accessible over HTTP.
Installation
Quick start
Full setup with workflows and webhooks
Wire in all optional engines to enable the complete feature set:
API reference
ConsensusToolsServer
The main export. Construct with a ServerDeps object, then call .start() to listen and .stop() to shut down.
ServerDeps
| Property | Required | Description |
|---|---|---|
config | Yes | ConsensusToolsConfig |
engine | Yes | JobEngine |
ledger | Yes | LedgerEngine |
storage | Yes | IStorage |
agentRegistry | No | AgentRegistry for agent management |
guardEngine | No | GuardEngine for action evaluation |
hitlTracker | No | HitlTracker for human approval flows |
workflowRunner | No | WorkflowRunner for workflow execution |
cronScheduler | No | CronScheduler for scheduled workflows |
credentialManager | No | CredentialManager for secrets |
logger | No | Logger with info and warn methods |
REST endpoints
| Area | Example Endpoints |
|---|---|
| Jobs | POST /api/jobs, GET /api/jobs, POST /api/jobs/:id/claim, POST /api/jobs/:id/submit, POST /api/jobs/:id/vote, POST /api/jobs/:id/resolve |
| Ledger | GET /api/ledger/:agentId, POST /api/ledger/faucet |
| Agents | POST /api/agents, GET /api/agents, POST /api/agents/:id/suspend |
| Guards | POST /api/guard/evaluate |
| Workflows | POST /api/workflows, POST /api/workflows/:id/run, POST /api/workflows/:id/resume |
| Cron | POST /api/cron/register, GET /api/cron |
| Webhooks | POST /api/webhooks/github, POST /api/webhooks/linear, POST /api/webhooks/slack |
| Templates | GET /api/templates |
Additional exports
| Export | Description |
|---|---|
WorkflowRunner | Minimal workflow runner interface (for type compatibility) |
CronScheduler | Minimal cron scheduler interface |
WebhookHandlerContext | Context passed to webhook handlers |
HandlerResult | Return type from webhook handlers |
Related
- SDK Client -- HTTP client that talks to this server
- Local Board -- Pre-configured local-board app built on sdk-node
- MCP -- MCP server adapter for LLM agents