# Memory Bridge MCP server

> Provides an evidence-backed knowledge and memory layer for MCP clients with audit trails, versioning, and namespace isolation.

- Repository: https://github.com/yanglinfeng/memory-bridge
- Page: https://hostedmcp.org/servers/yanglinfeng/memory-bridge
- Transport: stdio
- Stars: 0
- License: Apache-2.0
- Latest version: 1.0.1

## Install

### Claude Code

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

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

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

### VS Code (`.vscode/mcp.json`)

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

### VS Code CLI

```sh
code --add-mcp '{"name":"memory-bridge","type":"stdio","command":"docker","args":["run","-i","--rm","ghcr.io/yanglinfeng/memory-bridge:1.0.1"],"env":{"MEMORY_BRIDGE_MCP_TOKEN":"<YOUR_MEMORY_BRIDGE_MCP_TOKEN>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

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

### Codex

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

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.memory-bridge]
command = "docker"
args = ["run", "-i", "--rm", "ghcr.io/yanglinfeng/memory-bridge:1.0.1"]

[mcp_servers.memory-bridge.env]
MEMORY_BRIDGE_MCP_TOKEN = "<YOUR_MEMORY_BRIDGE_MCP_TOKEN>"
```

### Gemini CLI

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

### Gemini settings.json (`~/.gemini/settings.json`)

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

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `MEMORY_BRIDGE_MCP_TOKEN` | no | yes | Account credential used to resolve the startup principal. Alternative to MEMORY_BRIDGE_USER_ID. |
| `MB_TOKEN` | no | no |  |
| `MEMORY_BRIDGE_OLLAMA_URL` | no | no | Base URL of the Ollama runtime used for generation and embeddings. Inside a container this is usually http://host.docker.internal:11434. |
| `MEMORY_BRIDGE_USER_ID` | no | no | Trusted local principal the stdio session acts as. The image defaults it to 'default'; the server refuses to start when both this and MEMORY_BRIDGE_MCP_TOKEN are absent. |

## FAQ

### What makes Memory Bridge different from other RAG stacks?

It answers critical questions regarding source attribution, document validity through versioning, and data isolation via namespaces.

### How does the system handle document updates?

It uses a document-level version chain where changes automatically trigger a supersede process, moving old versions out of default retrieval while keeping them available for auditing.
