CogMemory MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CogMemory MCP Serverrecall what we decided about the auth refactor"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CogMemory MCP Server
A unified Model Context Protocol server providing four context subsystems for AI coding agents:
Memory — decisions, conventions, errors, active context, changelog, plan, tasks, sessions
Knowledge Graph — entities, relations, observations
Specs — long-form documents (PRD/SRS), optionally linked to a KG entity
Code Graph — static structural graph (symbols/edges) + named execution traces + AI-generated annotations
Storage: SQLite via better-sqlite3. One .db file per scope.
Quick Start
Install
git clone <repo> && cd cogmemory-mcp
pnpm install
pnpm run buildConfigure in VS Code
Add to .vscode/mcp.json (workspace-scoped):
{
"servers": {
"cogmemory": {
"command": "node",
"args": ["/absolute/path/to/cogmemory-mcp/dist/index.js"]
}
}
}Or add to your user mcp.json for global availability.
Run with MCP Inspector (dev)
pnpm run inspectRelated MCP server: LumenCore
Scope Configuration
CogMemory resolves scope in priority order:
.cogmemory/config.jsonin workspace root:{ "scope": "global" }Environment variable:
COGMEMORY_SCOPE=globalDefault:
workspace
Paths
Scope | Database Path |
workspace |
|
global |
|
Workspace Resolution & Multi-Root Support
CogMemory resolves the workspace root (where .cogmemory/memory.db lives) in this priority order:
--workspace <path>CLI argument (highest priority)COGMEMORY_WORKSPACEenvironment variableWalk up from CWD looking for the nearest parent containing a
.cogmemory/directoryFallback to CWD
Multi-Root VS Code Workspaces
In a VS Code multi-root workspace, each folder is a separate workspace root. CogMemory handles this:
Single-root — Works automatically. VS Code sets CWD to the workspace folder, and
--workspaceis passed viamcp.json.Multi-root — Each workspace folder can have its own
.cogmemory/. Point each to CogMemory with different--workspacepaths, or place a shared.cogmemory/in a parent directory.
Recommended multi-root mcp.json (per-folder):
{
"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"
]
}
}
}Or use a shared database (all roots in one place):
{
"servers": {
"cogmemory": {
"command": "node",
"args": [
"/path/to/cogmemory-mcp/dist/index.js",
"--workspace",
"/shared/root"
]
}
}
}Or use global scope to share across all workspaces:
{
"servers": {
"cogmemory": {
"command": "node",
"args": ["/path/to/cogmemory-mcp/dist/index.js"]
}
}
}export COGMEMORY_SCOPE=globalTool Reference
Memory Tools
Tool | Description |
| Begin a work session (returns session ID) |
| Close session, store summary |
| Recall session details including decisions, errors, changelog |
| Log a decision with rationale and tags |
| Log/update a convention (design token, pattern, style, naming) |
| Record an error with signature and resolution |
| Upsert current focus/task by key |
| Read current focus by key |
| Append changelog entry |
| Add a roadmap item |
| Change plan item status |
| Create a task, optionally linked to a plan |
| Change task status |
| Unified search across decisions/conventions/errors/changelog |
Knowledge Graph Tools
Tool | Description |
| Add entity (deduped on name+type) |
| Link two entities with a typed relation |
| Attach a fact to an entity |
| Query entities, relations, observations |
Specs Tools
Tool | Description |
| Store a long-form document |
| Retrieve by ID or exact title |
| Update content/title, auto-bumps version |
Code Graph Tools
Tool | Description |
| Walk workspace, extract symbols + edges via ts-morph (JS/TS) |
| Look up a symbol's callers/callees/imports (1-hop) |
| BFS from entry symbol, bounded subgraph with optional traces + annotations |
| Attach narrative text to a symbol or trace |
Architecture
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.mdSchema (15 tables)
Memory (8):
sessions,decisions,conventions,errors,context,changelog,plan,tasksKnowledge Graph (3):
entities,relations,observationsSpecs (1):
specsCode Graph (4):
symbols,edges,execution_traces,codemap_annotations
Pragmas
Set on every connection open:
PRAGMA journal_mode = WAL;
PRAGMA foreign_keys = ON;Development
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 scriptLicense
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