CogMemory MCP Server β Unified context subsystems for AI coding agents
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A unified Model Context Protocol server providing four context subsystems for AI coding agents:
Storage: SQLite via better-sqlite3. One .db file per scope.
Option A β npx (recommended, always latest):
Option B β Global install:
Option C β pnpm dlx:
Option D β From source (developers):
CogMemory depends on better-sqlite3 and tree-sitter, which compile native modules on install. You need:
node-gyp)gcc/g++ on Linux, Xcode Command Line Tools on macOS, Visual Studio Build Tools on Windows)make (Linux/macOS, installed by default)Most platforms have prebuilt binaries available, so compilation is usually skipped on:
If installation fails, see Troubleshooting below.
Add to .vscode/mcp.json (workspace-scoped):
Or use --workspace for multi-root support:
Add to .cursor/mcp.json:
Add to ~/.config/claude/claude_desktop_config.json (Linux/macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Add to ~/.claude/mcp.json (user-level) or .claude/mcp.json (project-level):
In the Cline extension settings, add an MCP server:
cogmemorynpx -y cogmemory-mcp@latestOr in cline_mcp_settings.json:
MCP settings β Add server:
Add to opencode.json:
Add to Zed settings (settings.json):
CogMemory is published to the MCP Registry. Registry-aware clients can discover and install it automatically.
CogMemory resolves scope in priority order:
.cogmemory/config.json in workspace root:
Environment variable: COGMEMORY_SCOPE=global
Default: workspace
| Scope | Database Path |
|---|---|
| workspace | <workspace_root>/.cogmemory/memory.db |
| global | ~/.cogmemory/global.db |
CogMemory resolves the workspace root (where .cogmemory/memory.db lives) in this priority order:
--workspace <path> CLI argument (highest priority)COGMEMORY_WORKSPACE environment variable.cogmemory/ directoryCogMemory uses a versioned migration system. When a new version adds columns or tables, migrations run automatically on the next server startup β no manual action needed.
If you are upgrading from a version prior to v1.1.0 that used the old schema:
<db_path>.backup-pre-migrate-<timestamp>cp memory.db.backup-* memory.dbCOGMEMORY_SKIP_BACKUP=1 to skip the backup (e.g., in CI or disk-constrained environments)By default, CogMemory checks the npm registry once every 24 hours to see if a newer version is available (via the check_for_updates tool). This makes a read-only HTTPS GET to registry.npmjs.org β the same call your package manager makes.
To disable this check:
COGMEMORY_DISABLE_UPDATE_CHECK=1{ "disable_update_check": true } to .cogmemory/config.json| Tool | Description |
|---|---|
start_session | Begin a work session (returns session ID) |
end_session | Close session, store summary |
get_session_summary | Recall session details including decisions, errors, changelog |
remember_decision | Log a decision with rationale and tags |
remember_convention | Log/update a convention (design token, pattern, style, naming) |
log_error | Record an error with signature and resolution |
set_active_context | Upsert current focus/task by key |
get_active_context | Read current focus by key |
log_change | Append changelog entry |
add_plan_item | Add a roadmap item |
update_plan_status | Change plan item status |
create_task | Create a task, optionally linked to a plan |
update_task_status | Change task status |
recall | Unified search across decisions/conventions/errors/changelog |
| Tool | Description |
|---|---|
create_entity | Add entity (deduped on name+type) |
create_relation | Link two entities with a typed relation |
add_observation | Attach a fact to an entity |
search_knowledge | Query entities, relations, observations |
| Tool | Description |
|---|---|
create_spec | Store a long-form document |
get_spec | Retrieve by ID or exact title |
update_spec | Update content/title, auto-bumps version |
| Tool | Description |
|---|---|
index_codebase | Walk workspace, extract symbols + edges (JS/TS via ts-morph, Python via tree-sitter) |
query_code_graph | Look up a symbol's callers/callees/imports (1-hop) |
generate_codemap | BFS from entry symbol, bounded subgraph with optional traces + annotations |
annotate_symbol | Attach narrative text to a symbol or trace |
| Tool | Description |
|---|---|
cogmemory_status | Show runtime config: package version, schema version, db path, workspace root, scope, index coverage, and subsystem counts |
check_for_updates | Check if a newer version is available on npm (HTTPS GET to registry, cached 24h) |
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/cogmemory-mcp)<a href="https://allmcps.com/mcp/cogmemory-mcp"><img src="https://allmcps.com/api/badge/cogmemory-mcp?style=directory" alt="Cogmemory MCP on AllMCPs" /></a>