mempalace

mempalace

Enables persistent local memory in VS Code Copilot Chat via MemPalace, using a ChromaDB 0.6.x backend with automatic setup and verification.

Category
访问服务器

README

MemPalace MCP Bridge for VS Code Copilot

Give MemPalace a persistent local memory inside VS Code Copilot Chat.

This repo provides a plug-and-play bridge:

  • one-command setup
  • generated workspace MCP config
  • automatic MCP server startup through VS Code
  • full-stack verification with verify.sh
  • a stable ChromaDB 0.6.x line for existing palaces

What you get

  • Persistent memory inside Copilot Chat
  • Fully local — no cloud, no API key, no Docker
  • Auto-start — no terminal, VS Code handles everything
  • Mine your own files — query your notes, docs, and decisions
  • Built-in verification — verify.sh classifies the bridge as healthy, suspicious, or unsafe by checking the environment, the generated MCP config, real MCP startup, and palace manifest drift
  • Palace safety checks — setup, update, verify, and runtime startup reject unsupported chromadb versions and keep the bridge on the supported 0.6.x line
  • Palace format safety gate — risky stable-path operations refuse palaces detected as chroma_1_x or unknown
  • Palace manifest — setup writes mempalace-bridge-manifest.json into the palace root for version traceability
  • Devcontainer integration — host palace mount shared across environments
  • Safe ChromaDB 0.6.x1.x reconstruction tooling — non-destructive and runtime-validated
  • Reusable across environments with a shared palace

Compatibility status This bridge targets ChromaDB 0.6.x only (chromadb>=0.6,<0.7). ChromaDB 1.x uses an incompatible storage format; non-0.6.x installs are rejected at startup. Palaces detected as chroma_1_x or unknown format are also rejected before any operation. main fails fast when the installed chromadb version is outside the 0.6.x range.

This repository handles the runtime and setup layer for VS Code Copilot Chat MCP integration. For structured memory methodology, see Memory Engineering.


Who this is for

This repo is for you if:

  • you want MemPalace working fast inside VS Code Copilot Chat
  • you want a local setup with no manual MCP wiring
  • you want a stable setup for existing palaces on Chroma 0.6.x
  • you prefer reproducibility over chasing the newest Chroma release

Quickstart

# 1. Clone
git clone https://github.com/apajon/mempalace-mcp-bridge.git
cd mempalace-mcp-bridge

# 2. Setup (installs uv, mempalace, creates .venv, configures .mcp.json)
bash setup.sh

# 3. Open this folder in VS Code

code .

# 4. Verify
bash verify.sh

Important: open the repository root folder in VS Code (code . from inside mempalace-mcp-bridge/). Opening a subfolder will prevent MCP from loading.

Then reload VS Code (Ctrl+Shift+PDeveloper: Reload Window) if needed.


MCP Configuration

The setup script generates .mcp.json automatically. To configure manually, create .mcp.json in your workspace:

{
  "servers": {
    "mempalace": {
      "type": "stdio",
      "command": "/ABSOLUTE/PATH/TO/uv",
      "args": ["run", "--directory", "/ABSOLUTE/PATH/TO/mempalace-mcp-bridge", "python", "scripts/run_mcp_server.py"]
    }
  }
}

Replace paths with the output of which uv and the absolute path to this repo. A ready-to-copy example is at examples/mcp/vscode.mcp.json.

See docs/mcp_vscode.md for full details and troubleshooting.


Update

git pull
bash update.sh

update.sh upgrades MemPalace, enforces the pinned ChromaDB line, checks .mcp.json paths, and runs verify.sh. It never touches ~/.mempalace/palace.

See docs/update_workflow.md for edge cases and what the script does step by step.


Verify

bash verify.sh

Checks that the virtual environment, MemPalace, and MCP server are all healthy. Reports actionable errors if anything is broken.


Test it in Copilot

Open Copilot Chat and try:

"Remember that I like Python."

Restart VS Code, then ask:

"What do you remember about me?"

VS Code auto-starts the MemPalace MCP server when Copilot Chat opens.


Use your own data

To mine your own notes after setup:

uv run --directory . mempalace mine /path/to/your/project

Then ask Copilot about anything in those files.


Known limitations

  • This bridge currently targets ChromaDB 0.6.x, not ChromaDB 1.x
  • main hard-fails outside the supported chromadb>=0.6,<0.7 range
  • No migration to ChromaDB 1.x is provided. Non-0.6.x palaces are blocked at startup.
  • Experimental ChromaDB 1.x investigation work exists outside this project's stable contract and is not part of the supported bridge workflow.
  • Linux / WSL2 is the tested path today
  • Copilot behavior remains probabilistic even with MemPalace as the preferred context source

Devcontainer integration

For teams using VS Code devcontainers, the palace is mounted from the host so it persists across container rebuilds.

See docs/devcontainer_integration.md for the mount design and .devcontainer config.


Troubleshooting

See docs/troubleshooting.md.


Why this exists

MemPalace is powerful, but not plug-and-play in real workflows.

Setting it up requires multiple manual steps and breaks the flow of using Copilot Chat.

That friction stops most users before they get any value.

This repo removes that friction.


How it fits together

VsCode Copilot Chat
  |
  v
MCP Server  <- launched automatically by Copilot via .mcp.json
  |
  v
MemPalace
  |
  v
Local Memory (palace)  <- ~/.mempalace/palace

setup.sh generates .mcp.json with the absolute path to your uv binary, so Copilot can start the server without any manual configuration.

If you already have a legacy .vscode/mcp.json, migrate it with:

jq '{servers: .servers}' .vscode/mcp.json > .mcp.json

The same setup step writes mempalace-bridge-manifest.json into the palace root. The file is intentionally small and easy to inspect manually: it records the bridge version, MemPalace version, ChromaDB version, Python version, storage backend and format, the supported compatibility line, and the creation timestamp. If a valid manifest already exists, setup preserves it. If the file exists but is malformed, setup replaces it with a fresh valid manifest.


Memory Engineering

Advanced structured memory patterns — wings, rooms, retrieval order, persistence rules, deduplication — now live in a dedicated repository:

mempalace-memory-engineering

This includes:

  • structured memory strategy for engineering workflows
  • worked examples (two-wing / three-room setup)
  • semantic deduplication reference

This repository focuses solely on MCP bridge setup and runtime integration. The methodology is not duplicated here.


Documentation

Setup & runtime

Architecture & internals

ChromaDB reconstruction (0.6.x → 1.x)

Compatibility

  • Linux (tested on Ubuntu 24.04 via WSL2)
  • VS Code with GitHub Copilot Chat
  • curl required (setup.sh uses it to install uv)
  • ChromaDB 0.6.x line pinned intentionally via chromadb>=0.6,<0.7

Copilot context guidance

  • Copilot is configured to use MemPalace as its primary context source via .github/copilot-instructions.md
  • Query order: MemPalace project wing -> shared wings -> docs/architecture.md -> README.md -> workspace search
  • This improves first-response relevance. It is not a strict guarantee - Copilot behavior is probabilistic

Memory Engineering (external)


Related


推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选