# Midas

A local memory layer that keeps track of past coding sessions without sending turns to an LLM. It prevents agents from performing destructive actions based on outdated context.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 15
- Author: vornicx
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/vornicx/Midas
- Updated: 2026-07-28
- HTML: https://affpapa.org/en/nevibecode/mcp/midas

## What it does

Midas stores developer decisions and project constraints in a local SQLite database. When recording incoming messages, it skips LLM summarization passes entirely. Data stays on your machine with zero token costs per turn. Lookups return the raw conversational turn instead of an AI-generated rewrite.

The server handles belief changes by overriding stale facts with new ones instead of stacking redundant entries. It exposes tools like `memory_state` for active project constraints and `memory_diff` to inspect what shifted across sessions. An internal provenance guard rejects unconfirmed destructive operations. Because retrieval relies on top-k search rather than conversational aggregation, it cannot synthesize entire multi-session dialog histories. Running the Python package requires Python 3.11 or newer.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `MIDAS_MCP_DB`, `MIDAS_MCP_EMBEDDER`, `MIDAS_MCP_MAX_RECORDS`, `MIDAS_MCP_MIN_IMPORTANCE` — 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 MIDAS_MCP_DB=<MIDAS_MCP_DB> --env MIDAS_MCP_EMBEDDER=<MIDAS_MCP_EMBEDDER> --env MIDAS_MCP_MAX_RECORDS=<MIDAS_MCP_MAX_RECORDS> --env MIDAS_MCP_MIN_IMPORTANCE=<MIDAS_MCP_MIN_IMPORTANCE> --transport stdio midas -- uvx midas-memory-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from midas-memory-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add midas --env MIDAS_MCP_DB=<MIDAS_MCP_DB> --env MIDAS_MCP_EMBEDDER=<MIDAS_MCP_EMBEDDER> --env MIDAS_MCP_MAX_RECORDS=<MIDAS_MCP_MAX_RECORDS> --env MIDAS_MCP_MIN_IMPORTANCE=<MIDAS_MCP_MIN_IMPORTANCE> -- uvx midas-memory-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from midas-memory-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "midas": {
            "command": "uvx",
            "args": [
                "midas-memory-mcp"
            ],
            "env": {
                "MIDAS_MCP_DB": "<MIDAS_MCP_DB>",
                "MIDAS_MCP_EMBEDDER": "<MIDAS_MCP_EMBEDDER>",
                "MIDAS_MCP_MAX_RECORDS": "<MIDAS_MCP_MAX_RECORDS>",
                "MIDAS_MCP_MIN_IMPORTANCE": "<MIDAS_MCP_MIN_IMPORTANCE>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from midas-memory-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "midas": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "midas-memory-mcp"
            ],
            "env": {
                "MIDAS_MCP_DB": "<MIDAS_MCP_DB>",
                "MIDAS_MCP_EMBEDDER": "<MIDAS_MCP_EMBEDDER>",
                "MIDAS_MCP_MAX_RECORDS": "<MIDAS_MCP_MAX_RECORDS>",
                "MIDAS_MCP_MIN_IMPORTANCE": "<MIDAS_MCP_MIN_IMPORTANCE>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from midas-memory-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MIDAS_MCP_DB=<MIDAS_MCP_DB> -e MIDAS_MCP_EMBEDDER=<MIDAS_MCP_EMBEDDER> -e MIDAS_MCP_MAX_RECORDS=<MIDAS_MCP_MAX_RECORDS> -e MIDAS_MCP_MIN_IMPORTANCE=<MIDAS_MCP_MIN_IMPORTANCE> midas uvx midas-memory-mcp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from midas-memory-mcp <command>

## When to use it
- persist agent decisions across separate coding sessions
- block dangerous tool executions that rely on obsolete premises
- inspect recent belief updates using `memory_diff`
- share a unified SQLite memory file between Claude Code and Cursor

## Example prompts
- Check `memory_diff` to see what project constraints changed since our last session.
- Inspect `memory_state` to review active architecture guidelines before writing code.
- Verify in local memory whether running the database migration was explicitly confirmed.

## Similar
- [genome](https://affpapa.org/en/nevibecode/mcp/genome.md) — MCP server · ★ 10
- [Horosa Skill](https://affpapa.org/en/nevibecode/mcp/horosa-skill.md) — MCP server · ★ 480
- [devdocs-mcp](https://affpapa.org/en/nevibecode/mcp/devdocs-mcp.md) — MCP server · ★ 13
- [Mneme Memory](https://affpapa.org/en/nevibecode/mcp/mneme-memory.md) — MCP server · ★ 182
- [Sugar](https://affpapa.org/en/nevibecode/mcp/sugar.md) — MCP server · ★ 98
- [Pensyve](https://affpapa.org/en/nevibecode/mcp/pensyve.md) — MCP server · ★ 97

---
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
