memharness — Claude Code MCP server: what it does, how to install
Long-term agent memory stored in a single SQLite file. Tracks fact provenance, updates history, and separates event time from ingestion time.
claude mcp add --env MEMHARNESS_DB=<MEMHARNESS_DB> --transport stdio memharness -- npx -y @memharness/mcpWhat memharness does
The server keeps facts in a local SQLite file at ~/.memharness/memory.db. Storage requires no language models, background daemons, or remote network calls. Corrections never wipe out previous data; they close the prior record and link it to the successor.
Every entry is bi-temporal. It records when something became true in reality alongside the moment the agent learned it. This makes it possible to inspect past states via as_of, view changes through diff, or inspect the evidence chain with why.
The server does not extract facts from unstructured dialog automatically. The agent or an automated session hook must invoke remember or recall explicitly. The database location changes via the MEMHARNESS_DB environment variable.
What it helps with
- inspect agent beliefs at a specific past point in time
- audit the provenance and revision chain behind a stored fact
- supersede outdated project details without deleting prior reasoning
- erase all memories tied to a specific session or source file
Example prompts for the agent
- Remember that our production environment is hosted on Fly.io
- What do you currently believe about our deployment setup and why?
- Show the changes in our project settings recorded since Monday
How to install memharness
Platform CLI
claude mcp add --env MEMHARNESS_DB=<MEMHARNESS_DB> --transport stdio memharness -- npx -y @memharness/mcpReplace <…> with your own values
Platform CLI
codex mcp add memharness --env MEMHARNESS_DB=<MEMHARNESS_DB> -- npx -y @memharness/mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"memharness": {
"command": "npx",
"args": [
"-y",
"@memharness/mcp"
],
"env": {
"MEMHARNESS_DB": "<MEMHARNESS_DB>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"memharness": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@memharness/mcp"
],
"env": {
"MEMHARNESS_DB": "<MEMHARNESS_DB>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e MEMHARNESS_DB=<MEMHARNESS_DB> memharness npx -y @memharness/mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about memharness
How to install memharness in Claude Code?
Run claude mcp add memharness -- npx -y @memharness/mcp in your terminal. The tool creates ~/.memharness/memory.db automatically on the first recorded fact.
What does memharness do?
It provides seven MCP tools for auditable memory backed by a single SQLite database. It tracks changes over time, preserves revision histories, and logs fact sources.
Does memharness need an API key or an LLM to store data?
No, the write and query logic runs locally on plain SQLite without remote endpoints. It stores facts directly without running extraction prompts.