All dtoolkit services expose REST APIs alongside their MCP interfaces on the same port. Every endpoint requires a Bearer token in the Authorization header unless noted otherwise.
curl -H " Authorization: Bearer <token> " http://localhost:7878/health
All services use the same auth pattern:
Header Value AuthorizationBearer <api-key>Content-Typeapplication/json
Keys are managed per-service. For shared brains (dbrain), additional keys can be issued to connected clients via the /keys endpoints.
Default port: 7878 (REST + MCP) | 7879 (dashboard)
The dbrain API provides CRUD access to entities, facts, conversations, and full-text search with optional federation across connected brains.
Method Path Description GET/entitiesList all entities. Supports ?category= and ?type= query filters. GET/entities/:nameGet a single entity by name, including its facts and metadata. POST/entitiesCreate a new entity. Body: { name, category, type?, metadata? }.
Method Path Description GET/entities/:name/factsList all facts for an entity. Supports ?tier= filter (hot, warm, cold). POST/entities/:name/factsAdd a fact to an entity. Body: { content, tier?, source? }.
Method Path Description GET/searchFull-text search across entities and facts. Query params: q (required), federated (boolean, searches connected brains when true).
Method Path Description GET/conversationsList stored conversation logs. POST/conversationsStore a conversation log entry. Body: { messages, source?, metadata? }.
Method Path Description GET/workspaceGet the current workspace context (identity, project facts, injected context).
Method Path Description GET/keysList all API keys. Shared brains only. POST/keysCreate a new API key. Shared brains only. Body: { label? }.
Method Path Description GET/connectionsList all federated brain connections (shared brains this instance connects to).
Method Path Description POST/compactTrigger compaction: deduplicates facts, recalculates memory tiers. Admin-only. GET/healthHealth check. Returns server status, brain type, and version. No auth required.
Default port: 7881 (REST + MCP) | 7882 (dashboard)
The dwork API manages projects, tasks (backed by BACKLOG.md files), docs, and provides full-text search across all project data.
Method Path Description GET/projectsList all projects with summary stats. GET/projects/:slugGet a single project by slug, including task counts and recent activity. POST/projectsCreate a new project. Body: { name, slug?, description? }. Scaffolds the project directory and BACKLOG.md. PATCH/projects/:slugUpdate project metadata. Body: { name?, description?, status? }.
Method Path Description GET/projects/:slug/tasksList all tasks for a project. Supports ?status= filter (backlog, in-progress, done, blocked). GET/projects/:slug/tasks/:idGet a single task by ID. POST/projects/:slug/tasksCreate a task. Body: { title, description?, status?, priority? }. Writes to BACKLOG.md. PATCH/projects/:slug/tasks/:idUpdate a task. Body: { title?, status?, priority?, description? }.
Method Path Description GET/projects/:slug/docsList all docs for a project (numbered markdown files). GET/projects/:slug/docs/:idGet a single doc by ID. POST/projects/:slug/docsCreate a doc. Body: { title, content }. PATCH/projects/:slug/docs/:idUpdate a doc. Body: { title?, content? }.
Method Path Description GET/searchFull-text search across all projects, tasks, and docs. Query param: q (required). GET/overviewGlobal overview: project count, task distribution by status, recent activity.
Method Path Description POST/syncRe-index all markdown files into SQLite FTS5. Use after manual edits to BACKLOG.md or doc files. GET/healthHealth check. Returns server status and version. No auth required. GET/keysList API keys. POST/keysCreate a new API key.
Default port: 7883 (REST + MCP) | 7884 (dashboard)
The dops API provides agent session tracking, cost analysis, and transcript ingestion from multiple AI coding CLIs.
Method Path Description GET/sessionsList ingested agent sessions. Supports ?provider= and ?limit= query params. GET/sessions/:idGet a single session with full tool-call and token breakdown.
Method Path Description GET/statsAggregated stats: total sessions, tokens, tool calls, success rate, errors. Supports ?from= and ?to= date filters. GET/costsCost breakdown by provider, model, and time period. Supports ?from=, ?to=, ?group_by= (day, week, month).
Method Path Description POST/ingestIngest a transcript from a supported CLI. Body: { provider, transcript, metadata? }. Accepts Claude, Codex, Gemini, and OpenCode transcript formats.
Method Path Description GET/healthHealth check. Returns server status and version. No auth required.
Default port: 7880
The dproxy API exposes the same capabilities as the CLI (dproxy ask and dproxy chat) over HTTP, with optional SSE streaming.
Method Path Description POST/askExecute a single prompt. Body: { prompt, provider?, model?, context? }. Returns the full response. Set stream: true in the body for SSE streaming. POST/chatSend a message in a conversation. Body: { message, conversation_id?, provider?, model? }. Maintains conversation history. Set stream: true for SSE.
When stream: true is included in the request body, the response uses Content-Type: text/event-stream and emits AdapterStreamEvent objects:
curl -N -H " Authorization: Bearer <token> " \
-H " Content-Type: application/json " \
-d ' {"prompt": "explain dtoolkit", "stream": true} ' \
http://localhost:7880/ask
Events follow the AdapterStreamEvent type defined in @dtoolkit/core:
Event type Description startStream opened, includes model and provider metadata. deltaIncremental text chunk. tool_useTool call made by the model. doneStream complete, includes token usage summary. errorAn error occurred during execution.
Method Path Description GET/historyList recent prompt/response history. Supports ?limit= query param. GET/healthHealth check. Returns server status, available providers, and version. No auth required.
Service REST + MCP Dashboard Default key location dbrain 78787879~/.dbrain/config.jsondproxy 7880— ~/.dproxy/config.jsondwork 78817882~/.dwork/config.jsondops 78837884~/.dops/config.json
All services return errors in a consistent JSON format:
"message" : " Entity 'foo' does not exist "
Status code Meaning 400Bad request — invalid or missing parameters. 401Unauthorized — missing or invalid Bearer token. 403Forbidden — insufficient permissions (e.g., write to read-only brain). 404Not found — resource does not exist. 500Internal server error.
MCP Tools Reference — full reference for all MCP tools exposed by dbrain, dwork, and dops
CLI Reference — command-line interfaces for all dtoolkit services
Getting Started — install and configure dtoolkit
dbrain — persistent memory server deep dive
dwork — AI-native project manager deep dive
dops — agent observability deep dive
dproxy — universal CLI adapter deep dive