mcpField
M
MCP OpenMemory Server

MCP OpenMemory Server

ローカル
github.com/baryhuangメモリ・ナレッジ7173 週間前に更新

MCP OpenMemory Server について

MCP OpenMemory Server は、Claude が会話を記憶し、時間とともに学習できるようにするスタンドアロンの MCP サーバーです。外部依存のない SQLite でデータを保存し、主に Claude Desktop のユーザー向けに設定します。

主な機能

  1. 01会話メッセージの保存と想起
  2. 02会話をまたいで更新されるメモリ要約の維持
  3. 03設定可能な時間枠内の最近の会話の取得
  4. 04外部サービスを使わない SQLite によるローカル永続化
  5. 05context パラメーターによるプロジェクト単位の分離

活用シーン

  1. 01Claude Desktop での会話をまたいだ個人設定の保持
  2. 02最近の会話履歴を確認して前回の作業を継続
  3. 031 つのデータベース内でプロジェクトごとにメモリを分離

MCP 対応

MCP で save_memory、recall_memory_abstract、update_memory_abstract、get_recent_memories の 4 つのツールを提供します。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

mcp.json · 共通設定
{
"mcpServers": {
"openmemory": {
"command": "npx",
"args": [
"-y",
"@peakmojo/mcp-openmemory"
]
}
}
}
起動コマンドnpx -y @peakmojo/mcp-openmemory

ローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。

パッケージ
npm@peakmojo/mcp-openmemory

ツール

4

掲載時のツール一覧 · 3 週間前に更新

パラメーター型必須説明
speakeranyはい
messageanyはい
contextanyはい

詳細

MCP OpenMemory サーバー

npm version License: MIT MCP

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 を再起動すると、次の項目が表示されます。

  1. 入力ボックスの左下にスライダーアイコン(🔧)
  2. スライダーをクリックすると表示される利用可能なツール:
    • save_memory
    • recall_memory_abstract
    • update_memory_abstract
    • get_recent_memories
トラブルシューティング
サーバーが表示されない場合
  1. Claude Desktop を完全に再起動します
  2. 設定ファイルのJSON 構文を確認します
  3. パスが絶対パスであること(相対パスではないこと)と、パスが存在することを確認します
  4. サーバーの手動起動をテストします:
    # 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 を作成してください。

参考資料

ライセンス

MIT ライセンス

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。