memory-mcp
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., "@memory-mcpSave this note: Meeting with Acme Corp on Friday at 2pm"
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.
memory-mcp
"Why does my Claude Code feel smarter than everyone else's?"
Long-term memory MCP server for Claude Code. Your AI remembers context across sessions.
日本語 | English
Features
SQLite Persistence — Notes and conversations survive across sessions
Japanese Full-Text Search — FTS5 with trigram tokenizer for CJK support
Semantic Search — Vector search via OpenAI-compatible embedding APIs. Zero-config with local Ollama (
nomic-embed-text); falls back gracefully to FTS-only when no endpoint is reachableAES-256-GCM Encryption — All stored data is encrypted at rest
Case Management — Organize memories by project or case
Hebbian Links — Memories accessed together automatically strengthen their connections
Broadcast — Notify all Claude Code sessions via claude-peers
Related MCP server: claude-memory
Quick Start
git clone https://github.com/yutoribengoshi/memory-mcp.git
cd memory-mcp
npm installAdd to ~/.claude/settings.json:
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/memory-mcp/index.js"]
}
}
}Semantic Search
By default (no env vars needed), the server tries a local Ollama at http://localhost:11434 with nomic-embed-text. If the endpoint is unreachable, everything still works via FTS. Missing vectors are backfilled automatically in the background once the endpoint becomes available.
Config resolution order: env vars > ~/.memory-mcp/config.json (embedding_api_key / embedding_url / embedding_model) > Ollama defaults.
To use OpenAI instead, set an API key:
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/memory-mcp/index.js"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}Also supports custom endpoints (Ollama, LMStudio, etc.):
{
"env": {
"EMBEDDING_API_KEY": "your-key",
"EMBEDDING_URL": "http://localhost:11434/v1/embeddings",
"EMBEDDING_MODEL": "nomic-embed-text"
}
}Tools
Tool | Description |
| Save a note (upsert by key) |
| Save full conversation |
| Full-text search (Japanese + Hebbian links) |
| Vector similarity search (requires API key) |
| RAG: hybrid search (FTS + vector) with full-text context retrieval |
| List saved conversations |
| Get full conversation by ID |
| Delete a conversation |
| Save note linked to a case |
| List all cases |
| Get case details with notes and conversations |
| Archive a case |
| Merge a fragmented case into another (moves notes/conversations) |
| Save and broadcast to all sessions |
| View Hebbian links for a memory |
| Show statistics |
How It Works
Hebbian Links
Inspired by Hebb's rule in neuroscience — "neurons that fire together wire together."
Memories retrieved together by one query get linked (co-retrieval)
Memories searched within 5 minutes of each other get linked — search history is persisted, so this works across sessions
Memories in the same case get linked
Links strengthen with repeated co-access; opening a search result (
get_conversation) reinforces itUnused links decay after 30 days (weight x 0.95, applied at most once per day)
Links below 0.01 are pruned
Data Storage
~/.memory-mcp/
├── memory.db # SQLite database (encrypted)
└── .key # AES-256-GCM encryption key (chmod 600)Requirements
Node.js 22+ (uses built-in
node:sqlite)Claude Code
Optional: OpenAI API key for semantic search
License
MIT
Author
Tomoyuki Seki (@yutoribengoshi)
日本語
「なんか俺のClaude Codeだけ賢くね?」の正体
Claude Code 用の長期記憶 MCP サーバー。セッションを跨いでもメモ・会話の文脈を忘れません。
特徴
SQLite 永続化 — メモ・会話を SQLite に保存。セッション終了後も記憶が残る
日本語全文検索 — FTS5 trigram トークナイザーで日本語の部分一致検索に対応
セマンティック検索 — OpenAI互換のEmbedding APIでベクトル類似検索。ローカルOllama(
nomic-embed-text)なら設定不要で自動有効。到達不能時はFTSのみで劣化なく継続AES-256-GCM 暗号化 — 保存データは自動で暗号化。鍵は
~/.memory-mcp/.keyに保持案件別管理 — 案件(case)単位でメモ・会話を整理。弁護士の実務から生まれた設計
ヘブ則リンク — 連続検索されたメモを自動リンク。使うほど関連記憶が強化される
ブロードキャスト — claude-peers 連携で複数セッションに一斉通知
インストール
git clone https://github.com/yutoribengoshi/memory-mcp.git
cd memory-mcp
npm installClaude Code に設定
~/.claude/settings.json の mcpServers に追加:
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/memory-mcp/index.js"]
}
}
}セマンティック検索
既定(env指定なし)ではローカル Ollama(http://localhost:11434 + nomic-embed-text)を自動で使います。エンドポイント不達でもFTS検索は通常どおり動作し、復旧後は未ベクトル分がバックグラウンドで自動補完されます。
設定の解決順: 環境変数 > ~/.memory-mcp/config.json(embedding_api_key / embedding_url / embedding_model) > Ollama既定値。
OpenAIを使う場合はAPIキーを設定:
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/memory-mcp/index.js"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}Ollama や LMStudio などのローカルモデルも対応:
{
"env": {
"EMBEDDING_API_KEY": "your-key",
"EMBEDDING_URL": "http://localhost:11434/v1/embeddings",
"EMBEDDING_MODEL": "nomic-embed-text"
}
}使い方
Claude Code のチャットでそのまま使えます。
「このメモを保存して: 来週のリリースでは認証フローを変更する」
→ save_note が呼ばれ、暗号化して保存
「認証フローについて前に何か決めたっけ?」
→ search_memory で全文検索、ヘブ則で関連メモも表示
「認証に関連する記憶を広く探して」
→ semantic_search でベクトル類似検索
「この案件の経緯を踏まえて回答して」
→ rag_query でキーワード+ベクトルのハイブリッド検索、全文を文脈として取得ツール一覧
ツール | 説明 |
| メモを保存(key 指定で上書き可) |
| 会話全文を保存 |
| 全文検索(日本語対応 + ヘブ則リンク表示) |
| ベクトル類似検索(APIキー設定時のみ) |
| RAG検索: キーワード+ベクトルのハイブリッド検索で全文を文脈として返す |
| 保存済み会話の一覧 |
| 会話全文を取得 |
| 会話を削除 |
| 案件に紐づけてメモを保存 |
| 案件一覧 |
| 案件の詳細とメモ・会話一覧 |
| 案件をアーカイブ |
| 分裂した案件を統合(メモ・会話を移動) |
| メモを保存し全セッションに通知 |
| ヘブ則リンク(関連記憶)を取得 |
| 統計情報 |
ヘブ則リンクとは
神経科学のヘブの法則("一緒に発火するニューロンは結びつく")を応用した関連記憶システム。
同じ検索で一緒にヒットしたメモ同士が自動リンク(共起)
5分以内に連続検索されたメモ同士も自動リンク(検索履歴はDBに永続化されるためセッションを跨いでも学習する)
同じ案件のメモも自動リンク
検索後に
get_conversationで開くと「有用だった」シグナルとしてさらに強化30日以上アクセスされないリンクは自動減衰(weight × 0.95・1日1回まで)
weight < 0.01 のリンクは自動削除
動作要件
Node.js 22+(
node:sqliteを使用)Claude Code
オプション: OpenAI APIキー(セマンティック検索用)
ライセンス
MIT
作者
Tomoyuki Seki(@yutoribengoshi)
This server cannot be deployed
Maintenance
Related MCP Connectors
- mcpOAuthai.butlerbrain
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA lightweight MCP memory server built on SQLite + FTS5, providing cross-session long-term memory for Claude Code.-
- AlicenseNot gradedqualityCmaintenanceA persistent memory MCP server for Claude Code that enables long-term recall across sessions via hybrid search, code intelligence, and tools for reading/writing memory.5 npm1MIT
- AlicenseAqualityCmaintenanceA zero-dependency MCP server for cross-session memory recall in Claude Code. Provides lexical search, listing, and retrieval of past session memories to avoid re-explaining context.36 npmMIT
- FlicenseNot gradedqualityDmaintenanceMCP server that provides persistent long-term memory for Claude Code, enabling storage, search, and retrieval of project knowledge across sessions.-