chat-memory-mcp
CLI Rust ưu tiên lưu trữ cục bộ & MCP Server hợp nhất lịch sử của Cursor, Antigravity, Codex và ChatGPT thành một lớp bộ nhớ SQLite FTS5 (CN/EN) nhanh chóng.
Tài liệu
chat-memory-mcp
A local-first Rust CLI & MCP Server that unifies your Cursor, Antigravity, Codex, and ChatGPT history into one fast SQLite FTS5 (Chinese + English) memory layer.
Your best architectural decisions, bug fixes, and research notes are scattered across four different AI tools. chat-memory-mcp indexes them locally into a single zero-cloud SQLite FTS5 database with built-in Jieba Chinese + English tokenization, exposing a standard Model Context Protocol (MCP) stdio server so any AI assistant can recall what you already solved weeks ago.
Why chat-memory-mcp?
- 4 Sources Out of the Box: Auto-discovers Cursor (
state.vscdb), Antigravity (~/.gemini/antigravity/brain), Codex (~/.codex/sessions), plus ChatGPT official export ZIP (conversations.json). - First-Class Chinese + English Search: Standard SQLite FTS5 splits Chinese phrases poorly;
chat-memory-mcpembedsjieba-rs+ CJK bigram indexing with BM25 ranking (titleweighted 3x overbody). - 100% Local & Read-Only Safe: Copies Cursor's SQLite DB to a temp file before reading so it never locks your active IDE. Zero telemetry, zero external API calls.
- Single Static Binary: Pure Rust with bundled SQLite (
rusqlitebundled)—no Python runtime or vector DB daemon required.
Architecture
flowchart LR
C["Cursor state.vscdb"] --> Importers
A["Antigravity transcripts"] --> Importers
X["Codex JSONL sessions"] --> Importers
G["ChatGPT export ZIP"] --> Importers
Importers --> Tok["jieba-rs + CJK Bigram Tokenizer"]
Tok --> DB[("~/.chat-memory-mcp/memory.db (SQLite FTS5)")]
DB --> CLI["CLI: sync / search / stats"]
DB --> MCP["MCP stdio Server (JSON-RPC 2.0)"]
MCP --> Clients["Cursor / Claude Desktop / Antigravity"]
Quickstart
1. Install & Sync Local AI Chats
Homebrew (macOS Apple Silicon & Linux x86_64):
brew tap leotyndale/tap
brew install chat-memory-mcp
Or build from source:
git clone https://github.com/leotyndale/chat-memory-mcp.git && cd chat-memory-mcp
cargo build --release
# Auto-discover Cursor, Antigravity, and Codex on this machine
./target/release/chat-memory-mcp sync
# Optionally import your ChatGPT export ZIP too
./target/release/chat-memory-mcp sync --chatgpt-zip ~/Downloads/chatgpt-export.zip
# Search instantly from terminal
./target/release/chat-memory-mcp search "visual regression"
./target/release/chat-memory-mcp stats
2. Connect as an MCP Server (Cursor / Claude Desktop / Antigravity)
Add the following block to your mcp.json / claude_desktop_config.json:
{
"mcpServers": {
"chat-memory": {
"command": "/path/to/chat-memory-mcp",
"args": ["serve"]
}
}
}
Exposed MCP Tools
| Tool | Description |
|---|---|
search_chat_memory | BM25 full-text search across all indexed sources with optional source filter |
get_conversation | Retrieve full conversation turns by ID |
list_recent_chats | Browse latest active conversations across tools |
memory_stats | Return conversation and message counts grouped by source |
Open-Core Roadmap
chat-memory-mcp is the open-source MIT core (parsers, FTS5 indexer, CLI, and MCP server). A companion Local-First Desktop App (Tauri 2 + React GUI, local Ollama auto-classification, conversation branching, and user-owned encrypted cloud snapshot sync) is in active development. Star or watch this repo to follow updates!
Ecosystem
Part of leotyndale’s open-source engineering toolkit:
mobile-agent-skills— Production mobile engineering skills for AI coding agentsparity-patrol— Low-cost AI H5 vs Native cross-platform visual parity patrol enginepptx-morph— Keynote & QCon-grade native Morph animation engine forpython-pptx
License
MIT © leotyndale