wasurenagusa-mcp
wasurenagusa
AIコーディングエージェントに、失敗から学ぶ方法を教えましょう。
wasurenagusa(忘れな草) — 「私を忘れないで」という花言葉を持つ日本の花。
課題
AIコーディングエージェントは強力ですが、記憶力がありません。セッションが終わるたびに、プロジェクトの慣習や過去の決定事項、苦労して学んだ教訓はすべて消えてしまいます。
既存の解決策は、手動での作業が必要か、あるいはコンテキストウィンドウを圧迫するまで生の記憶を蓄積し続けるかのどちらかです。
Related MCP server: memory-bank-mcp
解決策
wasurenagusaは、単に「記憶」するだけでなく、**「学習」**するMCPサーバーです。
失敗を自動検出 — 再試行パターン、ユーザーのフラストレーション、繰り返される失敗をキャッチします。
教訓を原則に要約 — LLMが数百の生の記録を、実行可能な少数のルールに圧縮します。
ネガティブをポジティブに変換 — 各原則と並行して
positiveRuleを生成します。「Xをするな」を「代わりにYをせよ」に変換します。LLMは禁止事項よりも肯定的な指示に従う方がはるかに優れていることが研究で示されています(ピンクエレファント問題)。設定をテーマに圧縮 — LLMが散らばった設定を首尾一貫した要約にグループ化し、ポートやパスなどの事実を保持します。
重要なものだけを注入 — 統合された知恵とアクティブな設定のみを注入します。テンプレートの肥大化や重複したエントリはありません。
ハイブリッド検索(全文検索 + セマンティック検索) — SQLiteベースのストレージとローカルでの埋め込み推論(外部API不要)。日本語対応の全文検索とベクトルセマンティック検索を統合・重複排除します。完全にオフラインで動作します。
スマートタグ検索 — LLMが生成した重み付きタグと複合スコアリング(鮮度、タグの重み、アクセス頻度)により、データを破棄することなく検索優先度を最適化します。
メモリの退避/復元 — メモリをアクティブなコンテキストから一時的に退避させてコンテキストウィンドウのスペースを節約し、必要な時に復元します。サブエージェントを伴う長期セッションに最適です。
Claude Codeフックにより完全に自動化 — セットアップ後の設定は不要です。
実世界での影響
作者が8つの本番プロジェクトで日常的に使用した結果(プロジェクト間での記憶共有を含む):
1,581 "dont" entries → 5-9 principles per project (LLM consolidation)
each with positiveRule → affirmative-only injection (Pink Elephant fix)
29 config entries → 4-5 thematic summaries (LLM consolidation)
21,800 chars raw data → 6,200 chars injected (71% reduction)デモ
セッション1: Claudeがポート3000を使用 — ユーザーが8080に修正
停止フック: wasurenagusaが会話を自動分析し、失敗を記録
セッション2: Claudeが指示されることなく、正しくポート8080を使用
なぜwasurenagusaなのか
ほとんどのメモリツールは「何が起きたか」を保存します。wasurenagusaはAIに**「なぜうまくいかなかったのか」**を教え、同じ失敗を二度と繰り返さないようにします。
これは単なるメモリバンクではありません。学習システムです。
wasurenagusa | claude-mem | mcp-memory-service | CLAUDE.md | |
失敗の自動検出 | あり (再試行 + 感情) | なし | なし | なし |
自動統合 (LLM) | あり (dont→原則, 設定→テーマ) | なし | あり (減衰ベース) | なし |
ベクトルセマンティック検索 | あり (ローカル推論, オフライン) | あり (ChromaDB) | あり (SQLite-vec / ChromaDB) | なし |
メモリ階層 (短/中/長) | あり (コサイン距離閾値) | なし | なし | なし |
自動昇格 (強度) | あり (アクセス数 → 強度5) | なし | なし | なし |
フックによるゼロ作業 | あり | あり | 部分的 | なし |
人間が読めるストレージ | なし (SQLite — v1 Markdownから自動移行) | なし (SQLite) | なし (SQLite-vec) | あり |
マルチLLMサポート | Gemini / OpenAI / Anthropic (埋め込みはローカル — APIキー不要) | Claudeのみ | ローカル (MiniLM-L6-v2) | N/A |
トークン効率の良い検索 | あり (インデックス → 詳細, 70-90%削減) | あり (3層) | N/A | なし |
プロジェクト間メモリ | あり (アクティブな上位5プロジェクト) | なし | なし | なし |
ライセンス | MIT | AGPL-3.0 | Apache-2.0 | N/A |
仕組み
Session Start (Hook) — injection mode
→ Checks if consolidation is stale
→ Spawns background LLM worker if needed (non-blocking)
→ Spawns background embedding backfill worker (non-blocking)
→ Injects consolidated config + principles (layer 1) + recent 30-day entries (layer 2) + owner profile
→ Vector search injects semantically related short-term memories (layer 3)
→ Cross-project vector search injects related memories from other active projects (layer 4)
→ Only customized settings injected (defaults stripped)
Session Start (Hook) — agent mode
→ Injects dont summary + config index + owner profile (minimal footprint)
→ No vector search at startup (deferred to on-demand recall)
User Prompt (Hook) — agent mode
→ Injects 1-line reminder: "search memory if relevant"
→ Main agent spawns memory-recall sub-agent as needed
→ Sub-agent runs memory_search → returns summary only (no raw data in main context)
→ Survives compaction (re-injected on every user message)
During Session
→ memory_save auto-generates embedding via local inference (no API call)
→ memory_save enriches tags with LLM-assigned weights (0.0-1.0) (when API key available)
→ Theme shift triggers background re-tagging of related past entries
→ memory_search merges keyword + vector semantic + tag-weighted results
→ Vector hits increment access counts → auto-promote to intensity 5 at threshold
Session End (Hook)
→ LLM analyzes the conversation
→ Detects mistakes, frustration, retry patterns
→ Auto-saves lessons learned (with embedding)
→ Deduplicates against existing entries before saving
→ Updates active projects tracker (top 5 recent projects)
Background (async workers)
→ Consolidates "dont" entries → behavioral principles
→ Consolidates "config" entries → thematic summaries
→ Backfills embeddings for entries created before vector layer (20/run)
→ Results used in next session startクイックスタート
💡 推奨: このREADMEをClaude Codeに貼り付け、wasurenagusaのセットアップを依頼してください。以下のすべてを自動的に処理します。
前提条件
Node.js 18+
Claude Code (CLI)
コアメモリ機能には外部APIキー不要(埋め込みはローカルで実行)
1. インストール
npm install -g wasurenagusa-mcpまたはソースから:
git clone https://github.com/tsutushi0628/wasurenagusa-mcp.git
cd wasurenagusa-mcp
npm install && npm run build
npm link
npm run buildはCLIエントリーポイントに対して自動的にchmod +xを実行します。手動での権限設定は不要です。
2. 設定
~/.wasurenagusa/.env を作成します:
# Set at least one API key
GEMINI_API_KEY=your-key-here
# OPENAI_API_KEY=your-key-here
# ANTHROPIC_API_KEY=your-key-here変数 | 必須 | 説明 |
| 3つのうち1つ | Google Gemini APIキー |
| 3つのうち1つ | OpenAI APIキー |
| 3つのうち1つ | Anthropic APIキー |
| なし |
|
| なし | プロバイダーのデフォルトモデルを上書き |
| なし | メモリディレクトリ (デフォルト: |
| なし | 自動アーカイブ前のカテゴリごとのエントリ制限 (デフォルト: |
| なし | ログ保持期間(日数) (デフォルト: |
| なし | 自律タスクのSlack通知 |
3. MCPサーバーの登録
claude mcp add wasurenagusa -- wasurenagusa-mcp4. フックの設定
⚠️ 必須 — この手順を行わないと、セッション開始時にメモリが注入されません。最も見落とされやすい設定手順です。
~/.claude/settings.json (フックを分離したい場合は settings.local.json) に追加します:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "wasurenagusa-context",
"timeout": 5
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "wasurenagusa-context",
"timeout": 5
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "wasurenagusa-analyze",
"timeout": 30
}
]
}
],
"PreCompact": [
{
"hooks": [
{
"type": "command",
"command": "wasurenagusa-context",
"timeout": 15
}
]
}
]
}
}5. 使用開始
Claude Codeを起動します。以上です。
初回セッション:
.wasurenagusa/ディレクトリが自動作成されます初回会話後: 停止フックが重要なコンテキストを分析・保存します
2回目以降のセッション: 蓄積された知恵が開始時に自動注入されます
.gitignoreに.wasurenagusa/を追加してください — プロジェクト固有のメモリデータが含まれています。
メモリカテゴリ
カテゴリ | 保存内容 | ファイル |
config | API URL、ポート、認証場所 |
|
dont | 失敗、アンチパターン、ユーザーのフラストレーション |
|
decision | アーキテクチャの決定、技術選定 |
|
log | 実装記録、解決済みのエラー |
|
snippet | 頻繁に使用するコマンドとクエリ |
|
MCPツール
ツール | 説明 |
| 設定 + 統合された原則を取得 (セッション開始時に自動呼び出し) |
| 軽量インデックス検索 (ID、タイトル、タグのみ)。プロジェクト間検索には |
| IDで詳細を取得 |
| メモリのエントリを明示的に保存 |
| コンテキストウィンドウを節約するためにメモリを一時退避 |
| 退避させたメモリをアクティブなコンテキストに復元 |
| IDでエントリを削除 |
| 24時間365日実行される自律タスクを送信 |
| タスクの実行状況を確認 |
| 保留中の人間によるアクションを一覧・管理 |
| プロジェクトの品質基準を初期化 |
CLIコマンド
コマンド | 目的 | 呼び出し元 |
| 設定 + dont + ベクトルメモリをstdoutに出力 | SessionStart / UserPromptSubmit / PreCompactフック |
| 会話をLLM分析し自動保存 | 停止フック |
| ベクトルを持たないエントリの埋め込みを生成 | バックグラウンド (自動生成) |
| 破損したメモリデータの修復 (重複排除、ログの再ソート) | 手動 |
| 仕様ドキュメントの自動更新 | cron / systemdタイマー |
| すべてのアクティブなプロジェクトで統合を実行 | 手動 / スケジューラ |
| 夜間統合スケジューラのインストール/アンインストール/ステータス | 手動 |
出力モード
wasurenagusaはSessionStartフックに対して2つの出力モードをサポートしており、.wasurenagusa/config.json でプロジェクトごとに設定可能です。
モード | 説明 | 最適な用途 |
injection (デフォルト) | セッション開始時にメモリ全文を注入 | サブエージェントがない環境 (Cursor, Windsurfなど) |
agent | セッション開始時に最小限のインデックスを注入 + ユーザーメッセージごとにメモリ想起リマインダーを表示。詳細はサブエージェント経由でオンデマンド取得 | Claude Code + エージェントチーム |
設定
プロジェクトの .wasurenagusa/config.json に outputMode を追加します:
{
"outputMode": "agent"
}ファイルが存在しない、または outputMode が設定されていない場合、デフォルトは `"injection
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA self-hosted MCP server that provides AI assistants with a shared, persistent SQLite-backed memory for storing and retrieving project context, decisions, and discoveries. It enables cross-session continuity and team-wide knowledge sharing to keep AI coding tools aligned and informed.3MIT
- AlicenseBqualityBmaintenanceAn MCP server that gives AI assistants persistent memory across sessions. It stores project context, decisions, and progress in structured markdown files as well as a knowledge graph and sequential thinking for better memory storage.36371MIT
- AlicenseAqualityAmaintenanceA local MCP server that gives AI assistants a long-term memory by capturing sessions verbatim and surfacing relevant context automatically.14794MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that gives AI coding assistants persistent memory across sessions with chain-based project tracking, tickets, and structured handoffs.GPL 3.0
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
An MCP memory server. One memory your agents share — across models, devices and apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/tsutushi0628/wasurenagusa-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server