@allpepper/task-orchestrator
v3.3.1
Published
MCP server for hierarchical task orchestration with SQLite persistence
Maintainers
Readme
Task Orchestrator Bun (v3)
Bun/TypeScript MCP server for hierarchical work orchestration with SQLite persistence.
This implementation is intentionally agent-first:
- Intent-based state transitions (
advance,revert,terminate) instead of target-state mutation. - Linear, configurable pipelines for
taskandfeaturestates. - Cross-entity dependency blocking (
task<->feature) with automatic unblocking rules. - Lean schema and operational model with optimistic locking.
What This Server Solves
AI agents struggle when they must manually reason about workflow internals before each state mutation.
This server reduces that burden by exposing high-level transition intent:
- The agent says "advance this item".
- The server validates version, transition legality, blocking constraints, and side effects.
- The server returns canonical transition output, affected entities, and warnings.
Core Model
Hierarchy
projectis a stateless board container.featurecontains grouped work.taskis executable work, optionally under a feature.moleculegroups related knowledge areas within a project (e.g., domains, systems).atommaps file patterns to knowledge about how those files work, optionally under a molecule.
Status Philosophy
projecthas no workflow status.featureandtaskfollow linear pipelines.- Terminal states are:
- pipeline last state (default
CLOSED) WILL_NOT_IMPLEMENT(exit state)
- pipeline last state (default
Blocking and Related Links
- Blocking is stored directly on entities via
blocked_byandblocked_reason. - Related links are symmetric via
related_to. - Dependency table is not used in v3.
Architecture
- Runtime: Bun
- Language: TypeScript (ESM)
- Persistence: SQLite (
bun:sqlite) - Transport:
- Dual transport (default): STDIO MCP + Streamable HTTP MCP
- HTTP only:
--httporTRANSPORT=http - STDIO only:
--stdioorTRANSPORT=stdio
Main entry points:
- CLI/server:
src/server.ts - Bootstrap:
src/bootstrap.ts - Config:
src/config/index.ts - Migration runner:
src/db/migrate.ts
Installation
Prerequisites
- Bun >= 1.0
Install
bun installRun (Default: Dual STDIO + HTTP)
bun run src/server.tsRun (HTTP Only)
bun run src/server.ts --httpRun (STDIO Only)
bun run src/server.ts --stdioOptional env vars:
PORTfor HTTP mode (default3100)TRANSPORT=httpfor HTTP-only modeTRANSPORT=stdiofor STDIO-only modeTASK_ORCHESTRATOR_HOMEto control config/db location
HTTP mode endpoints:
- MCP:
http://127.0.0.1:<PORT>/mcp - Status:
http://127.0.0.1:<PORT>/status
Storage and Paths
Default home directory:
~/.task-orchestrator
Files:
- Config:
~/.task-orchestrator/config.yaml - Database:
~/.task-orchestrator/tasks.db - Runtime status:
~/.task-orchestrator/runtime/mcp-http-status.json
Override both by setting:
TASK_ORCHESTRATOR_HOME=/custom/path
Bootstrapping Behavior
On server startup (bootstrap()):
- Ensures
config.yamlexists (writes default if missing) - Runs migrations (idempotent)
- Loads and validates config
- Runs startup checks for orphaned statuses
Configuration
Config file schema:
version: "3.0"
pipelines:
feature: [NEW, ACTIVE, CLOSED]
task: [NEW, ACTIVE, CLOSED]Optional pipeline states supported by catalog order:
- Feature:
READY_TO_PROD - Task:
TO_BE_TESTED,READY_TO_PROD
Important rules:
- Pipelines must start with
NEW. - Pipelines must include
ACTIVE. - Pipelines must end with
CLOSED. WILL_NOT_IMPLEMENTis always valid as exit state and must not be listed in pipeline arrays.
Config lock behavior:
- Before workflow data exists, pipeline config is mutable.
- After data exists, pipeline is locked in DB (
_pipeline_config) and file edits are ignored. - Use
syncwithoverride: trueto rotate DB and adopt new pipelines.
Data Semantics and Concurrency
IDs
- UUID v4, stored as 32-char lowercase dashless hex.
- Tool UUID input accepts dashed or dashless; normalized internally.
Optimistic Locking
- Mutable entities include
version. - Write operations requiring consistency checks will fail on version mismatch.
Blocking Special Token
NO_OP is a manual blocker token:
- Use when an item is blocked by external factors, not another entity.
- Requires
blockedReasononblock. - Removing
NO_OPviaunblockclearsblockedReasonwhen noNO_OPremains.
Workflow Side Effects
Advance (advance)
- Moves one step forward in pipeline.
- Refuses if blocked or terminal.
- If item reaches
CLOSED, dependents blocked by it are auto-unblocked. - Task->feature side effects:
- First task
NEW -> ACTIVEcan auto-advance featureNEW -> ACTIVE. - When all sibling tasks become terminal:
- all
WILL_NOT_IMPLEMENT-> featureWILL_NOT_IMPLEMENT - all closed or mixed terminal with >=1 closed -> feature
CLOSED
- all
- First task
Terminate (terminate)
- Moves item to
WILL_NOT_IMPLEMENT. - Bypasses blocked checks.
- Does not auto-unblock dependents.
- Returns affected dependents so the agent can reassess explicitly.
- Task termination can trigger feature side effects when all sibling tasks are terminal.
Revert (revert)
- Moves one step backward in pipeline.
- Not allowed from terminal states.
MCP Tool Catalog
Total tools exposed by server:
- Container CRUD/search:
query_container,manage_container - Sections:
query_sections,manage_sections - Templates:
query_templates,manage_template,apply_template - Tags:
list_tags,get_tag_usage,rename_tag - Queue and blocked insights:
get_next_task,get_blocked_tasks,get_next_feature,get_blocked_features - Workflow/dependencies:
query_workflow_state,query_dependencies,manage_dependency - Pipeline control:
advance,revert,terminate,block,unblock - Knowledge graph:
query_graph,manage_graph,manage_changelog - Ops:
sync
Container Tools
query_container
Read operations for project, feature, task.
Operations:
getby IDsearchwith filtersoverviewglobal or scoped hierarchy view
Key params:
operation,containerType,id- filters:
query,status,priority,tags,projectId,featureId - pagination:
limit,offset includeSections(forget)includeGraphContext(for taskget— automatically resolves knowledge graph context from the task's Context Files section)
manage_container
Write operations for project, feature, task.
Operations:
createupdatedelete
Important constraints:
- Status cannot be changed through this tool.
- Use
advance/revert/terminatefor state transitions. updaterequiresversion.
Section Tools
query_sections
Retrieves sections for PROJECT, FEATURE, TASK.
Supports:
includeContenttoggle for token savings- filtering by
tagsandsectionIds
manage_sections
Section lifecycle operations:
add,update,updateText,delete,reorder,bulkCreate,bulkDelete
Supports optimistic locking on update operations via version.
Template Tools
query_templates
Operations:
gettemplate (optional sections)listwith filters
Filters:
targetEntityType,isBuiltIn,isEnabled,tags
manage_template
Operations:
create,update,delete,enable,disable,addSection
Notes:
- Protected templates cannot be modified/deleted.
apply_template
Applies template sections onto PROJECT/FEATURE/TASK entity.
Tag Tools
list_tags: all tags with usage countsget_tag_usage: entities using a tagrename_tag: rename globally, supportsdryRun
Queue/Blocked Insight Tools
get_next_task
Returns next recommended task:
- status
NEW - unblocked (
blocked_by = []) - sorted by priority, then complexity, then oldest
Optional filters: projectId, featureId, priority
get_next_feature
Returns next recommended feature:
- status in
ACTIVE/NEW - unblocked
- prioritizes continuing active work before new work
Optional filters: projectId, priority
get_blocked_tasks / get_blocked_features
List blocked entities (blocked_by != []) with optional scope filters.
Workflow and Dependency Tools
query_workflow_state
For feature/task only. Returns:
- current status
- next/previous status
- terminal flag
- blocked state and blockers
- pipeline position
- related entities
manage_dependency
Create/delete cross-entity links:
BLOCKSRELATES_TO
Supports task <-> feature combinations.
query_dependencies
Read dependencies/dependents for task or feature.
Direction:
dependenciesdependentsboth
Pipeline Control Tools
advance
One-step forward transition with validation and side effects.
Requires:
containerType(taskorfeature)idversion
When a task reaches a completion terminal state (not WILL_NOT_IMPLEMENT), the response includes graphHints suggesting knowledge graph updates for the affected areas.
revert
One-step backward transition.
Requires:
containerTypeidversion
terminate
Exit transition to WILL_NOT_IMPLEMENT.
Requires:
containerTypeidversion
Optional:
reason
block
Attach blockers to a task/feature.
Input:
blockedBy: array of entity UUIDs orNO_OPblockedReason: required forNO_OP
Idempotent merge behavior.
unblock
Remove specific blockers.
Input:
blockedBy: array of blocker UUIDs to remove orNO_OP
Idempotent removal behavior.
Operations Tool
sync
Ensures orchestrator runtime state:
- creates config if missing
- runs migrations
- initializes config
If DB already has data:
- returns warning unless
override: true - with override, backs up current DB as deprecated timestamp file
- initializes fresh DB in place
Knowledge Graph Tools
The knowledge graph provides persistent, file-path-indexed codebase knowledge that agents can read and write across sessions. It organizes knowledge into a two-level hierarchy of molecules (domains/systems) and atoms (modules/components), with atoms linked to files via glob patterns.
Data Model
molecule— a high-level grouping (e.g., "Repository Layer", "Auth System"). Contains knowledge about the domain, related molecules, and member atoms.atom— a knowledge unit mapped to files via glob patterns (e.g.,src/repos/graph-*.ts). Contains knowledge about how the files work, related atoms, and changelog entries.changelog— immutable entries recording what changed in an atom or molecule, linked to the task that made the change.
All graph entities are scoped to a project. Atoms may optionally belong to a molecule. Atoms without a molecule are "orphans."
query_graph
Read operations for the knowledge graph.
Operations:
get— retrieve a single atom or molecule by ID, with optional changelogsearch— filtered list of atoms or molecules within a projectcontext— match comma-separated file paths against atom glob patterns, return hierarchical context grouped by molecule
Key params:
operation,entityType(atomormolecule)id(forget)projectId,query,moleculeId,orphansOnly(forsearch)paths(comma-separated file paths, forcontext)includeChangelog,changelogLimit
The context operation is the primary read path for agents. Given a set of file paths, it returns all matching atoms grouped under their molecules, with knowledge and recent changelog. Unmatched paths and orphan atoms are reported separately.
manage_graph
Write operations for the knowledge graph.
Operations:
create— create a new atom or moleculeupdate— modify fields (uses optimistic locking viaversion)delete— remove an entity (uses optimistic locking viaversion)
Key params:
operation,entityTypeprojectId,name,knowledge,paths(JSON array of globs),moleculeId,createdByTaskId(forcreate)id,version,name,knowledge,knowledgeMode(overwriteorappend),paths,moleculeId,lastTaskId,relatedAtoms,relatedMolecules(forupdate)id,version,cascade(fordelete— cascade deletes member atoms, otherwise orphans them)
Validation rules:
- Paths: max 20 per atom, max 512 chars each, no leading
/, no..traversal - Knowledge: max 32KB
- Name: max 255 chars
- Related entries: max 50 per entity
- Atoms must belong to the same project as their molecule
manage_changelog
Append and search changelog entries.
Operations:
append— create a new immutable changelog entrysearch— list entries for an atom or molecule, ordered by newest first
Key params:
operation,parentType(atomormolecule),parentIdtaskId,summary(forappend)limit,offset(forsearch)
Graph Integration with Workflow
The knowledge graph integrates with the orchestrator workflow at two points:
Task fetch —
query_containerwithincludeGraphContext: trueon a taskgetoperation automatically reads the task's Context Files section, extracts file paths, matches them against atom glob patterns, and returns the hierarchical graph context alongside the task data. No separatequery_graphcall needed.Task completion —
advancereturnsgraphHintswhen a task reaches a completion terminal state, suggesting the agent update atom knowledge, paths, and changelog for areas affected by the completed work.
Recommended Agent Usage Pattern
- Create or fetch work item with
manage_container/query_container. - Use
block/manage_dependencywhen dependency constraints are identified. - Fetch tasks with
includeGraphContext: trueto get relevant codebase knowledge. - Use
advanceto move forward, never direct status mutation. - After task completion, update the knowledge graph (atom knowledge, paths, changelog) for areas affected by the work.
- Use
terminateonly when work is explicitly abandoned and process affected dependents returned by tool output. - Use
query_workflow_statebefore major state decisions.
Example MCP Calls
Create a feature
{
"name": "manage_container",
"arguments": {
"operation": "create",
"containerType": "feature",
"projectId": "6f9c6d5fbd5d4ef7a6e3b4f77234a8d1",
"name": "Pipeline Tooling",
"summary": "Build linear transition tools",
"priority": "HIGH",
"tags": "workflow,pipeline"
}
}Advance a task safely
{
"name": "advance",
"arguments": {
"containerType": "task",
"id": "4f7ed4d3f1ab472e9c5f7f7488c104d9",
"version": 3
}
}Block with external dependency (NO_OP)
{
"name": "block",
"arguments": {
"containerType": "task",
"id": "4f7ed4d3f1ab472e9c5f7f7488c104d9",
"version": 4,
"blockedBy": "NO_OP",
"blockedReason": "Waiting for vendor security review"
}
}Fetch task with graph context
{
"name": "query_container",
"arguments": {
"operation": "get",
"containerType": "task",
"id": "a2d79a63bb4043fabef883335c076ecc",
"includeSections": true,
"includeGraphContext": true
}
}Create a knowledge graph atom
{
"name": "manage_graph",
"arguments": {
"operation": "create",
"entityType": "atom",
"projectId": "6f9c6d5fbd5d4ef7a6e3b4f77234a8d1",
"moleculeId": "097301b2db15495e97bdab2cabe0a960",
"name": "Graph Repos",
"paths": "[\"src/repos/graph-*.ts\"]",
"knowledge": "Three repo files for graph CRUD operations",
"createdByTaskId": "a2d79a63bb4043fabef883335c076ecc"
}
}Query graph context by file paths
{
"name": "query_graph",
"arguments": {
"operation": "context",
"projectId": "6f9c6d5fbd5d4ef7a6e3b4f77234a8d1",
"paths": "src/repos/graph-atoms.ts,src/repos/graph-molecules.ts"
}
}Terminate and inspect impacted dependents
{
"name": "terminate",
"arguments": {
"containerType": "feature",
"id": "c57ea2a8bfca4e5ea6541018ae7f95b0",
"version": 7,
"reason": "Scope removed"
}
}Testing
bun testDevelopment Scripts
- Start:
bun run src/server.ts - Watch mode:
bun --watch run src/server.ts - Tests:
bun test
Package Metadata
NPM package:
@allpepper/task-orchestrator
Binary entry:
task-orchestrator->src/server.ts
Compatibility Notes
This v3 design differs from event-driven orchestration engines:
- It emphasizes explicit, linear state movement.
- It avoids target-state mutation APIs for agent safety.
- It models blocking as first-class data fields with deterministic side effects.
If you need strict deterministic automation with lower agent reasoning overhead, this model is the intended path.
