CogMemory MCP Server
CogMemory MCP サーバー
AI コーディングエージェント向けに4つのコンテキストサブシステムを提供する統合 Model Context Protocol サーバー:
メモリ — 決定、規約、エラー、アクティブコンテキスト、変更ログ、計画、タスク、セッション
ナレッジグラフ — エンティティ、リレーション、オブザベーション
スペック — 長文ドキュメント(PRD/SRS)、KGエンティティへのオプションリンク付き
コードグラフ — 静的構造グラフ(シンボル/エッジ)+ 名前付き実行トレース + AI生成アノテーション
ストレージ:SQLite(better-sqlite3 使用)。スコープごとに1つの .db ファイル。
クイックスタート
インストール
git clone <repo> && cd cogmemory-mcp
pnpm install
pnpm run buildVS Code での設定
.vscode/mcp.json(ワークスペーススコープ)に追加:
{
"servers": {
"cogmemory": {
"command": "node",
"args": ["/absolute/path/to/cogmemory-mcp/dist/index.js"]
}
}
}または、グローバルで利用するにはユーザー mcp.json に追加します。
MCP Inspector での実行(開発用)
pnpm run inspectRelated MCP server: LumenCore
スコープ設定
CogMemory は以下の優先順位でスコープを解決します:
ワークスペースルートの
.cogmemory/config.json:{ "scope": "global" }環境変数:
COGMEMORY_SCOPE=globalデフォルト:
workspace
パス
スコープ | データベースパス |
workspace |
|
global |
|
ワークスペース解決とマルチルートサポート
CogMemory はワークスペースルート(.cogmemory/memory.db が配置される場所)を以下の優先順位で解決します:
--workspace <path>CLI 引数(最優先)COGMEMORY_WORKSPACE環境変数CWD からの遡及検索 —
.cogmemory/ディレクトリを含む最も近い親ディレクトリを検索CWD へのフォールバック
マルチルート VS Code ワークスペース
VS Code のマルチルートワークスペースでは、各フォルダが独立したワークスペースルートとなります。CogMemory はこれを次のように処理します:
シングルルート — 自動的に動作。VS Code は CWD をワークスペースフォルダに設定し、
--workspaceはmcp.jsonを介して渡されます。マルチルート — 各ワークスペースフォルダは独自の
.cogmemory/を持つことができます。それぞれ異なる--workspaceパスで CogMemory を指定するか、親ディレクトリに共有の.cogmemory/を配置します。
推奨されるマルチルート mcp.json(フォルダごと):
{
"servers": {
"cogmemory-frontend": {
"command": "node",
"args": [
"/path/to/cogmemory-mcp/dist/index.js",
"--workspace",
"/path/to/frontend"
]
},
"cogmemory-backend": {
"command": "node",
"args": [
"/path/to/cogmemory-mcp/dist/index.js",
"--workspace",
"/path/to/backend"
]
}
}
}または共有データベースを使用(すべてのルートを1か所に):
{
"servers": {
"cogmemory": {
"command": "node",
"args": [
"/path/to/cogmemory-mcp/dist/index.js",
"--workspace",
"/shared/root"
]
}
}
}またはグローバルスコープを使用して、すべてのワークスペース間で共有:
{
"servers": {
"cogmemory": {
"command": "node",
"args": ["/path/to/cogmemory-mcp/dist/index.js"]
}
}
}export COGMEMORY_SCOPE=globalツールリファレンス
メモリツール
ツール | 説明 |
| ワークセッションを開始(セッションIDを返す) |
| セッションを終了し、サマリーを保存 |
| 決定、エラー、変更ログを含むセッション詳細を呼び出す |
| 根拠とタグ付きで決定を記録 |
| 規約を記録/更新(デザイントークン、パターン、命名規則など) |
| シグネチャと解決策付きでエラーを記録 |
| 現在のフォーカス/タスクをキーでアップサート |
| 現在のフォーカスをキーで読み取り |
| 変更ログエントリを追加 |
| ロードマップ項目を追加 |
| プラン項目のステータスを変更 |
| タスクを作成(プランへのオプションリンク付き) |
| タスクのステータスを変更 |
| 決定/規約/エラー/変更ログを横断した統合検索 |
ナレッジグラフツール
ツール | 説明 |
| エンティティを追加(name+type で重複排除) |
| 2つのエンティティを型付きリレーションでリンク |
| エンティティにファクトを添付 |
| エンティティ、リレーション、オブザベーションを検索 |
スペックツール
ツール | 説明 |
| 長文ドキュメントを保存 |
| IDまたは完全なタイトルで取得 |
| コンテンツ/タイトルを更新(バージョン自動更新) |
コードグラフツール
ツール | 説明 |
| ワークスペースを走査し、ts-morph でシンボル+エッジを抽出(JS/TS) |
| シンボルの呼び出し元/呼び出し先(1ホップ)を検索 |
| エントリシンボルから BFS、オプションのトレース+アノテーション付きで有界サブグラフを生成 |
| シンボルまたはトレースにナラティブテキストを添付 |
アーキテクチャ
cogmemory-mcp/
├── src/
│ ├── index.ts # entry point, server bootstrap
│ ├── config.ts # scope resolution, path resolution
│ ├── types.ts # shared TS types mirroring schema
│ ├── db/
│ │ ├── connection.ts # DB open/close, pragma setup
│ │ ├── schema.sql # full schema (reference)
│ │ └── migrate.ts # idempotent schema application
│ ├── tools/
│ │ ├── memory.ts # decisions/conventions/errors/context/changelog/recall
│ │ ├── plan-tasks.ts # plan + tasks tools
│ │ ├── sessions.ts # start/end session, summary
│ │ ├── knowledge-graph.ts # entities/relations/observations
│ │ ├── specs.ts # spec CRUD
│ │ ├── code-graph.ts # index_codebase, query_code_graph
│ │ └── codemap.ts # generate_codemap, annotate_symbol
│ └── indexing/
│ ├── ts-analyzer.ts # ts-morph symbol/edge extraction
│ └── walker.ts # file discovery, gitignore respect
├── schema.sql # reference copy
├── package.json
├── tsconfig.json
└── README.mdスキーマ(15テーブル)
メモリ(8):
sessions、decisions、conventions、errors、context、changelog、plan、tasksナレッジグラフ(3):
entities、relations、observationsスペック(1):
specsコードグラフ(4):
symbols、edges、execution_traces、codemap_annotations
プラグマ
接続を開くたびに設定:
PRAGMA journal_mode = WAL;
PRAGMA foreign_keys = ON;開発
pnpm run dev # Run with tsx (no build step)
pnpm run build # Compile TypeScript
pnpm run start # Run compiled output
pnpm run inspect # Launch MCP Inspector
pnpm run smoke-test # Run smoke test scriptライセンス
MIT
This server cannot be installed
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 gradedqualityDmaintenanceProvides AI agents with persistent, searchable memory using a knowledge graph stored in SQLite. Features semantic search, temporal awareness, and workflow-aware prompts for development projects.13MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.8Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to maintain persistent, cross-session memory of codebase architecture, naming conventions, and decisions through MCP tools. Eliminates repetitive project re-explanation by automatically injecting stored context into every session with local-first SQLite storage and optional team sharing capabilities.4MIT
- AlicenseAqualityBmaintenanceProvides persistent cross-session memory and full-text search for AI coding assistants, storing project context, decisions, and preferences while enabling searchable access to conversation history via local SQLite.81MIT
Related MCP Connectors
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
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/skylarng89/cogmemory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server