# Memory Bridge (忆桥)

> Memory Bridge (忆桥) is an open-source MCP server for knowledge and memory. Local-first knowledge and memory layer with sentence-level citations and audit trail. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Self-hosted, Linux, macOS, CLI
- **Repository:** https://github.com/yanglinfeng/memory-bridge
- **MCP Registry name:** io.github.yanglinfeng/mcp-memory-bridge
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-11-23

## About

Memory Bridge is aimed at internal document question answering where it matters which file and which passage a statement came from. Answers bind each sentence to its source, every recall carries a replayable traceId, and the README says it will decline to answer when the corpus has no support. Arithmetic and date maths go to code tools instead of the model.

Documents have version chains, so a revised policy supersedes the old one in default retrieval while history stays auditable. Users, namespaces and scopes isolate departments, and all operations are audited. Search combines full-text, dense vectors, concept index and a cross-encoder reranker. By default models run through local Ollama, so data stays on the machine unless a remote endpoint is configured.

The MCP server exposes seven memory tools and three solver tools. It also ships an HTTP API, an OpenAI-compatible interface and an admin console. Apache-2.0 licensed; the author says ingestion and delivery services are offered commercially.

## Features

- **Cited answers:** Sentence-level source bindings and replayable trace IDs.
- **Version chains:** Revised documents supersede older ones in default search.
- **Namespace isolation:** Separate users, namespaces and scopes per department.
- **Hybrid retrieval:** Full-text, vectors, concepts and a reranker.
- **Local by default:** Uses local Ollama unless you point it elsewhere.
- **Audit and doctor:** Operation logs and a read-only health check for duplicates and conflicts.

## Good for

- Answer policy and contract questions with exact sources
- Keep an agent's long-term memory with a correction trail
- Isolate department knowledge bases
- Run a document Q&A stack on an internal network

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add mcp-memory-bridge --env MEMORY_BRIDGE_MCP_TOKEN='<MEMORY_BRIDGE_MCP_TOKEN>' -- docker run -i --rm -e MEMORY_BRIDGE_MCP_TOKEN ghcr.io/yanglinfeng/memory-bridge:1.0.1
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add mcp-memory-bridge --env MEMORY_BRIDGE_MCP_TOKEN='<MEMORY_BRIDGE_MCP_TOKEN>' -- docker run -i --rm -e MEMORY_BRIDGE_MCP_TOKEN ghcr.io/yanglinfeng/memory-bridge:1.0.1
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.mcp-memory-bridge]
command = "docker"
args = ["run", "-i", "--rm", "-e", "MEMORY_BRIDGE_MCP_TOKEN", "ghcr.io/yanglinfeng/memory-bridge:1.0.1"]
env = { MEMORY_BRIDGE_MCP_TOKEN = "<MEMORY_BRIDGE_MCP_TOKEN>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e MEMORY_BRIDGE_MCP_TOKEN='<MEMORY_BRIDGE_MCP_TOKEN>' mcp-memory-bridge docker -- run -i --rm -e MEMORY_BRIDGE_MCP_TOKEN ghcr.io/yanglinfeng/memory-bridge:1.0.1

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-memory-bridge": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MEMORY_BRIDGE_MCP_TOKEN",
        "ghcr.io/yanglinfeng/memory-bridge:1.0.1"
      ],
      "env": {
        "MEMORY_BRIDGE_MCP_TOKEN": "<MEMORY_BRIDGE_MCP_TOKEN>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 10 tools changes data; 7 names don't say. From the server's own tool labels and tool names; not verified by us.

- `memory_remember`: Store a memory.
- `memory_recall`: Recall memories with sources.
- `memory_get_context` (name suggests: reads): Get context for a query.
- `memory_update` (name suggests: changes): Correct a memory.
- `memory_forget`: Forget a memory.
- `memory_list` (name suggests: reads): List memories.
- `memory_stats`: Show memory statistics.
- `answer_calculator`: Deterministic arithmetic.
- `answer_date_diff`: Difference between dates.
- `answer_date_shift`: Shift a date by an interval.

## FAQ

### Does data leave my network?

By default models run on local Ollama; a remote endpoint sends prompts and context there.

### How do I run Memory Bridge (忆桥)?

With the published Docker image over stdio, or from source with Node 24+.

### What identity does the server need?

MEMORY_BRIDGE_USER_ID or MEMORY_BRIDGE_MCP_TOKEN; it refuses to start without one.

### Is Memory Bridge (忆桥) free?

Yes. Memory Bridge (忆桥) is open source, so you can use and self-host it for free.

### How do I add Memory Bridge (忆桥) to Claude Code?

Run this command in your terminal: claude mcp add mcp-memory-bridge --env MEMORY_BRIDGE_MCP_TOKEN='<MEMORY_BRIDGE_MCP_TOKEN>' -- docker run -i --rm -e MEMORY_BRIDGE_MCP_TOKEN ghcr.io/yanglinfeng/memory-bridge:1.0.1

### What are the best alternatives to Memory Bridge (忆桥)?

The closest alternatives to Memory Bridge (忆桥) are Codebase Memory, XERJ, Claude Code Ultimate Guide, Nautilus Compass Memory and Myco: Agent-First Cognitive Substrate.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.
- [Myco: Agent-First Cognitive Substrate](https://ai-powered.com/mcp/myco-agent-first-cognitive-substrate): Myco: Agent-First Cognitive Substrate is an open-source MCP server for knowledge and memory.
- [Source Library](https://ai-powered.com/mcp/source-library): Source Library is an open-source MCP server for knowledge and memory.
- [keepplain-plugin](https://ai-powered.com/mcp/keepplain-plugin): keepplain-plugin is a freemium MCP server for knowledge and memory.
- [Second Brain](https://ai-powered.com/mcp/second-brain-2): Second Brain is a freemium MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/memory-bridge
