Step 10 · Top layer · Top layer · Harness: HTTP, SSE, and MCP ENPT
Alembic Complete Visual Course

Harness: HTTP, SSE, and MCP

The transport-neutral orchestration layer that exposes Alembic over REST, SSE, and MCP.

Read the plain version, or open the technical layer on any section.
1

One core, many transports


@alembic/harness contains HarnessCore, a transport-neutral orchestrator, plus handlers for CLI, HTTP+SSE, and MCP. The same core drives the funnel (alembic distill), single-phase runs, and the POST /runs endpoint.

The HTTP server supports creating runs, polling status, and streaming events. The MCP surface is read-only: an untrusted client can inspect but not trigger autonomous execution.

Think of it like… a theatre stage manager: the script and actors stay the same whether the audience watches from the balcony (HTTP), the lobby monitor (SSE), or a backstage headset (MCP).

Under the hood

runFunnel orchestrates T0–T3 distillation over a corpus. distillAndMarket composes the funnel with the marketing factory. createHarnessServer binds handlers to a Node http server and maintains a run registry. Events are validated with Zod and streamed as SSE frames.

2

In one picture


HarnessCore CLI HTTP + SSE MCP (read-only)
The same HarnessCore drives CLI, HTTP/SSE, and read-only MCP surfaces.
3

In the code


# start the HTTP+SSE harness server
alembic serve --data-dir ~/.alembic

# start the read-only web cockpit
alembic cockpit --data-dir ~/.alembic

Implementation notes

alembic serve starts createHarnessServer and blocks until SIGINT. alembic cockpit starts createCockpitServer from @alembic/web. Both bind to ephemeral ports by default and print the URL. The harness server's POST /runs accepts a phase, goal path, and plan path, then kicks off a Forge-scope run in the background.

4

Try it


Start alembic cockpit, open the URL, and list runs. Then start alembic serve and curl /api/runs.

Security: Why is the MCP surface read-only?
5

Quick check


Which command starts the HTTP+SSE execution server?