MCP OpenMemory Server について
MCP OpenMemory Server は、Claude が会話を記憶し、時間とともに学習できるようにするスタンドアロンの MCP サーバーです。外部依存のない SQLite でデータを保存し、主に Claude Desktop のユーザー向けに設定します。
主な機能
- 01会話メッセージの保存と想起
- 02会話をまたいで更新されるメモリ要約の維持
- 03設定可能な時間枠内の最近の会話の取得
- 04外部サービスを使わない SQLite によるローカル永続化
- 05context パラメーターによるプロジェクト単位の分離
活用シーン
- 01Claude Desktop での会話をまたいだ個人設定の保持
- 02最近の会話履歴を確認して前回の作業を継続
- 031 つのデータベース内でプロジェクトごとにメモリを分離
MCP 対応
MCP で save_memory、recall_memory_abstract、update_memory_abstract、get_recent_memories の 4 つのツールを提供します。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
ツール
4掲載時のツール一覧 · 3 週間前に更新
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
| speaker | any | はい | |
| message | any | はい | |
| context | any | はい |
詳細
MCP OpenMemory サーバー
Claude が会話を記憶し、時間とともにそこから学習できるようにします。
https://github.com/user-attachments/assets/aef82b8e-3793-4ebd-b993-ddaef14d52d1
特長
- メモリの保存:会話メッセージを保存し、呼び出します
- メモリの要約:会話をまたいで要約されたメモリのコンテキストを維持します
- 最近の履歴:設定可能な期間内の最近の会話にアクセスします
- ローカルデータベース:外部依存関係なしで永続ストレージを実現するために SQLite を使用します
⚠️ 重要
Claude Desktop の終了時に会話履歴が失われないよう、MEMORY_DB_PATH を永続的な場所に設定する必要があります。 設定しない場合、データベースは一時的な場所にある ./memory.sqlite を既定で使用し、アプリケーションの再起動時に削除される可能性があります。
設定
前提条件
-
Node.js:MCP サーバーの実行に必要です。次のコマンドでインストールを確認します。
node --versionインストールされていない場合は、nodejs.org からダウンロードしてください。
-
Claude Desktop:macOS または Windows 向けの最新バージョンをダウンロードしてください。
Claude Desktop との連携
設定ファイルの場所
Claude Desktop の設定ファイルは次の場所にあります。
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
アクセスするには、Claude Desktop を開き、Claude メニュー → Settings → Developer → Edit Config の順に選択します。
macOS/Linux
npm を使って直接実行します
{
"mcpServers": {
"mcp-openmemory": {
"command": "npx",
"args": [
"@peakmojo/mcp-openmemory@latest"
],
"env": {
"MEMORY_DB_PATH": "/Users/username/mcp-memory.sqlite"
}
}
}
}
Windows
npm を使って直接実行します
{
"mcpServers": {
"mcp-openmemory": {
"command": "npx",
"args": [
"@peakmojo/mcp-openmemory@latest"
],
"env": {
"MEMORY_DB_PATH": "C:\\Users\\username\\mcp-memory.sqlite"
}
}
}
}
ソースから実行(すべてのプラットフォーム)
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["/path/to/your/repo/server.js"],
"env": {
"MEMORY_DB_PATH": "/path/to/your/memory.sqlite"
}
}
}
}
環境変数
MEMORY_DB_PATH:SQLite データベースファイルへのパス(既定値:./memory.sqlite)
確認
設定して Claude Desktop を再起動すると、次の項目が表示されます。
- 入力ボックスの左下にスライダーアイコン(🔧)
- スライダーをクリックすると表示される利用可能なツール:
save_memoryrecall_memory_abstractupdate_memory_abstractget_recent_memories
トラブルシューティング
サーバーが表示されない場合
- Claude Desktop を完全に再起動します
- 設定ファイルのJSON 構文を確認します
- パスが絶対パスであること(相対パスではないこと)と、パスが存在することを確認します
- サーバーの手動起動をテストします:
# Test if the server runs correctly npx @peakmojo/mcp-openmemory@latest
ログの確認
ログの場所:
- macOS:
~/Library/Logs/Claude/ - Windows:
%APPDATA%\Claude\logs\
最近のログを表示:
# macOS/Linux
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
# Windows
type "%APPDATA%\Claude\logs\mcp*.log"
よくある問題
- Windows での ENOENT エラー:環境設定に
APPDATAを追加します - ツール呼び出しの失敗:サーバーログでエラーを確認します
- NPM が見つからない:
npm install -g npmで NPM をグローバルにインストールします
詳しいトラブルシューティングについては、MCP の公式ドキュメントを参照してください。
セキュリティに関する注意
⚠️ Claude Desktop はユーザーアカウントの権限で MCP サーバーを実行します。 信頼できるソースのサーバーのみをインストールしてください。
利用可能なツール
- save_memory:個々の会話メッセージを保存します
- recall_memory_abstract:現在のメモリの要約を取得します
- update_memory_abstract:メモリの要約を更新します
- get_recent_memories:最近の会話履歴を取得します
使用方法
Claude Desktop に設定すると、サーバーは自動的に起動します。初回使用時にデータベースが自動的に作成されます。
システムプロンプトの例
# Memory Usage Guidelines
You should use memory tools thoughtfully to enhance conversation continuity and context retention:
## When to Save Memory
- **save_memory**: Store significant conversation exchanges, important decisions, user preferences, or key context that would be valuable to remember in future conversations
- Focus on information that has lasting relevance rather than temporary details
- Save when users share important personal information, project details, or ongoing work context
## When to Update Memory Abstract
- **update_memory_abstract**: After processing recent conversations, combine new important information with existing context to create an improved summary
- Update when there are meaningful developments in ongoing projects or relationships
- Consolidate related information to maintain coherent context over time
## When to Recall Memory
- **recall_memory_abstract**: Use at the beginning of conversations to understand previous context, or when you need background information to better assist the user
- **get_recent_memories**: Access when you need specific details from recent exchanges that aren't captured in the abstract
- Recall when the user references previous conversations or when context would significantly improve your assistance
## What Constitutes Critical Information
- User preferences and working styles
- Ongoing projects and their current status
- Important personal or professional context
- Decisions made and their rationale
- Key relationships or collaborations mentioned
- Technical specifications or requirements for recurring tasks
Use these tools to build continuity and provide more personalized assistance, not as error-prevention mechanisms or intent-guessing systems.
🔀 プロジェクトごとのメモリの名前空間
プロジェクトごとにメモリを分ける方法は 2 つあります。
1. 厳密な分離(Claude と Cursor)
各アプリの設定で、異なる MEMORY_DB_PATH を使用します。
- Claude(
claude_desktop_config.json):
"mcpServers": {
"claude-memory": {
"command": "npx",
"args": ["@peakmojo/mcp-openmemory@latest"],
"env": {
"MEMORY_DB_PATH": "/Users/you/claude-memory.sqlite"
}
}
}
- Cursor(.cursor/config.json またはツール設定):
"mcpServers": {
"cursor-memory": {
"command": "npx",
"args": ["@peakmojo/mcp-openmemory@latest"],
"env": {
"MEMORY_DB_PATH": "/Users/you/cursor-memory.sqlite"
}
}
}
各アプリは独自のインスタンスを実行し、それぞれの DB に保存します。
2. context によるソフトな名前空間設定
メモリツールを呼び出す際に、カスタムの「context」を渡します。
{ "context": "project-x", "message": "Notes from project X." }
これを使って、同じデータベース内でメモリを論理的に分割します。
🔍 セマンティック検索にはまだ対応していません。必要であれば GitHub に Issue を作成してください。
参考資料
- Model Context Protocol(MCP)公式ドキュメント - MCP の仕様とガイド一式
- Claude Desktop ユーザー向け MCP クイックスタート - セットアップ手順ガイド
- MCP サーバー開発ガイド - カスタム MCP サーバーの構築向け
- MCP GitHub リポジトリ - MCP の公式実装とサンプル
- Claude Desktop - Claude Desktop アプリケーションのダウンロード
- Node.js - MCP サーバーに必要なランタイム
ライセンス
MIT ライセンス
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。