MCP Local Memoryのロゴ

MCP Local Memory

コミュニティ
Beledarian

A lightweight, powerful local memory server for AI agents supporting text, entities, and relations. Enables persistent codebase understanding and user preference management.

公開者Beledarian
リポジトリmcp-local-memory
言語TypeScript
フォーク
5
スター
56
利用可能なツール
0
通信方式stdio
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    MCP Local Memoryは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには56件のスターと5件のフォークがあります。

Local Memory MCP Server

A local-first MCP server that gives AI agents shared, durable memory through hybrid semantic search, SQLite FTS5, and a knowledge graph—without Docker or a required cloud service.

Local Memory MCP demo

Why use it?

  • Shared across agents: one SQLite database can serve Codex, Claude, desktop clients, IDE integrations, and custom MCP clients.
  • Hybrid recall: when sqlite-vec is available, local all-MiniLM-L6-v2 embeddings and FTS5 keyword evidence are merged. FTS remains available as the explicit fallback.
  • Temporal recall: search natural-language periods such as last week or in 2025, or pass an explicit ISO startDate and endDate.
  • Adaptive ranking: relevance, time-decayed importance, tags, and bounded recent familiarity work together without rewriting importance on every recall.
  • Auditable lifecycle: memories can be reinforced, marked outdated or incorrect, restored, exported, or forgotten.
  • Structured context: entities, relations, observations, conversations, tasks, and todos live beside free-form memories.
  • Local by default: memory data stays in your configured SQLite file. Optional LLM features send input only to the OLLAMA_URL you configure.

For every option and tool, see the extended guide.

Requirements

  • Node.js 22 or newer on a supported LTS release.
  • Python and C++ build tools when better-sqlite3 has no matching prebuild.
  • Windows users can install Desktop development with C++ through Visual Studio Build Tools.

Windows ARM64 semantic search is supported by a bundled, checksum-verified sqlite-vec v0.1.9 DLL. WSL2 remains a supported alternative.

Quick start

Add the published package to an MCP client:

json
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@beledarian/mcp-local-memory@2"],
      "env": {
        "ARCHIVIST_STRATEGY": "nlp"
      }
    }
  }
}

The default database is ~/.memory/memory.db. The first semantic recall may download the local embedding model.

Global installation provides both memory and mcp-local-memory:

bash
npm install -g @beledarian/mcp-local-memory@2
memory --help

From source:

bash
git clone https://github.com/Beledarian/mcp-local-memory.git
cd mcp-local-memory
npm install
npm run build
npm start

See the Codex + WSL2 setup when the database or server runs inside Linux.

Remote Server & Docker Deployment (SSE)

mcp-local-memory supports native HTTP/SSE transport for centralized setups across multiple workstations, laptops, Tailnets, or VPS instances:

bash
# Run standalone SSE server on port 8320 with optional Bearer token auth:
node dist/index.js --transport sse --port 8320 --token "your-secret-token"

# Or run via Docker Compose:
docker compose up -d

Configure your remote MCP client (mcp_config.json):

json
{
  "mcpServers": {
    "memory": {
      "url": "https://your-server.ts.net:8320/sse",
      "headers": {
        "Authorization": "Bearer your-secret-token"
      }
    }
  }
}

Essential configuration

VariableDefaultPurpose
MEMORY_DB_PATH~/.memory/memory.dbSQLite database location.
MCP_TRANSPORTstdiostdio (default) or sse (remote HTTP/SSE server).
PORT / MCP_PORT8320HTTP port when running in SSE mode.
MCP_AUTH_TOKENunsetOptional Bearer token for remote SSE authentication.
ARCHIVIST_STRATEGYnlppassive, nlp, llm, or a comma-separated combination.
OLLAMA_URLhttp://localhost:11434/api/generateOptional LLM generation endpoint.
MEMORY_SEMANTIC_WEIGHT0.9Retrieval relevance versus decayed importance.
MEMORY_MIN_RELEVANCE0.55Minimum relevance required before a candidate can be returned.
MEMORY_RECALL_FAMILIARITY_MAX_BOOST0.03Maximum temporary familiarity contribution; 0 disables future recording and scoring but does not purge existing rows.
MEMORY_RECALL_FAMILIARITY_WINDOW_DAYS30Recent exposure window.
USE_WORKERfalseRun archivist processing in a worker while retaining durable acknowledgement.
EXTENSIONS_PATHunsetDirectory containing opt-in JavaScript extensions.

All scoring, context, archivist, task, and extension variables are documented in the configuration reference.

How recall works

recall supports both topical and temporal questions:

  • Semantic vector and FTS5 keyword candidates are retrieved independently and merged, so an exact term is not hidden by a semantic result.
  • Natural-language dates such as yesterday, last week, and in 2025 are recognized in the query. ISO startDate and endDate filters are also available.
  • Weak matches are omitted, near-duplicates are collapsed, and outdated or incorrect memories stay hidden unless explicitly requested.
  • Relevant results are ranked using retrieval evidence, query coverage, tags, time-decayed importance, and a small recent-familiarity signal.
  • Each returned active memory can record one familiarity exposure per normalized-query hash and UTC day. The contribution is temporary and bounded to 0.03 by default; it does not rewrite importance or refresh decay.

reinforce_memory provides the stronger, durable feedback path:

  • used or important record positive evidence.
  • irrelevant lowers importance.
  • incorrect or outdated suppresses the memory without deleting history.
  • restore returns a suppressed memory to active recall.

The extended scoring guide documents the formula, thresholds, deduplication, privacy limits, decay, and every familiarity control.

Entities, relations, and the graph

Free-form memories and structured knowledge complement each other:

  • Entities represent people, projects, places, topics, or other named concepts. Each has a type, importance, and appendable observations.
  • Relations are directional triples such as Project A --[uses]--> SQLite. Creating a relation also creates any missing endpoint as an Unknown entity.
  • Automatic extraction can identify entities and relations while saving a fact. Use ARCHIVIST_STRATEGY=nlp for local extraction, llm for the configured Ollama endpoint, or passive for manual graph maintenance.
  • Graph exploration can return an overview or a centered one- or two-hop neighborhood with entity observations, relations, and related memories.
  • Graph maintenance supports renaming or deleting entities, removing exact observations, and deleting individual relations. Entity renames update connected relations.
  • Clustering groups semantically related memories and entities into topic overviews when embeddings are available.

Use recall for ranked free-form retrieval and read_graph when connections between named concepts matter. They are complementary views of the same local knowledge base.

MCP surface

AreaTools and resources
Memoryremember_fact, remember_facts, recall, reinforce_memory, list_recent_memories, forget, export_memories
Graphcreate_entity, update_entity, delete_entity, create_relation, delete_relation, delete_observation, read_graph, cluster_memories
Conversationsinit_conversation, add_task, update_task_status, list_tasks, delete_task
Todosadd_todo, complete_todo, list_todos
Optional extractionconsolidate_context when ENABLE_CONSOLIDATE_TOOL=true
Resourcesmemory://current-context, memory://turn-context, task and todo resources

See the complete tool reference for arguments and lifecycle behavior.

Upgrading safely

When upgrading from 1.x:

  • move to Node.js 22;
  • back up MEMORY_DB_PATH;
  • expect automatic additive schema migration;
  • note that MEMORY_SEMANTIC_WEIGHT now means relevance versus importance;
  • recall no longer raises importance or refreshes decay;
  • run importance normalization only if you want to reset historical passive popularity.

The project does not claim crash-proof, zero-loss migration under every interruption scenario, so a verified backup remains the safety boundary.

Older releases passively increased importance and access_count during recall. Preview normalization before changing anything:

bash
npm run normalize:importance -- --db ~/.memory/memory.db

Applying normalization is optional and requires an explicit, non-existing backup path. See the migration and normalization guide.

Documentation

Development

These commands require a source checkout:

bash
npm install
npm run build
npm test

npm test covers scoring, schema migration, lifecycle and familiarity, privacy/provenance, MCP contracts, packaging, and native vector or FTS fallback.

License

MIT

MCP Local MemoryのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度MCP Local Memoryに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

MCP Local Memoryをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. MCP Local MemoryのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "mcp-local-memory": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてMCP Local MemoryのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. MCP Local MemoryのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
MCP Local Memoryを使ってこのタスクを手伝ってもらえますか?
MCP Local Memory
はい、読みました。
MCP Local Memoryで調べた結果をお伝えします。

よくある質問

MCP Local Memory MCPサーバーは何に使いますか?

MCP Local Memoryは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでMCP Local Memory MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでMCP Local Memoryを利用できます。

TypingMindでMCP Local Memory MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。MCP Local Memoryを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

MCP Local Memory MCPをTypingMindに接続するにはどうすればよいですか?

MCP Local MemoryはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでMCP Local Memory MCPのどのようなツールを利用できますか?

MCP Local MemoryはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

MCP Local Memory MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。MCP Local Memoryで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇