Skip to content

MCP Server Reference

The LumenFlow MCP server exposes Software Delivery Pack tools and kernel runtime tools to AI assistants via the Model Context Protocol. The majority of the 110 tools are Software Delivery Pack tools; 7 are kernel runtime task primitives for advanced use cases.

The MCP server is provided by @lumenflow/mcp:

pnpm add @lumenflow/mcp

The MCP server runs over stdio and is typically configured in your AI client:

# Direct execution
npx @lumenflow/mcp

# Or via the CLI binary
lumenflow-mcp
VariableDescriptionDefault
LUMENFLOW_PROJECT_ROOTProject root directoryprocess.cwd()
LUMENFLOW_MCP_LOG_LEVELLog level (debug, info, warn, error)info

The MCP server exposes 110 tools organized into 13 categories (103 in the core allTools registry plus 7 runtime task tools):

CategoryCountDescription
Core WU Operations8Basic WU lifecycle and context
Public Parity Operations (W1)15Ops/setup parity families from public CLI
Public Parity Operations (W2)17File/git/plan/signal/config parity families
Additional WU Operations17Extended WU management
Initiative Operations8Multi-phase project orchestration
Memory Operations14Session tracking and agent coordination
Agent Operations4Agent session management and issue logging
Orchestration Operations3Initiative execution and monitoring
Delegation Operations1Sub-agent delegation tree management
Flow/Metrics Operations3DORA metrics and flow analysis
Validation Operations5WU and configuration validation
Setup Operations8LumenFlow initialization and configuration
Runtime Task Tools7Kernel runtime task lifecycle

Tool inventory source of truth: packages/@lumenflow/mcp/src/tools.ts (allTools + runtimeTaskTools).

Public CLI parity target is 91 normalized public commands (: and - converted to _). The allTools array contains 103 tools because 12 tools are intentionally MCP-only extras. The runtimeTaskTools array adds 7 kernel-native task tools for a total of 110 registered tools.


Get current LumenFlow context including location, git state, and active WU.

Input: None

Output:

{
  "location": {
    "type": "worktree",
    "cwd": "/path/to/worktrees/lane-wu-xxx",
    "mainCheckout": "/path/to/repo"
  },
  "git": {
    "branch": "lane/operations/wu-123",
    "dirty": false
  },
  "wu": {
    "id": "WU-123",
    "status": "in_progress"
  }
}

List all Work Units with optional filtering.

Input:

ParameterTypeDescription
statusstringFilter by status (ready, in_progress, blocked, waiting, done)
lanestringFilter by lane name

Output: Array of WU objects matching filters.

Get detailed status of a specific Work Unit.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID (e.g., WU-1234)

Output: Full WU status including spec, location, and valid commands.

Create a new Work Unit specification.

Input:

ParameterTypeRequiredDescription
idstringNoWU ID (auto-generated if omitted)
lanestringYesLane name (e.g., Framework: CLI)
titlestringYesWU title
descriptionstringNoContext/Problem/Solution description
acceptancestring[]NoAcceptance criteria
code_pathsstring[]NoCode paths this WU will modify
exposurestringNoExposure level (ui, api, backend-only, documentation)

Output: Confirmation message with created WU ID.

Claim a Work Unit and create a worktree for implementation.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to claim
lanestringYesLane for the WU

Output: Confirmation with worktree path.

Complete a Work Unit (merge, stamp, cleanup).

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to complete
skip_gatesbooleanNoSkip gates (requires reason)
reasonstringNoReason for skipping gates
fix_wustringNoWU ID that will fix the skipped issue

Output: Confirmation message or error if called from worktree.

Run LumenFlow quality gates (lint, typecheck, tests).

Input:

ParameterTypeRequiredDescription
docs_onlybooleanNoRun docs-only gates (skip lint/typecheck/tests)

Output: Gate results or error details.


These tools were added to close ops/setup parity gaps against the public CLI manifest.

MCP ToolCLI CommandPurpose
backlog_prunebacklog:prunePrune stale backlog entries
docs_syncdocs:syncSync onboarding docs/templates
gatesgatesRun quality gates
gates_docsgates --docs-onlyRun docs-only gates
lane_healthlane:healthReport lane overlap/health
lane_suggestlane:suggestSuggest lane from scope/context
lumenflowlumenflowMain CLI entrypoint
lumenflow_gatesgatesFramework gates wrapper
lumenflow_validatevalidateFramework validation wrapper
lumenflow_metricslumenflow:metricsFramework metrics wrapper
metricsmetricsMetrics CLI
state_bootstrapstate:bootstrapBootstrap state store
state_cleanupstate:cleanupCleanup state artifacts
state_doctorstate:doctorDiagnose/repair state issues
sync_templatessync:templatesSync framework templates

These tools were added to close file/git/plan/signal/proto parity gaps.

MCP ToolCLI CommandPurpose
file_readfile:readRead files with line/size controls
file_writefile:writeWrite files with optional safety flags
file_editfile:editExact string replacement editing
file_deletefile:deleteDelete files/directories
git_statusgit:statusGit status reporting
git_diffgit:diffGit diff inspection
git_loggit:logCommit history inspection
git_branchgit:branchBranch listing/inspection
init_planinit:planInitiative plan linking/creation
plan_createplan:createCreate plan files
plan_editplan:editEdit plan sections
plan_linkplan:linkLink plan URIs to WUs/initiatives
plan_promoteplan:promotePromote plan status
signal_cleanupsignal:cleanupCleanup stale coordination signals
wu_protowu:protoCreate+claim relaxed prototype WUs

Block a Work Unit and move it from in_progress to blocked status.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to block
reasonstringYesReason for blocking
remove_worktreebooleanNoRemove worktree when blocking

Unblock a Work Unit and move it from blocked to in_progress status.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to unblock
reasonstringNoReason for unblocking
create_worktreebooleanNoCreate worktree when unblocking

Edit Work Unit spec fields with micro-worktree isolation.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to edit
descriptionstringNoNew description text
acceptancestring[]NoAcceptance criteria to add
notesstringNoNotes text to add
code_pathsstring[]NoCode paths to add
lanestringNoNew lane assignment
prioritystringNoNew priority (P0, P1, P2, P3)
initiativestringNoInitiative ID
phasenumberNoPhase number within initiative
no_strictbooleanNoBypass strict validation

Release an orphaned WU from in_progress back to ready state for reclaiming.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to release
reasonstringNoReason for releasing

Analyze and fix WU state inconsistencies.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to recover
actionstringNoRecovery action (resume, reset, nuke, cleanup)
forcebooleanNoRequired for destructive actions
jsonbooleanNoOutput as JSON

Unified WU repair tool - detect and fix WU state issues.

Input:

ParameterTypeRequiredDescription
idstringNoWU ID to check/repair
checkbooleanNoAudit only, no changes
allbooleanNoCheck/repair all WUs
claimbooleanNoClaim repair mode
adminbooleanNoAdmin repair mode
repair_statebooleanNoState repair mode

Visualize WU dependency graph.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to analyze
formatstringNoOutput format (table, json, ascii, mermaid)
depthnumberNoMaximum traversal depth
directionstringNoGraph direction (up, down, both)

Prepare WU for completion by running gates in worktree.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to prepare
docs_onlybooleanNoRun docs-only gates

Fast validation of code_paths and test paths before gates run (under 5 seconds vs 2+ minutes).

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to preflight
worktreestringNoOverride worktree path

Clean stale worktrees (dry-run by default).

Input:

ParameterTypeRequiredDescription
executebooleanNoExecute cleanup (default is dry-run)

Safely delete WU YAML files with micro-worktree isolation.

Input:

ParameterTypeRequiredDescription
idstringNoWU ID to delete
dry_runbooleanNoShow what would be deleted without changes
batchstringNoDelete multiple WUs (comma-separated)

Clean up worktree and branch after PR merge (PR-based completion workflow).

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to cleanup
artifactsbooleanNoRemove build artifacts

Generate handoff prompt for sub-agent WU execution.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to brief
clientstringNoTarget client (e.g. claude-code, codex-cli, gemini-cli)
thinkingbooleanNoEnable extended thinking
budgetnumberNoToken budget for extended thinking
no_contextbooleanNoSkip memory context injection

Generate delegation prompt and record explicit lineage intent.

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to delegate
parent_wustringYesParent WU ID for delegation lineage
clientstringNoTarget client (e.g. claude-code, codex-cli, gemini-cli)
thinkingbooleanNoEnable extended thinking
budgetnumberNoToken budget for extended thinking
no_contextbooleanNoSkip memory context injection

Validate WU YAML files against schema (strict mode by default).

Input:

ParameterTypeRequiredDescription
idstringYesWU ID to validate
no_strictbooleanNoBypass strict validation

Suggest lane for a WU based on code paths and description.

Input:

ParameterTypeRequiredDescription
idstringNoWU ID to analyze (reads YAML)
pathsstring[]NoCode paths to analyze
descstringNoWU description/title text

Safely unlock a lane lock with audit logging.

Input:

ParameterTypeRequiredDescription
lanestringNoLane name to unlock
reasonstringNoReason for unlocking
forcebooleanNoForce operation
listbooleanNoList all current lane locks
statusbooleanNoShow detailed status for the lane

List all initiatives with optional status filter.

Input:

ParameterTypeRequiredDescription
statusstringNoFilter by status (active, completed, paused)
jsonbooleanNoOutput as JSON

Get detailed status of a specific initiative including WUs and progress.

Input:

ParameterTypeRequiredDescription
idstringYesInitiative ID (e.g., INIT-001)
jsonbooleanNoOutput as JSON

Create a new initiative for multi-phase project orchestration.

Input:

ParameterTypeRequiredDescription
idstringYesInitiative ID (e.g., INIT-001)
titlestringYesInitiative title
descriptionstringNoInitiative description
phasesstring[]NoPhase names (e.g., “Phase 1: MVP”)

Edit initiative fields.

Input:

ParameterTypeRequiredDescription
idstringYesInitiative ID to edit
titlestringNoNew title
descriptionstringNoNew description
statusstringNoNew status (active, completed, paused)

Add a Work Unit to an initiative, optionally assigning to a phase.

Input:

ParameterTypeRequiredDescription
initiativestringYesInitiative ID
wustringYesWU ID to add
phasenumberNoPhase number to assign (1-based)

Remove a Work Unit from an initiative.

Input:

ParameterTypeRequiredDescription
initiativestringYesInitiative ID
wustringYesWU ID to remove

Bulk assign WUs to an initiative based on pattern matching.

Input:

ParameterTypeRequiredDescription
idstringYesInitiative ID
patternstringNoPattern to match WU titles (e.g., “MCP:*“)
phasenumberNoPhase to assign matched WUs

Link an existing plan or create a new plan template for an initiative.

Input:

ParameterTypeRequiredDescription
initiativestringYesInitiative ID
planstringNoPath to existing plan file
createbooleanNoCreate a new plan template

Initialize memory layer for a Work Unit.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to initialize memory for

Start a memory session for a Work Unit.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to start session for
lanestringNoLane name

Check pending memory nodes for a Work Unit.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to check

Save a progress checkpoint for a Work Unit.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to checkpoint
messagestringNoCheckpoint message

Clean up stale memory data.

Input:

ParameterTypeRequiredDescription
dry_runbooleanNoPreview cleanup without making changes

Get memory context for a Work Unit, optionally filtered by lane.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to get context for
lanestringNoFilter by lane

Create a memory node (e.g., for bug discovery).

Input:

ParameterTypeRequiredDescription
messagestringYesMemory node message
wustringYesWU ID to associate with
typestringNoNode type (e.g., “discovery”)
tagsstring[]NoTags for the node

Delete or archive a memory node.

Input:

ParameterTypeRequiredDescription
idstringYesMemory node ID to delete

Export memory for a Work Unit as markdown or JSON.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to export
formatstringNoExport format (markdown, json)

Check coordination signals from other agents.

Input:

ParameterTypeRequiredDescription
sincestringNoTime filter (e.g., “30m”, “1h”)
wustringNoFilter by WU ID
lanestringNoFilter by lane

Broadcast a coordination signal to other agents.

Input:

ParameterTypeRequiredDescription
messagestringYesSignal message
wustringYesWU ID to associate with

Summarize memory context for a Work Unit.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to summarize

Triage discovered issues and bugs for a Work Unit.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to triage

Generate post-compaction recovery context for a Work Unit.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to recover context for
max_sizenumberNoMaximum output size in bytes
formatstringNoOutput format (json or human)
quietbooleanNoSuppress header/footer output
base_dirstringNoBase directory override

Start an agent session for tracking WU execution.

Input:

ParameterTypeRequiredDescription
wustringYesWU ID to work on (e.g., WU-1234)
tiernumberYesContext tier (1, 2, or 3)
agent_typestringNoAgent type (e.g. claude-code, codex-cli, gemini-cli)

End the current agent session and return summary.

Input: None

Log a workflow issue or incident during agent execution.

Input:

ParameterTypeRequiredDescription
categorystringYesIssue category (workflow, tooling, confusion, violation, error)
severitystringYesSeverity level (blocker, major, minor, info)
titlestringYesShort description (5-100 chars)
descriptionstringYesDetailed context (10-2000 chars)
resolutionstringNoHow the issue was resolved
tagsstring[]NoTags for categorization
stepstringNoCurrent workflow step (e.g., wu:done, gates)
filesstring[]NoRelated file paths

Query and display logged agent incidents/issues summary.

Input:

ParameterTypeRequiredDescription
sincenumberNoDays to include (default: 7)
categorystringNoFilter by category
severitystringNoFilter by severity (blocker, major, minor, trivial)

Orchestrate initiative execution with parallel agent spawning.

Input:

ParameterTypeRequiredDescription
initiativestringYesInitiative ID to orchestrate (e.g., INIT-001)
dry_runbooleanNoShow execution plan without spawning agents
progressbooleanNoShow current progress only
checkpoint_per_wavebooleanNoSpawn next wave then exit (no polling)

Show compact initiative progress status including WUs and lane availability.

Input:

ParameterTypeRequiredDescription
initiativestringYesInitiative ID (e.g., INIT-001)

Monitor delegated agent progress and delegation health (stuck detection, zombie locks).

Input:

ParameterTypeRequiredDescription
thresholdnumberNoStuck detection threshold in minutes (default: 30)
recoverbooleanNoRun recovery actions for stuck spawns
dry_runbooleanNoShow what would be done without action
sincestringNoShow signals since (e.g., 30m, 1h)
wustringNoFilter by WU ID
signals_onlybooleanNoOnly show signals (skip spawn analysis)

Display delegation trees for WUs or initiatives.

Input:

ParameterTypeRequiredDescription
wustringNoWU ID to show delegations for (e.g., WU-1234)
initiativestringNoInitiative ID to show all delegations for
jsonbooleanNoOutput as JSON

Identify flow bottlenecks in the workflow (WIP violations, stuck WUs, etc.).

Input:

ParameterTypeRequiredDescription
jsonbooleanNoOutput as JSON

Generate flow metrics report with cycle time, throughput, and other DORA metrics.

Input:

ParameterTypeRequiredDescription
sincestringNoStart date or duration (e.g., “7d”, “2025-01-01”)
untilstringNoEnd date (e.g., “now”, “2025-01-31”)
jsonbooleanNoOutput as JSON

Capture a snapshot of current LumenFlow metrics.

Input:

ParameterTypeRequiredDescription
jsonbooleanNoOutput as JSON

Validate WU YAML files and status consistency.

Input:

ParameterTypeRequiredDescription
idstringNoSpecific WU ID to validate
strictbooleanNoFail on warnings too
done_onlybooleanNoOnly validate done WUs

Validate agent skill definitions in .claude/skills/.

Input:

ParameterTypeRequiredDescription
skillstringNoSpecific skill to validate (e.g., “wu-lifecycle”)

Validate agent synchronization state.

Input: None

Validate backlog synchronization between WU YAMLs and backlog.md.

Input: None

Validate skills specification files.

Input: None


Initialize LumenFlow workflow framework in a project.

Input:

ParameterTypeRequiredDescription
clientstringNoClient type (claude, cursor, windsurf, all)
mergebooleanNoMerge into existing files using bounded markers

Diagnose LumenFlow configuration and safety components.

Input: None

Generate enforcement hooks for a specific client.

Input:

ParameterTypeRequiredDescription
clientstringYesTarget client (e.g. claude-code, codex-cli, cursor, gemini-cli)

Upgrade LumenFlow packages to latest versions.

Input: None

List all available LumenFlow CLI commands.

Input: None

Sync agent documentation after upgrading LumenFlow packages.

Input: None

Run LumenFlow release workflow (versioning, npm publish).

Input:

ParameterTypeRequiredDescription
dry_runbooleanNoPreview release without publishing

Sync LumenFlow templates to the project.

Input: None


These 7 tools are available when the kernel runtime is active. They are part of the runtimeTaskTools registry and are additive to the core allTools set.

ToolDescription
task_claimClaim a task for execution
task_createCreate a new task
task_completeMark a task as completed
task_blockBlock a task
task_unblockUnblock a task
task_inspectInspect task state
task_tool_executeExecute a tool within a task context

The MCP server exposes 3 resources for reading LumenFlow data:

Type: Static resource

Current LumenFlow context including location, git state, and active WU.

{
  "uri": "lumenflow://context",
  "mimeType": "application/json"
}

Type: Resource template

Work Unit specification by ID. Replace {id} with the WU ID.

{
  "uriTemplate": "lumenflow://wu/{id}",
  "mimeType": "application/json"
}

Example: lumenflow://wu/WU-1427

Type: Static resource

Current LumenFlow backlog with all WUs grouped by status.

{
  "uri": "lumenflow://backlog",
  "mimeType": "text/markdown"
}

Add to your Claude Code MCP configuration:

{
  "mcpServers": {
    "lumenflow": {
      "command": "npx",
      "args": ["@lumenflow/mcp"],
      "env": {
        "LUMENFLOW_PROJECT_ROOT": "/path/to/your/project"
      }
    }
  }
}

Add to your Cursor MCP settings:

{
  "mcpServers": {
    "lumenflow": {
      "command": "npx",
      "args": ["@lumenflow/mcp"]
    }
  }
}
import { createMcpServer } from '@lumenflow/mcp';

const server = createMcpServer({
  projectRoot: '/path/to/project',
  logLevel: 'info',
});

await server.start();

The MCP package exports tools and resources for direct use:

import {
  createMcpServer,
  allTools,
  allResources,
  contextGetTool,
  wuListTool,
} from '@lumenflow/mcp';

// List available tools
const tools = allTools.map((t) => ({ name: t.name, description: t.description }));

// Execute a tool directly
const result = await contextGetTool.execute({}, { projectRoot: process.cwd() });

All tools return a consistent result structure:

interface ToolResult {
  success: boolean;
  data?: unknown;
  error?: {
    message: string;
    code?: string;
  };
}
CodeDescription
MISSING_PARAMETERRequired parameter not provided
CONTEXT_ERRORFailed to compute LumenFlow context
WU_LIST_ERRORFailed to list WUs
WU_STATUS_ERRORFailed to get WU status
WU_CREATE_ERRORFailed to create WU
WU_CLAIM_ERRORFailed to claim WU
WU_DONE_ERRORFailed to complete WU
WRONG_LOCATIONOperation called from wrong location
GATES_ERRORGates failed
WU_BLOCK_ERRORFailed to block WU
WU_UNBLOCK_ERRORFailed to unblock WU
WU_EDIT_ERRORFailed to edit WU
WU_RELEASE_ERRORFailed to release WU
WU_RECOVER_ERRORFailed to recover WU
WU_REPAIR_ERRORFailed to repair WU
WU_DEPS_ERRORFailed to get WU dependencies
WU_PREP_ERRORFailed to prep WU
WU_PREFLIGHT_ERRORFailed to preflight WU
WU_PRUNE_ERRORFailed to prune worktrees
WU_DELETE_ERRORFailed to delete WU
WU_CLEANUP_ERRORFailed to cleanup WU
WU_DELEGATE_ERRORFailed to delegate WU
WU_VALIDATE_ERRORFailed to validate WU
WU_INFER_LANE_ERRORFailed to infer lane
WU_UNLOCK_LANE_ERRORFailed to unlock lane
INITIATIVE_LIST_ERRORFailed to list initiatives
INITIATIVE_STATUS_ERRORFailed to get initiative status
INITIATIVE_CREATE_ERRORFailed to create initiative
INITIATIVE_EDIT_ERRORFailed to edit initiative
INITIATIVE_ADD_WU_ERRORFailed to add WU to initiative
INITIATIVE_REMOVE_WU_ERRORFailed to remove WU from initiative
INITIATIVE_BULK_ASSIGN_ERRORFailed to bulk assign WUs
INITIATIVE_PLAN_ERRORFailed to link plan
MEM_INIT_ERRORFailed to initialize memory
MEM_START_ERRORFailed to start session
MEM_READY_ERRORFailed to check ready nodes
MEM_CHECKPOINT_ERRORFailed to save checkpoint
MEM_CLEANUP_ERRORFailed to cleanup memory
MEM_CONTEXT_ERRORFailed to get memory context
MEM_CREATE_ERRORFailed to create memory node
MEM_DELETE_ERRORFailed to delete memory node
MEM_EXPORT_ERRORFailed to export memory
MEM_INBOX_ERRORFailed to check inbox
MEM_SIGNAL_ERRORFailed to send signal
MEM_SUMMARIZE_ERRORFailed to summarize memory
MEM_TRIAGE_ERRORFailed to triage issues
MEM_RECOVER_ERRORFailed to recover memory context
AGENT_SESSION_ERRORFailed to start agent session
AGENT_SESSION_END_ERRORFailed to end agent session
AGENT_LOG_ISSUE_ERRORFailed to log issue
AGENT_ISSUES_QUERY_ERRORFailed to query issues
ORCHESTRATE_INITIATIVE_ERRORFailed to orchestrate initiative
ORCHESTRATE_INIT_STATUS_ERRORFailed to get initiative status
ORCHESTRATE_MONITOR_ERRORFailed to monitor delegations
DELEGATION_LIST_ERRORFailed to list delegations
FLOW_BOTTLENECKS_ERRORFailed to analyze bottlenecks
FLOW_REPORT_ERRORFailed to generate flow report
METRICS_SNAPSHOT_ERRORFailed to capture metrics
VALIDATE_ERRORValidation failed
VALIDATE_AGENT_SKILLS_ERRORFailed to validate skills
VALIDATE_AGENT_SYNC_ERRORFailed to validate agent sync
VALIDATE_BACKLOG_SYNC_ERRORFailed to validate backlog sync
VALIDATE_SKILLS_SPEC_ERRORFailed to validate skills spec
LUMENFLOW_INIT_ERRORFailed to initialize LumenFlow
LUMENFLOW_DOCTOR_ERRORDoctor found issues
LUMENFLOW_INTEGRATE_ERRORFailed to integrate hooks
LUMENFLOW_UPGRADE_ERRORFailed to upgrade
LUMENFLOW_COMMANDS_ERRORFailed to list commands
LUMENFLOW_DOCS_SYNC_ERRORFailed to sync docs
LUMENFLOW_RELEASE_ERRORFailed to run release
LUMENFLOW_SYNC_TEMPLATES_ERRORFailed to sync templates

The MCP server uses a pack dispatch architecture: tools are executed through the kernel runtime, not by shelling out to CLI commands.

AI Client (Claude, Cursor, etc.)


MCP Server (@lumenflow/mcp)

    ├─ runtimeFactory() → initializes KernelRuntime
    │   └─ loads workspace.yaml → resolves pack pins → loads pack manifests

    └─ executeViaPack(toolName, input, context)


    KernelRuntime.executeTool()

        ├─ 1. Tool lookup (pack manifest)
        ├─ 2. Scope intersection (workspace ∩ lane ∩ task ∩ tool)
        ├─ 3. Reserved path check (.lumenflow/**)
        ├─ 4. Input persistence (SHA-256 content-addressed)
        ├─ 5. Policy evaluation (deny-wins cascade)
        ├─ 6. Input validation (Zod schema)
        ├─ 7. Tool dispatch (in-process or subprocess/bwrap)
        └─ 8. Evidence recording (append-only JSONL)

Every MCP tool call passes through the kernel’s full execution pipeline, including scope intersection, policy evaluation, and evidence recording. This means MCP tools receive the same security guarantees as direct kernel API calls.

  1. runtimeFactory() — Creates a KernelRuntime instance for the workspace, loading the workspace spec and resolving all pack pins
  2. executeViaPack() — Routes the MCP tool call to the kernel’s executeTool() method with the appropriate execution context
  3. Kernel pipeline — The tool passes through scope, policy, validation, and dispatch stages (see Kernel Runtime for details)
  4. Evidence — Success or denial is recorded in the evidence store — the audit trail has no gaps