Skip to main content

Universal Dev Memory — A persistent MCP server for cross-tool coding context

Project description

DevMemory

Universal Dev Memory — A persistent MCP server that stores, structures, and serves coding context so any AI tool can continue seamlessly.

PyPI Python 3.10+ License: MIT CI


The Problem

Every time you switch AI coding tools — Cursor → Claude → Windsurf — your context dies. You start from scratch, re-explain the goals, paste the same snippets, and lose momentum.

The Solution

DevMemory is an MCP server that acts as persistent memory across coding tools:

Cursor saves context  → DevMemory DB → Claude auto-loads context
Claude makes decisions → DevMemory DB → Windsurf continues
Augment credits run low → DevMemory DB → Switch to Antigravity instantly

Same project, same memory, zero friction.


30-Second Quick Start

# Install globally so the `devmemory` command is on your PATH.
# The PyPI package is `devmemory-ai`; it installs the `devmemory` command.
pip install devmemory-ai       # or: uv tool install devmemory-ai  /  pipx install devmemory-ai

devmemory          # starts MCP server (stdio, for AI tools)
devmemory --rest   # starts REST API (HTTP, for dashboards)

Prefer Node? No Python required. Connect any tool via npm:

npx -y @commanderzero/devmemory install --tool cursor --api-key dm_key_YOUR_KEY --host https://your-backend

Same tools, same backend — it just runs the MCP client on Node instead.

Install it for real — don't rely on uvx in MCP configs. AI tools launch the MCP server with their own environment, not your shell's PATH. A bare devmemory (or uvx) only resolves if it happens to be on that PATH, which causes intermittent "failed to connect" errors. The devmemory install command below avoids this by writing the absolute path to the binary into the config.

Connect from Claude Code (recommended)

Let DevMemory write the config for you — this resolves the absolute path automatically:

devmemory install --tool claude-code --api-key dm_key_YOUR_KEY

Then restart Claude Code (or run /mcp → reconnect in an active session). Verify with:

claude mcp list   # devmemory should show ✔ Connected

Connect from Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "devmemory": {
      "command": "uvx",
      "args": ["--from", "devmemory-ai", "devmemory"],
      "env": {
        "DEVMEMORY_API_KEY": "dm_key_your_key_here"
      }
    }
  }
}

Connect from Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "devmemory": {
      "command": "devmemory",
      "env": {
        "DEVMEMORY_API_KEY": "dm_key_YOUR_KEY_HERE"
      }
    }
  }
}

Configuring manually? Use the absolute path to the binary, not a bare devmemory — the tool's launch environment usually has a different PATH than your shell. Find it with which devmemory (macOS/Linux) or where devmemory (Windows):

{
  "command": "/full/path/to/devmemory",
  "env": { "DEVMEMORY_API_KEY": "dm_key_YOUR_KEY_HERE" }
}

On Windows you can alternatively wrap with cmd: "command": "cmd", "args": ["/c", "devmemory"].


Features

  • 🧩 Structured Context — Save typed blocks: goals, decisions, code, errors, next steps, insights, dependencies, blockers
  • 🔄 Resume Prompts — Generate an optimised "continue here" prompt tuned for each tool
  • 🔍 Auto Project Detection — Resolves projects from git remote URLs (zero config)
  • 🔐 Multi-user Auth — JWT + API keys, tiered subscriptions (Free / Pro / Team)
  • 📊 Quota Enforcement — Tier limits enforced at write time; usage visible via REST API
  • 🏠 Self-Hostable — Run locally with SQLite; switch to PostgreSQL for production
  • 🌐 Cross-Platform — Works on Windows, macOS, and Linux
  • 📊 Web Dashboard — Monitor sessions, projects, and context at http://localhost:8765
  • Auto-Sync — SessionStart hooks and inject commands for zero-friction tool switching
  • 🤖 Deterministic Auto-Save — saves your work with no reliance on the model calling a tool (see below)

Auto-Save — how context actually gets saved

The whole point of DevMemory is that when your credits run out mid-work, the next tool can continue. That only works if your context was saved before the credits died — so saving must not depend on the AI remembering to do it.

DevMemory saves three ways:

  1. Tools with a transcript hook (Claude Code, Windsurf) — direct hooks. These tools fire an OS-level hook after each turn and hand it a plaintext conversation transcript. install wires a small script into that hook which POSTs the turn — no save_context call, no reading the tool's (often encrypted) conversation store. Claude Code uses Stop; Windsurf uses post_cascade_response_with_transcript.

  2. Tools without a transcript hook (Cursor, Cline, Kilo, Codex) — the watch daemon. These don't expose a transcript to a hook, but they do persist conversations locally. devmemory watch is a background daemon that tails those stores and pushes new turns — again, zero model cooperation. install sets it up as a systemd/launchd service automatically.

  3. Tools with no verified hook (Antigravity) — MCP tools + rules. The Antigravity IDE exposes no per-turn transcript hook an installer can reliably wire (its documented hooks are SDK decorators for SDK-built agents, not the IDE). So install writes an always-on global rules file (~/.gemini/GEMINI.md) that drives save/restore through the DevMemory MCP tools. Agent-driven, not deterministic — but honest.

Check what's supported and detected on your machine:

devmemory watch --list

Tool support matrix

Tool Auto-save mechanism Status
Claude Code Stop hook (transcript) ✅ deterministic
Windsurf post_cascade_response_with_transcript hook (transcript JSONL) + global_rules.md restore ✅ deterministic
Antigravity MCP tools + ~/.gemini/GEMINI.md global rules ✅ agent-driven (MCP)
Cursor watch daemon (SQLite store) ✅ verified
Cline / Kilo watch daemon (JSON task history) ✅ supported
Codex watch daemon (state_*.sqlite + rollout JSONL) ✅ supported
any JSONL tool watch generic adapter (~/.devmemory/watch_adapters.json) ✅ config-driven

Windsurf & Antigravity encrypt conversations on disk. DevMemory does not try to crack that. Windsurf hands its own hook a plaintext transcript, so we capture each turn deterministically. Antigravity exposes no such hook to an installer, so it saves/restores through the MCP tools + a global rules file. Honest coverage: devmemory watch --list shows the exact mechanism per tool.

Adding an unlisted tool (generic adapter)

If your tool logs conversations as JSONL, add it without code — ~/.devmemory/watch_adapters.json:

{
  "adapters": [
    {
      "name": "my-tool",
      "glob": "~/.mytool/sessions/**/*.jsonl",
      "role_field": "role",
      "text_field": "content",
      "user_values": ["user"],
      "assistant_values": ["assistant", "model"]
    }
  ]
}

role_field/text_field accept dotted paths (e.g. payload.role).


MCP Tools

Once connected, your AI tool will have access to these seven tools:

Tool What it does
save_context Save a typed context block (goal, decision, code, error, next_step, insight, dependency, blocker)
get_context Retrieve context blocks for the current session/project
start_session Begin a new dev session (auto-detects project from git)
end_session Mark a session completed, paused, or archived
list_sessions List recent sessions for the current project
generate_resume_prompt Build an optimised "continue here" prompt for switching tools
list_projects List all known projects for this account

Example: Switching from Cursor to Claude

# In Cursor — save your work
save_context(block_type="goal", content="Implement OAuth2 login flow", cwd="/my/project")
save_context(block_type="decision", content="Using PKCE flow with refresh tokens", cwd="/my/project")
save_context(block_type="next_step", content="Add /auth/callback endpoint", cwd="/my/project")

# Switch to Claude Code — generate a resume prompt
generate_resume_prompt(session_id="...", target_tool="claude")
# → Structured prompt with goals, decisions, and next steps
# → Claude picks up exactly where Cursor left off

CLI Commands

Command Description
devmemory Start MCP server (stdio, for AI tools)
devmemory --rest Start REST API + Web Dashboard
devmemory install --tool <name> --api-key <key> One-time setup for an AI tool
devmemory install --all --api-key <key> Setup for all detected tools
devmemory inject [--cwd PATH] Auto-load context into CLAUDE.md, .augment/rules/
devmemory watch Background daemon: auto-save Cursor/Cline/Kilo/Codex conversations
devmemory watch --list Show per-tool auto-save support + which stores are present
devmemory watch --install-service Install watch as a systemd/launchd background service

REST API

When running with devmemory --rest, a full REST API is available:

Auth

Method Endpoint Description
POST /auth/register Register a new user account
POST /auth/login Get a JWT access token
GET /auth/api-keys List API keys
POST /auth/api-keys Create an API key
DELETE /auth/api-keys/{id} Revoke an API key

Projects & Sessions

Method Endpoint Description
GET /projects List all projects
GET /sessions List sessions (filter by project_id, status)
GET /sessions/{id} Get a single session
PATCH /sessions/{id} Update title or status
GET /sessions/{id}/blocks List context blocks
DELETE /context-blocks/{id} Delete a context block

Context

Method Endpoint Description
GET /context/resume Get resume prompt for a project (API key auth)

Billing

Method Endpoint Description
GET /billing/status Tier, limits, and current usage

Interactive docs: /docs (Swagger) and /redoc (ReDoc).


Tier Limits

Free Pro Team
Projects 3 25 Unlimited
Sessions / project 10 100 Unlimited
Blocks / session 500 5 000 Unlimited

Development

# Clone and install dev dependencies
git clone https://github.com/Yuguda999/devmemory.git
cd devmemory
uv sync --extra dev

# Run the test suite
uv run pytest tests/ -v

# Run the REST server locally
uv run devmemory --rest

# Run the MCP server locally (stdio)
uv run devmemory

Always run your local code with uv run (or an editable install — see below). uvx --from devmemory-ai devmemory and pip install devmemory-ai download the published PyPI release, which may be older than your checkout.

Using a plain venv instead of uv

If you prefer python -m venv:

python -m venv venv
source venv/bin/activate        # do this in every new terminal
pip install -e .                # editable: links the command to your source

After pip install -e ., the devmemory command runs your local code and picks up edits without reinstalling.

Troubleshooting

  • devmemory: command not found — the command isn't on your PATH. Either you used uvx (which never installs a persistent command) or your venv isn't active. Run source venv/bin/activate, then pip install -e ..
  • No such option: --rest — you're running an old published build, not your source. Reinstall from your checkout: pip install -e . (or use uv run devmemory --rest). Verify with pip show devmemory — it should list an Editable project location pointing at this repo.

Environment variables

Copy .env.example to .env and edit:

DEVMEMORY_DATABASE_URL=sqlite+aiosqlite:///./devmemory.db
DEVMEMORY_SECRET_KEY=your-secret-key-here
DEVMEMORY_HOST=0.0.0.0
DEVMEMORY_PORT=8765
DEVMEMORY_SELF_HOSTED=true   # disables tier limits

Architecture

AI Tool (Cursor / Claude / Windsurf / Augment / Antigravity / Cline / Kilo)
        │  MCP stdio (JSON-RPC)
        ▼
┌────────────────────────┐
│   DevMemory MCP Server │  ← 7 tools
│   devmemory.tools      │
└───────────┬────────────┘
            │
┌───────────▼────────────┐
│   Auth + Quota Layer   │  ← JWT / API keys / tier enforcement
│   Billing module       │
└───────────┬────────────┘
            │
┌───────────▼────────────┐
│   DB Repository        │  ← SQLAlchemy async, SQLite / PostgreSQL
│   Alembic migrations   │
└────────────────────────┘

Optional: REST API (FastAPI) + Web Dashboard
        ← /auth, /projects, /sessions, /billing, /context/resume
        ← http://localhost:8765 for dashboard

CLI: devmemory install / inject
        ← One-command tool setup
        ← Auto-sync context to CLAUDE.md, .augment/rules/

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devmemory_ai-0.1.1.tar.gz (144.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devmemory_ai-0.1.1-py3-none-any.whl (180.7 kB view details)

Uploaded Python 3

File details

Details for the file devmemory_ai-0.1.1.tar.gz.

File metadata

  • Download URL: devmemory_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 144.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for devmemory_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 db52115a1a17c11ef54d3ee4e0833c33bc6cd0625f886f9bf5ede03fc472a5eb
MD5 09e66cb6f19164ee6d280e2c60ef9d03
BLAKE2b-256 f80a9725448b2214f6acc70e486f33f51efad2f2022d44c02eea54496065bd19

See more details on using hashes here.

Provenance

The following attestation bundles were made for devmemory_ai-0.1.1.tar.gz:

Publisher: publish.yml on Yuguda999/devmemory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file devmemory_ai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: devmemory_ai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 180.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for devmemory_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cedce310412fa1501bdfc314c8bca0b1745e08a2070ba74be6f5c5c3492ef051
MD5 637985fb13a85fcdd2dc1ab8b425336e
BLAKE2b-256 b9ce4e3837ed4180825efb12b0ecccadcceb81fa89497c884947a487e0896b53

See more details on using hashes here.

Provenance

The following attestation bundles were made for devmemory_ai-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Yuguda999/devmemory

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page