AgentPrism Workflows
Integrates with OpenAI Codex (via codex-acp) to run AI agent sessions for coding tasks, supporting structured output and multiple model tiers.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AgentPrism WorkflowsRun a parallel code review on this PR with Claude and Codex."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AgentPrism Workflows
Run dynamic, multi-agent workflow scripts — agent(), parallel(), pipeline() — over real coding agents (Claude Code and OpenAI Codex), with deterministic journaling, resume, token budgets, and git-worktree isolation.
You author a small JavaScript script (export const meta, then call agent() / parallel() / pipeline()); the engine runs it in a sandboxed realm, fanning each agent() call out to an Agent Client Protocol (ACP) backend. It's available two ways:
As a TypeScript SDK —
@automatalabs/workflows— embed the runner in your own program.As a stdio MCP server —
@automatalabs/mcp-server, built on the SDK — expose aworkflowtool to any MCP host (Claude Code, Zed, …).
Status: pre-release. The packages are versioned
0.1.0under the@automatalabsscope and are being prepared for npm. Until they're published, install from source (see Install). Thenpm i …lines below are how it will work once published.
How it works
One process plays two protocol roles at once: it's an MCP server (or a library) that accepts a workflow script, and an ACP client that drives one or more agent subprocesses to execute each agent() call.
your program ──or── MCP host (Claude Code / Zed / …)
│ runDynamicWorkflow(script) calls tool "workflow"
▼
┌──────────────────────────────────────────────┐
│ AgentPrism orchestrator │
│ • the deterministic engine runs the script │
│ • ACP CLIENT → drives agent servers │
└──────────────────────────────────────────────┘
│ session/new, session/prompt … (ACP, JSON-RPC over stdio)
▼
claude-agent-acp / codex-acp (long-lived, pooled subprocesses)
│ → real Claude / Codex agents, one session per agent() callThe deterministic engine (sandboxed vm realm, parallel/pipeline, journal/resume, token budget, worktree isolation) is independent of how a single agent runs and of how the tool is exposed. See docs/design-notes.md for the full protocol-level design.
Related MCP server: neurolisp
Requirements
Node.js ≥ 22 and pnpm ≥ 10 (see
.nvmrc/packageManager).A backend agent CLI, authenticated on your machine:
Claude — via the bundled
@agentclientprotocol/claude-agent-acp; auth from~/.claude/.credentials.jsonorANTHROPIC_API_KEY(the orchestrator inherits your environment).Codex — via
@automatalabs/codex-acp(+ the@openai/codexbinary, installed as a dependency); auth from~/.codex/auth.json.
You only need auth for the backend(s) you actually call.
Install
From source (current)
git clone <this-repo> agentprism-workflows
cd agentprism-workflows
pnpm install # applies the codex-acp patch + fetches backend binaries
pnpm build # tsc -b across all packagesFrom npm (once published)
pnpm add @automatalabs/workflows # the SDK
# or, to run the MCP server:
pnpm add @automatalabs/mcp-serverPackages
Two packages are user-facing — start with one of these:
Package | What it is |
| The canonical public SDK — a thin facade that runs workflow scripts programmatically over the default ACP backend, and re-exports the engine + backend surface. Start here. |
| The stdio MCP server (bin: |
The other three are internal building blocks, composed by the SDK. You don't depend on them directly: @automatalabs/workflows is the public entry point for everything they export.
Package | What it is |
| The ACP client + |
| The deterministic engine: the script realm, |
| The |
Dependency direction: mcp-server → workflows → { workflow-engine, acp-agents, shared-types }. The SDK (workflows) is the single facade that composes the deterministic engine and the ACP backend, which meet only at the AgentRunner seam in shared-types. The engine never names a backend; the agents never know they're inside a workflow.
Quickstart — SDK
Run a workflow script. The default backend is the ACP runner (createAcpRunner()), so this drives real agents and needs backend auth.
import { runDynamicWorkflow } from "@automatalabs/workflows";
const script = `
export const meta = {
name: "repo-scan",
description: "describe a repo as JSON, three ways in parallel",
phases: [{ title: "Fan" }],
};
const SCHEMA = {
type: "object",
additionalProperties: false,
required: ["repo", "fileCount"],
properties: { repo: { type: "string" }, fileCount: { type: "number" } },
};
phase("Fan");
const results = await parallel([
() => agent("Report this repo as JSON {repo, fileCount}.", { label: "a1", schema: SCHEMA }),
() => agent("Report this repo as JSON {repo, fileCount}.", { label: "a2", schema: SCHEMA }),
]);
return results;
`;
const run = await runDynamicWorkflow(script, { args: {} });
console.log(run.status); // "completed" | "paused" | "failed" | "aborted"
console.log(run.result); // [{ repo: "...", fileCount: 123 }, …] — schema-validated objects
console.log(run.tokenUsage, run.runId);runDynamicWorkflow resolves to a terminal WorkflowRunResult even on pause/fail/abort — read run.status instead of catching. To swap the backend (or stub it in tests), pass your own runner: runDynamicWorkflow(script, { runner }). For lower-level control, use WorkflowManager / runWorkflow (also re-exported from the SDK).
Run a single agent directly
import { createAcpRunner } from "@automatalabs/workflows";
const runner = createAcpRunner();
const data = await runner.run("Summarize this repo as JSON {summary}.", {
schema: {
type: "object", additionalProperties: false,
required: ["summary"], properties: { summary: { type: "string" } },
},
model: "opus", // routes to Claude; e.g. "gpt-5-codex" routes to Codex
cwd: process.cwd(),
});
// data is typed/validated against the schema (a plain object, not text)
await runner.dispose(); // closes pooled backend processesQuickstart — MCP server
The workflow tool runs a script to completion synchronously, streaming notifications/progress, and returns the structured result.
Register the stdio server in your MCP host's config:
{
"mcpServers": {
"agentprism-workflow": {
"command": "agentprism-workflow",
"env": { "AGENTPRISM_DEFAULT_BACKEND": "claude" }
}
}
}From source (before publishing), point at the built entry instead:
{
"mcpServers": {
"agentprism-workflow": {
"command": "node",
"args": ["/abs/path/to/agentprism-workflows/packages/mcp-server/dist/index.js"]
}
}
}Tool: workflow — input parameters:
Param | Type | Notes |
| string (required) | Raw JS; first statement must be |
| any | Exposed to the script as the global |
| number | Default 1000. |
| number | Clamped to 16 (not rejected). |
| number | Clamped to 3. |
| number | null | Per-agent timeout; omit for none. |
| number | null | Hard total-token cap for the run; omit for none. |
| string | Resume a prior run from its persisted journal (resume is explicit). |
The run is synchronous (one tools/call = one full run). Resume after a pause/crash by calling workflow again with resumeFromRunId.
Writing workflow scripts
A script is plain JavaScript whose first statement is the meta literal. Inside it, these globals are available (injected into the run's realm — they are not importable functions; @automatalabs/workflows ships an ambient .d.ts so your editor knows them):
agent(prompt, opts?)— run one subagent. Withopts.schema(a JSON Schema) you get a validated object back; without it, the assistant's text. Other opts:label,phase,model/tier,agentType,isolation,timeoutMs,retries,mcpServers. (Working directory comes from worktreeisolation; tool policy and instructions come from theagentTypedefinition.cwd/toolNames/instructionsare options on the lower-levelcreateAcpRunner().run()API, not script-levelagent()opts.)parallel([fn, …])— run thunks concurrently; barrier (awaits all).pipeline(items, stage1, stage2, …)— stream each item through stages independently (no inter-stage barrier).phase(title),log(msg)— progress grouping + narration.budget— the run's token budget (budget.total,budget.remaining(),budget.spent()).checkpoint(),gate(),verify(),judgePanel(),loopUntilDry(),completenessCheck(),retry(),workflow(),args.
Determinism is enforced (Date.now/Math.random/new Date() are neutered in the realm) so a killed run resumes from its journal with a cache-hit on the unchanged prefix.
Structured output
Pass a JSON Schema as agent({ schema }) and the result is a validated object, not text. Each backend constrains generation natively (Claude via its output-format channel; Codex via a turn-level outputSchema), then the runner validates and re-prompts on mismatch. See docs/design-notes.md §6 for the per-backend mechanics.
Backends & selection
The backend is chosen per agent() call from the model/tier you pass, by provider prefix:
opus,sonnet,haiku,claude…,anthropic/…→ Claude (claude-agent-acp).gpt…,codex…,o3/o4,openai/…→ Codex (codex-acp).Otherwise the default backend (
AGENTPRISM_DEFAULT_BACKEND, defaultclaude).
One long-lived ACP process per backend is pooled and reused across agent() calls (one spawn + one initialize), with a fresh session per call — so worktree isolation is preserved via each session's cwd.
Configuration
Env var | Default | Meaning |
|
| Backend when the model/tier doesn't imply one ( |
|
| Long-lived processes held per backend. |
| (bundled) | Override the Claude ACP server command/args. |
| (bundled) | Override the Codex ACP server command/args/binary. |
Documentation
docs/design-notes.md— the deep protocol-level design: ACP lifecycle, the structured-output crux, model/permission/usage/cancellation mechanics, and the engine lineage.CONTRIBUTING.md— local development, testing (including the gated live-backend e2e), the Codex patch, and releasing.
License
Not yet set — a LICENSE file is a prerequisite before the first npm publish. See CONTRIBUTING.md.
This server cannot be installed
Maintenance
Latest Blog Posts
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/VikashLoomba/agentprism-workflows'
If you have feedback or need assistance with the MCP directory API, please join our Discord server