MCP Tools
dtoolkit exposes its functionality through the Model Context Protocol (MCP), allowing AI coding agents to interact with memory, project management, and observability services using structured tool calls. Each service runs an MCP server alongside its REST API on the same port.
dbrain MCP Tools
Section titled “dbrain MCP Tools”dbrain is the persistent memory server. Its MCP tools let agents store, search, and manage memories organized as entities and facts with automatic tiering (hot/warm/cold).
Port: 7878 (shared with REST API)
| Tool | Description | Parameters |
|---|---|---|
recall | Search memories across all entities. When federation is enabled, results include both local and connected shared brain memories. | query (string, required), limit (number), federated (boolean) |
remember | Save a single atomic fact about an entity. Creates the entity if it does not exist. | entity (string, required), fact (string, required), source (string) |
get_entity | Retrieve full context for a specific entity, including all associated facts and metadata. | name (string, required) |
list_entities | List entities filtered by category or type. Returns name, category, type, and summary for each. | category (string), type (string) |
create_entity | Create a new entity with metadata. Use remember afterwards to attach facts. | name (string, required), category (string, required), type (string, required), summary (string) |
bump | Touch a fact to reset its decay timer and keep it in the hot tier. | factId (string, required) |
log | Store conversation messages at natural breakpoints for later review. | messages (array, required) |
overview | Return brain statistics: entity count, fact count, tier distribution, connection status. | — |
share | Push a fact to a connected shared brain. Only available when the brain has active connections. | factId (string, required) |
compact | Deduplicate facts and recalculate memory tiers. Admin-only operation. | — |
Memory tiers
Section titled “Memory tiers”Facts in dbrain are automatically organized into three tiers based on recency and access frequency:
| Tier | Behavior |
|---|---|
| Hot | Recently accessed or bumped. Prioritized in recall results. |
| Warm | Accessed within a moderate window. Included in recall but ranked lower. |
| Cold | Stale facts. Still searchable but deprioritized. Candidates for compaction. |
Use bump to promote important facts back to hot tier. The compact tool deduplicates redundant facts and recalculates tiers across the entire brain.
Federation
Section titled “Federation”When a personal brain is connected to a shared brain (via dbrain connect), the recall tool automatically federates queries across both. Use share to explicitly push a fact from your personal brain to the shared brain.
dwork MCP Tools
Section titled “dwork MCP Tools”dwork is the AI-native project manager. Its 21 MCP tools plus 5 graph tools cover project CRUD, task management, documentation, search, and code intelligence.
Port: 7881 (shared with REST API)
Project management
Section titled “Project management”| Tool | Description | Parameters |
|---|---|---|
create_project | Scaffold a new project with directory structure and initial BACKLOG.md. | name (string, required), description (string), template (string) |
get_project | Retrieve project metadata, task summary, and doc count. | projectId (string, required) |
list_projects | List all registered projects with status summaries. | — |
update_project | Update project metadata (name, description, status). | projectId (string, required), name (string), description (string), status (string) |
Task management
Section titled “Task management”Tasks are stored in each project’s BACKLOG.md file. The SQLite FTS5 index is derived from these Markdown files.
| Tool | Description | Parameters |
|---|---|---|
add_task | Add a new task to a project’s BACKLOG.md. | projectId (string, required), title (string, required), description (string), priority (string), status (string) |
get_tasks | List tasks for a project, optionally filtered by status or priority. | projectId (string, required), status (string), priority (string) |
update_task | Update task fields (title, description, status, priority). | projectId (string, required), taskId (string, required), title (string), description (string), status (string), priority (string) |
Documentation
Section titled “Documentation”| Tool | Description | Parameters |
|---|---|---|
add_doc | Add a numbered Markdown document to a project. | projectId (string, required), title (string, required), content (string, required) |
get_doc | Retrieve a specific document by ID. | projectId (string, required), docId (string, required) |
get_docs | List all documents for a project. | projectId (string, required) |
update_doc | Update document title or content. | projectId (string, required), docId (string, required), title (string), content (string) |
Search and overview
Section titled “Search and overview”| Tool | Description | Parameters |
|---|---|---|
search | Full-text search across all projects, tasks, and docs using FTS5 OR matching. | query (string, required), projectId (string) |
overview | Global statistics: project count, task breakdown by status, recent activity. | — |
sync | Re-index Markdown files into SQLite. Run after external edits to BACKLOG.md. | projectId (string) |
Planning
Section titled “Planning”| Tool | Description | Parameters |
|---|---|---|
get_roadmap | Retrieve the project roadmap derived from task priorities and statuses. | projectId (string, required) |
what_to_do_next | AI-prioritized suggestion of the next task to work on, based on status, priority, and dependencies. | projectId (string) |
Code graph tools
Section titled “Code graph tools”These tools are powered by @dtoolkit/codegraph-sdk and provide semantic code intelligence over the project’s codebase.
| Tool | Description | Parameters |
|---|---|---|
graph_search | Semantic search over code symbols (functions, classes, types) in the project’s knowledge graph. | query (string, required), projectId (string), kind (string) |
graph_stats | Statistics about the code graph: symbol counts by kind, file counts, edge counts. | projectId (string, required) |
graph_trace | Trace the dependency chain of a symbol — what it depends on and what depends on it. | projectId (string, required), symbol (string, required), direction (string) |
graph_impact | Analyze the impact radius of changing a symbol — all transitive dependents. | projectId (string, required), symbol (string, required) |
graph_context | Retrieve full context for a symbol: definition, references, documentation, and surrounding code. | projectId (string, required), symbol (string, required) |
dops MCP Tools
Section titled “dops MCP Tools”dops provides agent observability. Its MCP tools allow agents and dashboards to log sessions and query usage metrics.
Port: 7883 (shared with REST API)
| Tool | Description | Parameters |
|---|---|---|
log_session | Ingest a completed session with token counts, cost, tool usage, and outcome. | sessionId (string, required), provider (string, required), tokens (object), cost (number), tools (array), success (boolean), error (string) |
get_stats | Retrieve aggregated statistics: total sessions, tokens, cost, success rate, by provider and time range. | provider (string), from (string), to (string) |
get_costs | Cost breakdown by provider, model, and time period. | provider (string), from (string), to (string), groupBy (string) |
get_sessions | List recorded sessions with filtering and pagination. | provider (string), from (string), to (string), limit (number), offset (number) |
health | Service health check. Returns status and uptime. | — |
Tool discovery
Section titled “Tool discovery”MCP clients discover available tools automatically when connecting to a dtoolkit service. Each service exposes its tool list via the standard MCP tools/list method.
To connect an AI coding agent to dtoolkit services, use dcontext:
dcontext initdcontext installThis configures the agent’s native hook system (e.g., Claude Code’s settings.json, Gemini CLI’s settings.json) to connect to running dtoolkit MCP servers.
Manual MCP connection
Section titled “Manual MCP connection”If you prefer manual configuration, point your MCP client at the service URL:
# dbrain MCP endpointhttp://localhost:7878/mcp
# dwork MCP endpointhttp://localhost:7881/mcp
# dops MCP endpointhttp://localhost:7883/mcpAll endpoints accept standard MCP JSON-RPC messages over HTTP with SSE streaming for server-initiated messages.
Cross-service patterns
Section titled “Cross-service patterns”All dtoolkit MCP services share these conventions:
| Pattern | Detail |
|---|---|
| Authentication | Bearer token via Authorization header. Generate keys with <service> keys create. |
| Transport | MCP over HTTP on the same port as the REST API. |
| Error format | Standard MCP error responses with code and message fields. |
| Idempotency | Read operations are safe to retry. Write operations use unique IDs to prevent duplicates. |
| Permissions | Some tools (e.g., compact) require admin-level API keys. |