whimsicality-mcp
Officialwhimsicality-mcp
AIエージェントに永続メモリを提供するMCP(Model Context Protocol)サーバーです。コンテキスト保存、ファクト、プラン、RAG検索、コードスニペット、会話の圧縮がセッションやプロセスをまたいで保持されます。
MCP互換のエージェントならどれでも動作します:Devin CLI、Claude Desktop、Cursorなど。
クイックスタート
# Install globally
npm install -g whimsicality-mcp
# Or run without installing
npx whimsicality-mcp次に、エージェントのMCP設定に追加します:
{
"mcpServers": {
"whimsicality": {
"command": "npx",
"args": ["whimsicality-mcp"]
}
}
}これだけです。サーバーはディスクベースの永続化でそのまま動作し、ネイティブ依存関係は不要です。データは~/.whimsicality/kernel-storage/に保存されます。
Related MCP server: Memory MCP
ツール
サーバーは14個のツールを公開しており、すべてwhim_プレフィックスが付いています:
ツール | 目的 |
| 永続的なテキストコンテキストスロット |
| キーと値のファクト(ユーザー設定、プロジェクトの決定事項) |
| 長期的な作業のためのプランドキュメント |
| ドキュメントのインデックス化とセマンティック検索 |
| 再利用可能なコードスニペット |
| 会話履歴を要約に圧縮 |
エージェントの使用方法
セッション開始時 — 以前のエージェントから状態を復元:
1. whim_plan_get({}) → read the current plan
2. whim_facts_list({}) → list all facts
3. whim_facts_get({name: "..."}) → read relevant facts
4. whim_context_list({}) → list all context slots
5. whim_context_get({key: "..."}) → read relevant slots作業中 — 次のエージェントのために状態を保存:
whim_plan_save({plan: "updated plan with progress and next steps"})
whim_facts_save({name: "new_fact", value: "..."})
whim_context_set({key: "what_i_learned", text: "..."})バックエンド
サーバーはカーネルを見つける4つの方法をサポートしており、順に試行されます:
1. ディスクフォールバック(デフォルト、セットアップ不要)
そのまま動作します。データは~/.whimsicality/kernel-storage/whim-mcp-store.jsonのJSONファイルに永続化されます。RAG/スニペットは単語オーバーラップ検索を使用します。ネイティブ依存関係はありません。
2. プリビルドカーネルバイナリ(最も簡単なアップグレード)
npm install @whimsicalitylabs/kernel-prebuiltプラットフォーム固有のプリビルドバイナリは、npmのoptionalDependenciesを介して配布されます。サーバーはnode_modules内のバイナリを自動検出します。
注: プリビルドバイナリはまだすべてのプラットフォームで利用できるわけではありません。ステータスについてはkernel-prebuiltを参照してください。
3. 既存のバイナリを指定
{
"mcpServers": {
"whimsicality": {
"command": "npx",
"args": ["whimsicality-mcp"],
"env": {
"WHIMSICALITY_KERNEL_BIN": "/path/to/whimsicality-kernel"
}
}
}
}4. ソースからビルド
Rustワークスペースをクローンしてビルド:
git clone https://github.com/WhimsicalityLabs/whimsicality-kernel.git
cd whimsicality-kernel
cargo build --release次に、WHIMSICALITY_KERNEL_BINをtarget/release/whimsicality-kernelに設定します。
カーネルが追加するもの
Rustカーネルは以下を提供します:
階層型ストレージ:ホット(RAM)→ ウォーム(mmap)→ コールド(ディスク上のzstd)で、自動プロモーション/デモーション付き
コンテンツアドレス型の重複排除:同一の値はblake3ハッシュを介してストレージを共有
ロックフリーのホットパス:並行読み取り用のDashMap
追記専用セッションログ:ブランチ/フォーク対応のbincodeエントリ
構造化コンテキストの組み立て:フラットなトークンストリームではなく、名前付き変数
カーネルが利用可能な場合、サーバーはカーネルとディスクの両方にデュアルライトします。これにより、カーネルの高速なセッション内アクセスと、セッション間の信頼性のためのディスク永続化の両方が得られます(カーネルのホットティアはRAMのみで、プロセス終了時に失われます)。
設定
すべての設定は環境変数を介して行います:
変数 | デフォルト | 説明 |
|
| すべての保存データのルートディレクトリ |
| (自動検出) | Rustカーネルバイナリへのパス |
|
| ホットティアのRAM予算(MB単位、カーネルのみ) |
開発
git clone https://github.com/WhimsicalityLabs/Whimsicality-MCP.git
cd whimsicality-mcp
npm install
npm run build
node bin/whimsicality-mcp.jsライセンス
MIT
Available Tools
14 toolswhim_compactA
Truncate conversation history to fit a token budget. Keeps first and last messages intact, truncates the middle. This is truncation, not summarization.
Inputs: messages (required), maxTokens.
whim_context_deleteB
Delete a context slot.
Inputs: key (required), namespace.
whim_context_getB
Retrieve text from a named context slot.
Inputs: key (required), namespace.
whim_context_listB
List all context slot keys.
Inputs: namespace.
whim_context_setA
Store text in a named context slot. Use for persistent memory that survives across agent sessions.
Inputs: key (required), text (required), namespace.
whim_facts_getC
Retrieve a named fact.
Inputs: name (required).
whim_facts_listC
List all saved fact names.
Inputs: no named parameters.
whim_facts_saveB
Save a named fact. Facts are key-value pairs that persist across sessions.
Inputs: name (required), value (required).
whim_plan_getC
Retrieve a saved plan.
Inputs: name.
whim_plan_saveA
Save a plan document. The plan persists across sessions and can be retrieved later by another agent.
Inputs: plan (required), name.
whim_rag_indexB
Index a document for keyword search retrieval.
Inputs: id (required), text (required).
whim_rag_searchB
Search indexed documents by keyword overlap. Returns relevant chunks ranked by word-boundary match score.
Inputs: query (required), topK.
whim_snippet_saveB
Save a reusable code snippet.
Inputs: code (required), name (required), language (required), description.
whim_snippet_searchB
Search saved snippets by keyword overlap.
Inputs: query (required), topK.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools have distinct purposes: facts, context slots, RAG search, plans, snippets, and compaction each serve different needs. However, facts and context both act as persistent key-value stores, which could cause some confusion, though the descriptions clarify context as memory and facts as factual data.
The naming follows a consistent pattern of 'whim_<resource>_<action>' for most tools (e.g., whim_facts_get, whim_context_set, whim_rag_search). Minor exceptions include whim_compact, which lacks a resource category, and slight verb placement variations, but overall the pattern is predictable.
14 tools is a reasonable count for a multi-purpose memory and utility server. Each tool covers a distinct functional area, though some areas like facts and context could potentially be merged, but the count is within the well-scoped range and does not feel excessive.
The server covers core operations for facts, context, and RAG, but has notable gaps: no delete for facts, plans, or snippets; no list for plans or snippets; and no way to retrieve a snippet by name (only search). These missing operations may force agents to work around or leave orphaned data.
Maintenance
Related MCP Connectors
Persistent memory for AI agents. Search, store, and recall across sessions.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Persistent memory for AI agents: save, search and connect context across tools and sessions.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI agents with persistent, searchable memory that survives across conversations using semantic search, temporal versioning, and smart organization. Enables long-term context retention and cross-session continuity for AI assistants.14-
- FlicenseNot gradedqualityDmaintenanceProvides persistent AI agent memory using a local vector database for long-term semantic storage and short-term session scratchpads. It enables low-latency memory operations including search, storage, and bulk management without external cloud dependencies.-
- AlicenseNot gradedqualityDmaintenanceProvides persistent memory storage for AI agents with full-text search, tagging, and importance levels, enabling agents to store and retrieve memories efficiently.MIT
- AlicenseAqualityCmaintenanceProvides persistent, searchable memory for AI agents, enabling them to retain, recall, and reflect on information across conversations.191MIT