MCP integration
Agent Memory
Give your agent a durable memory that survives context-window resets — facts, decisions and procedures, local-first.
@prom.codes/memory-mcp is the second Prometheus MCP server. Where the
context engine answers "what does this codebase look like?", the memory
server answers "what did we already learn, decide, and agree on?" —
and keeps that knowledge across sessions, context-window resets, and
agent restarts.
How it works
- Local-first SQLite. All records live in one database on your
machine (
~/.prometheus/memory.db), partitioned per project. Nothing is uploaded; the samePROMETHEUS_API_KEYthat unlocks the context engine unlocks the memory server. - Scope chain. Records resolve along
project → workspace → tenant → system; the narrowest scope wins. Both MCP servers derive the project identity the same way (hash of the workspace root), so they always agree on what "this project" is. - Git-versioned project memories. Project-scoped durable facts are
mirrored to
.prometheus/memories/*.md— plain markdown, reviewable in pull requests, shared with the team via git. - Secrets rejected on every write. Values that look like API keys, tokens or connection strings are refused before they reach the database or a markdown file.
Memory types
| Type | Use for | Example |
|---|---|---|
semantic | Durable facts | "The staging DB uses connection pooling via pgbouncer" |
procedural | How-to knowledge | "Run integration tests with pnpm test:int from the repo root" |
episodic | Session events | "Refactored the billing module; plan + outcome of the session" |
working | Short-lived notes | "Currently bisecting the flaky watcher test" |
Tools
| Tool | What it does |
|---|---|
memory_read | Recall along the scope chain; returns records plus a prompt-ready, token-capped markdown block |
memory_write | Upsert one record (identity: scope + type + key); mirrors project facts to markdown |
memory_capture | Session-end consolidation: plan/outcome → episodic, facts → semantic, procedures → procedural |
memory_search | Full-text search (FTS5) over keys and values, ranked, with highlighted snippets |
memory_list | Flat admin listing with scope/type/key filters |
memory_delete | Delete one record by identity; removes the mirrored markdown file too |
memory_setup | Idempotently install the memory-protocol rules into CLAUDE.md, Cursor, Augment and AGENTS.md configs |
Setup
Add the server next to the context engine — same API key:
{
"mcpServers": {
"prometheus": {
"command": "npx",
"args": ["-y", "@prom.codes/context-mcp@latest"],
"env": {
"PROMETHEUS_API_KEY": "<your-api-key>",
"PROMETHEUS_WORKSPACE_ROOT": "/absolute/path/to/your/repo"
}
},
"prometheus-memory": {
"command": "npx",
"args": ["-y", "@prom.codes/memory-mcp@latest"],
"env": {
"PROMETHEUS_API_KEY": "<your-api-key>",
"PROMETHEUS_WORKSPACE_ROOT": "/absolute/path/to/your/repo"
}
}
}
}
Then ask your agent to run memory_setup once per workspace. It
detects which runtimes are present (Claude Code, Cursor, Augment,
generic AGENTS.md) and installs a small rule block that teaches the
agent when to read and write memory — recall at session start,
capture at session end. The install is idempotent: re-running updates
the block in place instead of duplicating it.
Environment variables
| Variable | Required | Default | Purpose |
|---|---|---|---|
PROMETHEUS_API_KEY | yes | — | Beta key (prom_live_… / prom_test_…); validated at startup |
PROMETHEUS_WORKSPACE_ROOT | no | cwd | Anchors the project identity and the .prometheus/memories/ mirror |
PROMETHEUS_MEMORY_DB_PATH | no | ~/.prometheus/memory.db | Override the shared memory database location |
What stays on your machine
Everything. The memory server makes no network calls in the local-first default — the API key is checked locally, records live in SQLite, and project memories live as markdown in your repo. The only thing that leaves your machine is what you choose to commit to git.