Structured Tools
Tools with typed inputs and outputs, not just text parsing
This guide walks you through setting up the LumenFlow MCP server with your AI coding assistant.
MCP (Model Context Protocol) is an open standard for AI-to-tool communication. Instead of relying on file-based instructions, MCP provides a programmatic interface for AI assistants to interact with development tools.
Structured Tools
Tools with typed inputs and outputs, not just text parsing
Resource Access
Direct access to LumenFlow data via URI patterns
Consistent Interface
Same tools work across different AI clients
Safety Maintained
All operations respect LumenFlow workflow rules
Before setting up MCP:
LumenFlow initialized in your project
AI client with MCP support
Install the MCP package (if not already included)
Verify the binary is available
Claude Code supports MCP servers via configuration files.
Option 1: Project-level configuration
Create or edit .claude/mcp.json:
Option 2: Global configuration
Add to your Claude Code settings (~/.config/claude/mcp.json on Linux, ~/Library/Application Support/claude/mcp.json on macOS):
Verify the connection:
In Claude Code, the LumenFlow tools should appear in the available tools list:
context_getwu_listwu_statuswu_createwu_claimwu_donegates_runfile_readgit_statusplan_createsignal_cleanupwu_protoThe full MCP surface is documented in /reference/mcp and currently includes
114 registered tools (107 in allTools plus 7 runtime task tools).
Add to your Cursor MCP configuration:
For any MCP-compatible client, configure:
| Setting | Value |
| --------- | -------------------- |
| Command | npx |
| Arguments | ["@lumenflow/mcp"] |
Environment variables:
| Variable | Description | Default |
| ------------------------- | ---------------------- | --------------- |
| LUMENFLOW_PROJECT_ROOT | Project root directory | process.cwd() |
| LUMENFLOW_MCP_LOG_LEVEL | Log level | info |
The examples above use stdio, which remains the default. Stdio is a local process-environment trust boundary and does not use the HTTP bearer flow.
For a shared long-lived service, select Streamable HTTP and configure the exact remote trust binding:
| Variable | Purpose |
| ------------------------------------- | ---------------------------------------------------- |
| LUMENFLOW_MCP_HTTP_ISSUER | Exact trusted credential issuer |
| LUMENFLOW_MCP_HTTP_RESOURCE | Exact protected resource URL and credential audience |
| LUMENFLOW_MCP_HTTP_WORKSPACE_ID | Exact workspace accepted by this MCP deployment |
| LUMENFLOW_CONTROL_PLANE_SIGNING_KEY | Secret used to verify signed remote credentials |
| LUMENFLOW_MCP_HTTP_HOST | Bind host; defaults to 127.0.0.1 |
| LUMENFLOW_MCP_HTTP_PORT | Bind port; defaults to 8848 |
Every MCP protocol request must send a signed Authorization: Bearer …
credential. Verification requires a valid signature and expiry, the configured
issuer, exact resource audience and workspace, and a canonical subject. Opaque
bearer fallback is off. Legacy tool scopes do not become transport permissions.
The supported transport permissions are:
task:read and task:writeevent:read and evidence:readdiscovery:readtool:invokeag-ui:runAuthentication occurs before URL parsing, body reads, session lookup, or MCP
server creation. Invalid credentials receive 401 invalid_token; an
authenticated caller without the operation permission receives
403 insufficient_scope.
The server never forwards the bearer to tools, the kernel, logs, evidence, or
session state. It stores only the sanitized principal, workspace, resource, and
permission set. Every Mcp-Session-Id is bound to that exact context; a later
request that changes the principal, workspace, resource, or permissions is
rejected. Successful transport admission does not bypass downstream kernel
ownership, scope, policy, approval, or evidence checks.
The protected-resource metadata endpoint is the public RFC 9728 exception. It
is derived from the resource URL: for
https://runtime.example.com/mcp, use
https://runtime.example.com/.well-known/oauth-protected-resource/mcp.
All other MCP HTTP routes require authentication.
The web HTTP surface uses the same signed credential and permission model, but its deployment variables are:
The web runtime reads the exact workspace ID from workspace.yaml.
GET /api/health without a credential is intentionally public but returns only
{ "success": true, "status": "ok" }. Presenting a credential opts into
authentication: an invalid credential is rejected, and detailed diagnostics
are returned only after successful authentication.
Once configured, your AI assistant can use LumenFlow tools directly.
The AI can check current context at any time:
AI assistants can read LumenFlow data via resources:
| Approach | Best For | When to Use | | ---------- | --------------------------- | ----------------------------- | | MCP | Programmatic AI interaction | AI clients with MCP support | | CLI | Human operators, scripts | Terminal workflows, CI/CD | | File-based | Universal AI compatibility | Any AI that can read markdown |
Check: Is the package installed?
Check: Can you run it directly?
Check: Is MCP enabled in your AI client?
Check: Is the configuration file in the correct location?
Check: Are there any errors in the AI client logs?
Check: Is LUMENFLOW_PROJECT_ROOT set correctly?
Fix: Use explicit path or ensure the AI client is opened in the project directory.
Check: Does the user running the AI client have access to the project?
Check: Are all LumenFlow files readable?
The MCP server:
For custom integrations:
Gates can take longer to run. The default timeout for gates_run is 10 minutes.
This is configured in the tool implementation and cannot be overridden via MCP.