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 same PROMETHEUS_API_KEY that 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

TypeUse forExample
semanticDurable facts"The staging DB uses connection pooling via pgbouncer"
proceduralHow-to knowledge"Run integration tests with pnpm test:int from the repo root"
episodicSession events"Refactored the billing module; plan + outcome of the session"
workingShort-lived notes"Currently bisecting the flaky watcher test"

Tools

ToolWhat it does
memory_readRecall along the scope chain; returns records plus a prompt-ready, token-capped markdown block
memory_writeUpsert one record (identity: scope + type + key); mirrors project facts to markdown
memory_captureSession-end consolidation: plan/outcome → episodic, facts → semantic, procedures → procedural
memory_searchFull-text search (FTS5) over keys and values, ranked, with highlighted snippets
memory_listFlat admin listing with scope/type/key filters
memory_deleteDelete one record by identity; removes the mirrored markdown file too
memory_setupIdempotently 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

VariableRequiredDefaultPurpose
PROMETHEUS_API_KEYyesBeta key (prom_live_… / prom_test_…); validated at startup
PROMETHEUS_WORKSPACE_ROOTnocwdAnchors the project identity and the .prometheus/memories/ mirror
PROMETHEUS_MEMORY_DB_PATHno~/.prometheus/memory.dbOverride 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.