continual-harness-mcp-server
v0.1.3
Published
Continual Harness as an MCP server: durable prompts, subagents, skills, and memory with full CRUD and evidence-backed refinement.
Maintainers
Readme
continual-harness-mcp-server
The Continual Harness as an MCP server. It stores durable prompts, subagents, skills,
and memories with full CRUD and an evidence-backed refinement pass, scoped local to
a session or global across every host you use.
Part of the harness monorepo. It has no model or sandbox dependency, so it
stays light and starts fast. State is written in prime-agent's harness_state.json
format, so a store written by either side is readable by the other.
Installation
npm install continual-harness-mcp-serverUsage
Run it over stdio, the transport a local host spawns:
npx continual-harness-mcp-serverState is one JSON file per scope, matching prime-agent's layout:
<dir>/harness_state.json schema, entries bucketed by kind, refinementslocal state resolves from CONTINUAL_HARNESS_DIR, then prime-agent's
RLM_HARNESS_STATE_DIR / RLM_SESSION_DIR, then .rlm-mcp/harness under the working
directory. global state resolves from CONTINUAL_HARNESS_GLOBAL_DIR, then
RLM_GLOBAL_HARNESS_STATE_DIR, then the prime-agent home.
The same binary is a CLI, so a person or a shell-driven model can use it directly.
The installed command is continual:
continual add-memory "Prefer focused patches" "Small updates validate faster."
continual add-skill "run tests" "invoke the suite" --import agent_skills.test --callable run
continual refine "learned to verify first" --edits '[{"action":"create","kind":"prompt","title":"always verify","content":"Verify every case."}]'
continual get --scope global # print the state as JSONAny subcommand runs the CLI; no subcommand starts the MCP server, so hosts are unaffected.
The package is also a library:
import { Harness, FileStore, loadConfig, systemClock } from 'continual-harness-mcp-server';
const harness = new Harness(new FileStore(loadConfig()), systemClock);
await harness.createMemory('Prefer focused patches', 'Small updates validate faster.');Tools
| Tool | Purpose |
| -------------------------- | ------------------------------------------------------- |
| harness_get_state | Read every entry and refinement for a scope |
| harness_create_memory | Store a durable memory (component M) |
| harness_create_prompt | Store a prompt note added to the system prompt (component p) |
| harness_create_skill | Store a skill with a Python call contract (component K) |
| harness_create_subagent | Store a subagent spec (component G) |
| harness_update | Update any entry by kind and id, bumping its version |
| harness_delete | Delete any entry by kind and id |
| harness_refine | Apply a multi-component diff and record what changed |
State is also exposed as a resource at harness://state/local and
harness://state/global.
Refinement
harness_refine takes a summary and a list of edits, and applies them across any mix
of the four kinds in one pass, mirroring the paper's Δ = (Δp, ΔG, ΔK, ΔM). Each edit
is a create, update, or delete; the pass records one refinement listing what changed,
with its trigger, evidence, and expected outcome.
{
"summary": "learned to verify before answering",
"evidence": "two failed validations",
"edits": [
{ "action": "create", "kind": "prompt", "title": "always verify", "content": "Verify against every case before answering." },
{ "action": "delete", "kind": "skill", "id": "stale_helper" }
]
}The host side reflex
MCP holds the state. Reading it before a turn and calling harness_refine after is
the host's job, which the protocol cannot do on its own. This package ships a hook,
hooks/inject-harness.mjs, that reads the store and injects every kind including
bodies. Wire it on SessionStart to seed each session, and on UserPromptSubmit so a
refinement written mid-session re-enters context on the next turn. The hook depends
only on the on-disk format, so it runs without building the package. See
NOTES.md.
Structure
src/
harness.ts create, update, delete, refine, snapshot, overview
types.ts HarnessEntry, RefinementEvent, RefinementProposal
store.ts HarnessStore port, FileStore (single JSON file per scope)
config.ts resolves the local and global directories
server.ts builds the MCP server and tools, transport agnostic
system.ts systemClock local.ts stdio entrypoint
index.ts public API
hooks/
inject-harness.mjs the read-before-a-turn hook