Governed MCP memory server
Run Heartwood as a local MCP memory server for Claude Code, Codex or any MCP client: policy-gated recall, signed sources, replace a memory by id.
Configure
Add Heartwood to your MCP client config. Override HEARTWOOD_DB_PATH to share the same store built by import-markdown or the warm recall service. From 0.2.10 the server takes its tenant and principal from this configuration (HEARTWOOD_TENANT, HEARTWOOD_MCP_PRINCIPAL_ID, and the roles, attributes and clearance settings), and a tool call that tries to send its own tenant or principal is rejected. If any server on the store uses remember, give every server that opens it — including read-only ones — the same custody root and the same key ID. Without the root, a writer cannot write again after a restart and a reader sees none of the memories written with it; with a different key ID, recall fails with an error. Decide before the first write: once any server with a root has opened the store, every server that opens it needs that root and key ID. See docs/security/multi-agent-identity.md in the source-available core.
{
"mcpServers": {
"heartwood-memory": {
"command": "python",
"args": ["-m", "heartwood.adapters.mcp_server"],
"env": {
"HEARTWOOD_DB_PATH": "/home/you/.local/share/heartwood/heartwood.db",
"HEARTWOOD_TENANT": "tenant:ops"
}
}
}
}Tools
• remember — governed write as the server's principal (classification, PII flag, source link, provenance signing, audit, encryption, indexing); pass supersedes with the ids of the memories it replaces, and default recall stops returning them (from 0.2.10; Heartwood does not detect replacements by itself) • recall — policy-enforced recall; denied memories are never returned, or counted in the results or the receipt • explain_recall — ranking and freshness explanation for a recall; denied memories are never listed or counted in it • forget — crypto-shred the subject key and purge derived memories • evaluate_egress — check source spans before external-model egress • assess_faithfulness — check generated-memory claims against source spans • memory — Anthropic memory-tool-compatible /memories surface • health — readiness, warmed tenants, model names, key-custody mode
On the private runtime, versioned recall, context and facts responses, and the recall, context and facts agent tools, return no timing values. The older /recall address still returns the engine time for each request, and operators read the full stage timings from the metrics endpoint.
When the Jev reranker is attached, the explanation of a recall returns rerank stage timings.
Keep the MCP server local.
The MCP server in this guide runs over local stdio and should stay on the same machine as its client. Authenticated remote recall is a separate HTTP service: the Heartwood recall gateway supports per-organization bearer credentials, configurable network binding, and TLS.
Adapted from docs/integrations/mcp-quickstart.md in the source-available core.