Skip to main content
Glama

MCP Memory Server

by sdimitrov

MCP メモリサーバー

このサーバーは、効率的なベクトル類似性検索を実現する pgvector を備えた PostgreSQL を搭載し、mem0 原則を使用して AI アシスタントの長期記憶機能を実装します。

特徴

  • ベクトル類似性検索のためのpgvectorを使用したPostgreSQL
  • BERTを使用した自動埋め込み生成
  • メモリ操作用のRESTful API
  • セマンティック検索機能
  • さまざまな種類の記憶(学習、経験など)のサポート
  • タグベースの記憶検索
  • 記憶の信頼度スコア
  • リアルタイム更新のためのサーバー送信イベント(SSE)
  • カーソルMCPプロトコル対応

前提条件

  1. pgvector 拡張機能がインストールされた PostgreSQL 14+:
# In your PostgreSQL instance: CREATE EXTENSION vector;
  1. Node.js 16以上

設定

  1. 依存関係をインストールします:
npm install
  1. 環境変数を設定します.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
  1. データベースを初期化します。
npm run prisma:migrate
  1. サーバーを起動します。
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によって自動的に起動されます。動作を確認するには、次の手順に従ってください。

  1. カーソルを開く
  2. カーソルが起動するとメモリサーバーが自動的に起動します
  3. http://localhost:3333/mcp/v1/healthにアクセスしてサーバーの状態を確認できます。

利用可能なMCPエンドポイント

SSE接続
  • エンドポイント: GET /mcp/v1/sse
  • クエリパラメータ:
    • subscribe : サブスクライブするイベントのコンマ区切りリスト(オプション)
  • イベント:
    • connected : 初期接続時に送信されます
    • memory.created : 新しいメモリが作成された時に送信されます
    • memory.updated : 既存のメモリが更新されたときに送信されます
メモリ操作
  1. 記憶を創る
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 }
  1. 思い出を探す
GET /mcp/v1/memory/search?query=web+frameworks&type=learning&tags=nodejs
  1. 思い出をリストアップ
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: メモリが作成された時刻
  • 更新日時: メモリが最後に更新された日時
-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

効率的なベクトル類似性検索を実現する pgvector を備えた PostgreSQL を使用して AI アシスタントの長期記憶機能を実装し、保存された情報のセマンティック検索を可能にします。

  1. 特徴
    1. 前提条件
      1. 設定
        1. カーソルの使用
          1. カーソルにMCPサーバーを追加する
          2. 利用可能なMCPエンドポイント
          3. 健康チェック
          4. 応答フォーマット
        2. メモリスキーマ

          Related MCP Servers

          • -
            security
            F
            license
            -
            quality
            Enables AI assistants to enhance their responses with relevant documentation through a semantic vector search, offering tools for managing and processing documentation efficiently.
            Last updated -
            62
            13
            TypeScript
          • -
            security
            F
            license
            -
            quality
            Enables AI assistants to interact with Metabase, providing access to dashboards, questions, databases, and tools for executing queries and viewing data through natural language.
            Last updated -
            JavaScript
            • Apple
          • -
            security
            A
            license
            -
            quality
            Enhanced knowledge graph memory server for AI assistants that uses Neo4j as the backend storage engine, enabling powerful graph queries and efficient storage of user interaction information with full MCP protocol compatibility.
            Last updated -
            TypeScript
            MIT License
          • -
            security
            A
            license
            -
            quality
            Connects Bear Notes to AI assistants using semantic search and RAG (Retrieval-Augmented Generation), allowing AI systems to access and understand your personal knowledge base through meaningful search rather than just keyword matching.
            Last updated -
            8
            3
            JavaScript
            MIT License
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/sdimitrov/mcp-memory'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server