AI Diary MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AI Diary MCP ServerRemember that I had a great run in the park this morning, 5k in 28 minutes."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
✨ Highlights
🔒 Truly private. Every memory lives in one SQLite file on your disk. Nothing is ever uploaded.
🧠 No embeddings, still smart. Retrieval uses SQLite FTS5 + BM25 with a trigram tokenizer, so search is instant and works great for English and 中文 / CJK.
🤝 Borrows your platform's brain. When the host supports MCP sampling,
recallexpands & re-ranks andreflectauto-summarizes — with graceful fallback when it doesn't. The server itself never ships a model.🕸️ A real knowledge graph. Link memories and traverse the web of context.
🗂️ Collections, tags, importance, reflection, dedup. Organize like Notion — locally and programmatically.
🎨 A beautiful local dashboard. Browse, search, and add memories in your browser (dark & light).
🧩 Works everywhere MCP does. Claude Desktop, Cursor, Windsurf, Cline, VS Code, Zed…
Related MCP server: genmem
🖥️ The dashboard
A polished local web UI over the same database — npm run dashboard, then open http://localhost:4178.
Browse · full-text search (English + 中文) · filter by tag/collection · spot near-duplicates · add memories · dark/light theme · one-click git snapshot.
🏆 Why it's better than Notion
AI Diary | Notion | |
Privacy | 100% local, single file you own | Cloud-hosted |
Built for AI | Native MCP tools an agent calls directly | Manual / limited API |
Chinese search | FTS5 trigram — precise CJK substring search | Weak |
Knowledge graph | First-class links + graph traversal | No |
Offline | Always | No |
Cost | Free, no subscription | Paid tiers |
Versioning | Optional git history of your memory | Limited |
🚀 Quick start
git clone https://github.com/pangxianggang/ai-diary-mcp.git
cd ai-diary-mcp
npm install
npm run build # produces dist/index.js — the stdio MCP server
npm run smoke # self-test (26 assertions)Try the dashboard with some sample data:
AI_DIARY_DB_PATH=./demo.db node scripts/seed-demo.mjs
AI_DIARY_DB_PATH=./demo.db npm run dashboard # http://localhost:4178Override the port with
AI_DIARY_PORT.
🎨 The design philosophy
The server is the hippocampus — fast storage, structure, and retrieval. Your platform's model is the cortex — it reasons, summarizes, and decides what to remember.
The server never calls an LLM and never goes online. That keeps it private, free, and trivially portable.
💾 Where memories are stored
A single SQLite file:
OS | Default path |
Windows |
|
macOS |
|
Linux |
|
Override with AI_DIARY_DB_PATH. Back up by copying the file. Keep it inside a git repo and call snapshot for versioned memory history.
🔌 Connect it to your AI
Use the absolute path to the built dist/index.js.
Claude Desktop
claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"ai-diary": {
"command": "node",
"args": ["/absolute/path/to/ai-diary-mcp/dist/index.js"]
}
}
}Cursor / Windsurf / Cline / Zed / VS Code
All use the same shape — command: "node" with args pointing at dist/index.js. Add an env block to relocate the database:
{
"mcpServers": {
"ai-diary": {
"command": "node",
"args": ["/absolute/path/to/ai-diary-mcp/dist/index.js"],
"env": { "AI_DIARY_DB_PATH": "/absolute/path/to/my-memory.db" }
}
}
}Restart the client after editing its config.
🧰 Tools
Tool | What it does |
| Save a memory ( |
| Search by text (FTS5 BM25, CJK-aware) with optional |
| List the most recently created memories. |
| Browse chronologically by when things occurred. |
| Fetch one memory by id, including its links. |
| Edit an existing memory. |
| Archive (default) or hard-delete a memory. |
| Connect two memories into a knowledge graph (e.g. |
| Traverse the knowledge graph around a memory (BFS to a depth) and return connected memories + links. |
| Surface near-duplicate memories via trigram similarity. |
| Group memories into Notion-like collections. |
| All tags with usage counts. |
| Totals, categories, time range, db location. |
| Export memories as Markdown. |
| Consolidate related memories. |
| Commit the SQLite file to git for versioned memory history. |
Resource memory://recent (recent entries as Markdown) · Prompt recall-about (recall + summarize a topic).
🧱 Capabilities by phase
MVP — SQLite + FTS5 (CJK trigram) + full CRUD over stdio, one-line client config.
Smart retrieval — optional MCP-sampling query expansion + re-ranking in
recall, automatic fallback to plain FTS5.Structure — tags, collections, links / knowledge graph traversal, importance, soft-forget.
Reflection —
reflect auto=trueconsolidates memories via the host model;find_duplicatesfor de-duplication.Experience — a polished local web dashboard + Markdown export + optional git-versioned history.
🔍 How search works (without embeddings)
FTS5 + BM25 ranks entries by relevance. The trigram tokenizer indexes 3-character sequences, which is what makes substring and CJK search work.
Metadata filters (tags, category, collection, time range, importance) narrow results.
Queries shorter than 3 characters fall back to a
LIKEsubstring scan.With
smart=true, a sampling-capable host expands the query and re-ranks candidates — but the core works fully without it.
🛠️ Development
npm run dev # tsc --watch
npm run typecheck # type-check only
npm run smoke # in-memory end-to-end check (26 assertions)
npm run dashboard # local web UI📄 License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
Persistent, portable memory for AI assistants — your private memory graph, from any MCP client.
- EngramOAuthapp.getengram
Persistent, verbatim, searchable memory for AI assistants — one memory across every MCP client.
Cloud-hosted MCP server for durable AI memory
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA local-first MCP server for personal memory management, enabling AI agents to store, search, and retrieve developer insights with offline semantic search and auto-categorization.6 npm3MIT
- AlicenseNot gradedqualityCmaintenanceA local-first MCP server that gives AI assistants long-term memory by storing, searching, and recalling notes as Markdown files on your machine.7 npmMIT
- AlicenseNot gradedqualityCmaintenanceA self-hostable MCP server that provides permanent memory for AI agents using Postgres + pgvector for semantic search and Markdown file sync.MIT
- AlicenseAqualityBmaintenanceA fully local MCP server that gives AI agents persistent, semantic long-term memory without any cloud dependencies.116 npm1MIT