Cogmemory MCP logo

Cogmemory MCP

Stores coding context, project knowledge, specifications, and code-graph data in a scoped SQLite database.

Install Cogmemory MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "cogmemory-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "cogmemory-mcp@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y cogmemory-mcp@latest

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The cogmemory-mcp MCP server gives AI coding agents persistent memory, project knowledge, specifications, and static code-graph tools. It stores data in SQLite and resolves project scope from workspace configuration, an environment variable, or defaults. Use it when agents need to retain decisions, conventions, errors, plans, and code relationships across sessions. It runs as a local stdio process through package runners such as npx, pnpm dlx, or a global npm install.

Use cases

  • Persist decisions and conventions across coding sessions
  • Track errors, resolutions, tasks, and implementation plans
  • Query callers, callees, imports, and code symbols
  • Store and retrieve project specifications
  • Find dead code and duplicate symbols

Key features

  • Persistent SQLite-backed coding memory
  • Knowledge graph for entities and relations
  • Long-form specification storage
  • Static JavaScript, TypeScript, and Python code graphs
  • TF-IDF semantic code search
  • Dead-code and duplicate-symbol analysis

Tools44

What Cogmemory MCP lets your agent do. Expand a tool for its parameters.

Self-reported~787 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

17/17 checks healthy over the last 84d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 15d ago via OSV.dev · cogmemory-mcp@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads326Package downloads in the last 30 days.
Last commit1mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed44Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Cogmemory MCP works

What cogmemory-mcp does

The cogmemory-mcp MCP server provides four related context subsystems for coding agents. Its memory features record sessions, decisions, conventions, errors, active work, changelog entries, plans, and tasks. The knowledge graph stores named entities, typed relationships, and observations, while the specs subsystem keeps longer documents such as requirements or design material.

The code graph represents symbols and structural edges extracted from JavaScript, TypeScript, and Python workspaces. Agents can inspect callers, callees, and imports, generate bounded subgraphs from an entry symbol, and attach narrative annotations to symbols or execution traces. Additional analysis tools provide ranked code search, dead-code detection, and duplicate-symbol detection.

How it works

Storage uses SQLite through better-sqlite3. By default, each clone receives its own project identity and database under ~/.cogmemory/projects/. A workspace configuration can instead select a database inside the repository, while global scope uses ~/.cogmemory/global.db. Project identity is based on an opaque ID in .cogmemory/config.json, so moving or renaming a workspace does not change which memories belong to it.

Scope resolution checks workspace configuration first, then COGMEMORY_SCOPE, then user-level configuration, and finally the project default. The server can also switch its active project at runtime by receiving an absolute workspace root. Its status tool reports configuration, database, workspace, scope, index coverage, and subsystem counts.

Setup and configuration

Install the cogmemory-mcp MCP server with npx -y cogmemory-mcp@latest, install it globally with npm, use pnpm dlx, or build it from source with pnpm. Standard client configuration starts the command as a local stdio MCP server. The README provides configuration examples for VS Code, Cursor, Claude Desktop, Claude Code, Cline, Windsurf, and Zed.

Native dependencies may need Python 3, a C/C++ compiler, and make for better-sqlite3 and tree-sitter. Prebuilt binaries are available for common Linux, macOS, and Windows architectures, so compilation is often skipped.

To target a monorepo sub-root, pass --workspace with the intended absolute path. Otherwise, the server discovers a project from the Git root, a parent containing .cogmemory, or the current working directory. Keep .cogmemory/config.json gitignored unless intentionally sharing the project identity.

Tools and capabilities

  • Start and close sessions, then retrieve summaries containing decisions, errors, and changelog information.
  • Record decisions, conventions, errors, active context, changes, plans, and task status.
  • Search stored decisions, conventions, errors, and changelog entries with recall.
  • Create and query entities, relations, and observations in the knowledge graph.
  • Create, retrieve, and version long-form specifications.
  • Index JavaScript, TypeScript, and Python code, then query symbol relationships.
  • Generate code maps, annotate symbols, search code semantically, find dead code, and detect duplicates.

Limitations and notes

The code index is static: JavaScript and TypeScript use ts-morph, while Python uses tree-sitter. Code-graph queries are limited to one-hop caller, callee, and import relationships; generated maps are bounded subgraphs. Semantic code search is TF-IDF based rather than a separately documented embedding service.

The update-check tool contacts the npm registry over HTTPS and caches results for 24 hours. Database isolation depends on scope and project configuration, so clients working across repositories should verify cogmemory_status and use project switching when a pinned workspace does not match the active repository.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Cogmemory MCP

cogmemory-mcp is an MCP server that connects AI coding agents to SQLite-backed project context. Its main tools manage sessions, decisions, conventions, errors, tasks, knowledge-graph records, specifications, and static code graphs, including symbol queries, semantic search, dead-code detection, and duplicate detection.

Install it with `npx -y cogmemory-mcp@latest`. You can also install it globally with npm, run it through `pnpm dlx`, or clone the repository and build it with pnpm. Native builds may require Python 3, a C/C++ compiler, and `make`.

Yes, cogmemory-mcp works with Cursor through a local stdio configuration in `.cursor/mcp.json`. Add a server entry whose command is `npx` and whose arguments run `-y cogmemory-mcp@latest`.

By default, it stores a clone-specific SQLite database under `~/.cogmemory/projects/`. You can select workspace scope for `<workspace_root>/.cogmemory/memory.db` or global scope for `~/.cogmemory/global.db` through configuration or `COGMEMORY_SCOPE`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCogmemory MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/cogmemory-mcp?style=directory)](https://allmcps.com/mcp/cogmemory-mcp)
HTML Embed
<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>