# memharness

Long-term agent memory stored in a single SQLite file. Tracks fact provenance, updates history, and separates event time from ingestion time.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: las7
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/las7/memharness
- Updated: 2026-06-26
- HTML: https://affpapa.org/en/nevibecode/mcp/memharness

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MEMHARNESS_DB` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env MEMHARNESS_DB=<MEMHARNESS_DB> --transport stdio memharness -- npx -y @memharness/mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add memharness --env MEMHARNESS_DB=<MEMHARNESS_DB> -- npx -y @memharness/mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "memharness": {
            "command": "npx",
            "args": [
                "-y",
                "@memharness/mcp"
            ],
            "env": {
                "MEMHARNESS_DB": "<MEMHARNESS_DB>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "memharness": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@memharness/mcp"
            ],
            "env": {
                "MEMHARNESS_DB": "<MEMHARNESS_DB>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MEMHARNESS_DB=<MEMHARNESS_DB> memharness npx -y @memharness/mcp
```
Replace <…> with your own values

## When to use it
- 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
- 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

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
