MCP Memory Server
MCP メモリサーバー
このサーバーは、効率的なベクトル類似性検索を実現する pgvector を備えた PostgreSQL を搭載し、mem0 原則を使用して AI アシスタントの長期記憶機能を実装します。
特徴
ベクトル類似性検索のためのpgvectorを使用したPostgreSQL
BERTを使用した自動埋め込み生成
メモリ操作用のRESTful API
セマンティック検索機能
さまざまな種類の記憶(学習、経験など)のサポート
タグベースの記憶検索
記憶の信頼度スコア
リアルタイム更新のためのサーバー送信イベント(SSE)
カーソルMCPプロトコル対応
Related MCP server: MCPMem
前提条件
pgvector 拡張機能がインストールされた PostgreSQL 14+:
# In your PostgreSQL instance:
CREATE EXTENSION vector;Node.js 16以上
設定
依存関係をインストールします:
npm install環境変数を設定します
.env.sampleを.envにコピーし、値を調整します。
cp .env.sample .env.env構成の例:
# With username/password
DATABASE_URL="postgresql://username:password@localhost:5432/mcp_memory"
PORT=3333
# Local development with peer authentication
DATABASE_URL="postgresql:///mcp_memory"
PORT=3333データベースを初期化します。
npm run prisma:migrateサーバーを起動します。
npm start自動リロードを使用した開発の場合:
npm run devカーソルの使用
カーソルにMCPサーバーを追加する
Cursor にメモリサーバーを追加するには、 ~/.cursor/mcp.json mcpServersある MCP 設定ファイルを変更する必要があります。mcpServers オブジェクトに以下の設定を追加します。
{
"mcpServers": {
"memory": {
"command": "node",
"args": [
"/path/to/your/memory/src/server.js"
]
}
}
}/path/to/your/memoryメモリ サーバーのインストールへの実際のパスに置き換えます。
たとえば、リポジトリを/Users/username/workspace/memoryにクローンした場合、構成は次のようになります。
{
"mcpServers": {
"memory": {
"command": "node",
"args": [
"/Users/username/workspace/memory/src/server.js"
]
}
}
}サーバーは必要に応じてCursorによって自動的に起動されます。動作を確認するには、次の手順に従ってください。
カーソルを開く
カーソルが起動するとメモリサーバーが自動的に起動します
http://localhost:3333/mcp/v1/healthにアクセスしてサーバーの状態を確認できます。
利用可能なMCPエンドポイント
SSE接続
エンドポイント:
GET /mcp/v1/sseクエリパラメータ:
subscribe: サブスクライブするイベントのコンマ区切りリスト(オプション)
イベント:
connected: 初期接続時に送信されますmemory.created: 新しいメモリが作成された時に送信されますmemory.updated: 既存のメモリが更新されたときに送信されます
メモリ操作
記憶を創る
POST /mcp/v1/memory
Content-Type: application/json
{
"type": "learning",
"content": {
"topic": "Express.js",
"details": "Express.js is a web application framework for Node.js"
},
"source": "documentation",
"tags": ["nodejs", "web-framework"],
"confidence": 0.95
}思い出を探す
GET /mcp/v1/memory/search?query=web+frameworks&type=learning&tags=nodejs思い出をリストアップ
GET /mcp/v1/memory?type=learning&tags=nodejs,web-framework健康チェック
GET /mcp/v1/health応答フォーマット
すべての API 応答は標準の MCP 形式に従います。
{
"status": "success",
"data": {
// Response data
}
}またはエラーの場合:
{
"status": "error",
"error": "Error message"
}メモリスキーマ
id: 一意の識別子
タイプ: 記憶の種類(学習、経験など)
コンテンツ: 実際のメモリ内容 (JSON)
出典: 記憶の源
埋め込み: コンテンツのベクトル表現(384次元)
tags: 関連タグの配列
信頼度: 信頼度スコア (0-1)
createdAt: メモリが作成された時刻
更新日時: メモリが最後に更新された日時
This server cannot be deployed
Maintenance
Related MCP Connectors
- memoryOAuthcom.leapmemory
Long-term memory for AI assistants. Isolated per-user storage, recall across conversations.
Shared cross-LLM long-term memory over MCP: semantic recall, sessions, and media (pgvector).
Persistent memory for AI assistants: store, search, and connect knowledge across conversations.
Memory system for AI agents with semantic search. Store and recall memories with ease.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to store and retrieve long-term memories using PostgreSQL with vector similarity search. Supports semantic memory operations, tagging, and real-time updates for persistent learning across conversations.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to store and retrieve memories with semantic search capabilities using vector embeddings. Provides persistent memory storage with SQLite backend for context retention across conversations.48 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to store, retrieve, and manage contextual knowledge across sessions using semantic search with PostgreSQL and vector embeddings. Supports memory relationships, clustering, multi-agent isolation, and intelligent caching for persistent conversational context.17 npm49MIT
- AlicenseNot gradedqualityBmaintenancePersistent semantic memory for AI agents using PostgreSQL and vector embeddings, enabling cross-session continuity and semantic search.AGPL 3.0