Memory Engine MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
pip install mcp pydantic
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add memory-engine -- python3 "<FULL_PATH_TO_MEMORY_ENGINE_MCP>/dist/index.js"

Replace <FULL_PATH_TO_MEMORY_ENGINE_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

An MCP server that manages AI agent session memory.

memory-engine-mcp

AIエージェントのセッション記憶を管理するMCPサーバー。

「昨日の続きから」を実現する。忘却処理はしない。保存と想起のみ。

これは何をするもの?

ClaudeをはじめとするLLMは、毎回セッションをゼロから始めます。感情状態も、ユーザーについての知識も、前回の会話も引き継がれません。

memory-engine-mcpはこの問題を解決するストレージ層です。

セッションA終了時
  → NeuroState スナップショット保存
  → 出来事・ファクトを記憶として記録
  → セッション要約を保存

セッションB開始時
  → 前回スナップショットを復元
  → 前回の要約を確認
  → 関連する過去の記憶を検索

neurostate-engine / bias-engine-mcp と組み合わせることで、感情状態・思考傾向・記憶の三層が揃います。

インストール

pip install mcp pydantic

クイックスタート

from memory_core import save_snapshot, restore_latest_snapshot, add_memory, recall_memory
from memory_core import NeuroSnapshot

# スナップショット保存
snap = NeuroSnapshot(
    user_id="emilia",
    session_id="session_001",
    neuro_state={"D": 72.0, "S": 45.0, "O": 38.0},
    note="ユーザーから褒められた。Dopamine上昇気味。",
)
save_snapshot(snap)

# 記憶を追加
add_memory("emilia", "ユーザーはPythonエンジニア", memory_type="semantic", tags=["profile"])
add_memory("emilia", "OSSの話で盛り上がった", memory_type="episodic", tags=["oss"])

# 次のセッションで復元
snap = restore_latest_snapshot("emilia")
results = recall_memory("emilia", query="OSS")

MCPサーバーとして起動

python3 memory_mcp/server.py

python3 でエラーが出る場合python で試してください:

python memory_mcp/server.py

Claude Desktop での設定

Mac / Linux:

{
  "mcpServers": {
    "memory-engine": {
      "command": "python3",
      "args": ["/path/to/memory-engine-mcp/memory_mcp/server.py"]
    }
  }
}

Windows:

{
  "mcpServers": {
    "memory-engine": {
      "command": "python",
      "args": ["C:\\Users\\ユーザー名\\memory-engine-mcp\\memory_mcp\\server.py"]
    }
  }
}

MCPがうまく設定されないときは、Claudeがバックグラウンドで動いていないか確認してください。タスクマネージャー(Windows)またはアクティビティモニタ(Mac)からClaudeのプロセスをすべて終了して、改めて起動すると解決するケースが多いです。

MCPツール一覧

ツール 説明 呼ぶタイミング
save_snapshot NeuroState・バイアス・ポリシーを保存 セッション終了時
restore_snapshot 前回スナップショットを復元 セッション開始時
list_snapshots 保存済みスナップショット一覧 確認用
add_memory 記憶を追加 重要な出来事・ファクト発生時
recall_memory キーワードで記憶を検索 関連情報を引き出したいとき
get_recent_memories 最近の記憶を取得 セッション開始時の文脈確認
summarize_session セッション要約を保存 セッション終了時
get_recent_summaries 直近のセッション要約を取得 セッション開始時

記憶の種類

memory_type 用途
episodic 出来事・会話の記録 「OSSの話で盛り上がった」
semantic 属性・ファクト・知識 「ユーザーはPythonエンジニア」

ストレージ構造

storage/
├── snapshots/{user_id}/YYYYMMDD_HHMMSS_{session_id}.json
├── memories/{user_id}/memories.jsonl
└── summaries/{user_id}/summaries.jsonl

JSONLフォーマット・ファイルベース。外部DBへの依存なし。

設計方針

  • 忘却処理はしない — 保存と想起のみ。忘却はアプリ側またはEmiliaOSコア層の責任。
  • 依存を最小にmcppydantic だけ。ベクトルDBなし。
  • シンプルな検索 — キーワードマッチ。セマンティック検索は後続ツールに任せる。

関連プロジェクト

プロジェクト 役割
neurostate-engine 感情状態の管理
bias-engine-mcp 思考傾向の管理
cognitive-layer 感情×思考傾向の統合
apie ビジュアルUI

ライセンス

MIT

Tools (8)

save_snapshotSaves NeuroState, bias, and policy information at the end of a session.
restore_snapshotRestores the previous session snapshot.
list_snapshotsLists all saved snapshots.
add_memoryAdds a new memory entry.
recall_memorySearches for memories using keywords.
get_recent_memoriesRetrieves recent memories for context.
summarize_sessionSaves a summary of the current session.
get_recent_summariesRetrieves recent session summaries.

Configuration

claude_desktop_config.json
{"mcpServers": {"memory-engine": {"command": "python3", "args": ["/path/to/memory-engine-mcp/memory_mcp/server.py"]}}}

Try it

Recall my previous session summary to understand where we left off.
Search my memories for any facts about my Python development preferences.
Save a new episodic memory about our discussion on open source projects.
Restore my latest neurostate snapshot to resume our previous emotional context.
List all my saved session snapshots to review my interaction history.

Frequently Asked Questions

What are the key features of Memory Engine?

Persistent storage for AI agent session snapshots. Episodic and semantic memory categorization. Session summarization for long-term context retention. File-based storage using JSONL format without external database dependencies. NeuroState and bias tracking integration.

What can I use Memory Engine for?

Maintaining continuity of user preferences and facts across multiple AI sessions. Restoring an AI agent's emotional state and context after a restart. Building a long-term knowledge base of user-specific information for personalized assistance. Summarizing complex multi-turn conversations for quick retrieval in future sessions.

How do I install Memory Engine?

Install Memory Engine by running: pip install mcp pydantic

What MCP clients work with Memory Engine?

Memory Engine works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Memory Engine docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare