CogniRepo logo

CogniRepo

Offline codebase indexing and persistent project memory for AI coding tools through MCP.

Install CogniRepo

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

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "cognirepo": {
      "command": "uvx",
      "args": [
        "cognirepo"
      ]
    }
  }
}

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.

uvx cognirepo

Process exited before answering 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

CogniRepo MCP server indexes a codebase into searchable symbols, AST data, call relationships, embeddings, and project memory. It runs locally and provides MCP tools for semantic retrieval, symbol lookup, session history, error tracking, decisions, and architectural context. No API key is needed for indexing or MCP tools; optional provider keys are only used by the separate ask command. Reach for it on medium or large repositories when persistent context across AI sessions matters more than one-shot file retrieval.

Use cases

  • Index large Python repositories for AI-assisted code navigation
  • Retrieve architectural notes and past decisions across sessions
  • Share project context between Claude, Gemini, and Cursor workflows
  • Track recurring errors and prevention hints
  • Query call relationships, imports, and inheritance chains

Key features

  • AST-based symbol lookup
  • FAISS and BM25 retrieval
  • Persistent session and episodic memory
  • Knowledge graph for code relationships
  • Local architectural summaries
  • Cross-agent context handoff

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.

18/19 checks healthy over the last 112d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · cognirepo (PyPI)

Adoption & maintenance

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

GitHub stars16Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How CogniRepo works

What CogniRepo MCP server does

CogniRepo MCP server gives AI coding tools a persistent local context layer for software repositories. It combines several representations of a codebase: an AST-based symbol index, a NetworkX knowledge graph, FAISS vector search, BM25 retrieval, episodic events, and stored conversation context. These stores support both code navigation and project memory rather than only returning matching files.

The system can retain architecture notes, decisions, errors and prevention hints, user preferences, and previous session exchanges. It also builds a local summary hierarchy from files to directories to the repository and makes those summaries available for semantic search. Shared state lets different connected AI tools use the same accumulated project knowledge.

How it works

Initialize a repository, create its local CogniRepo data, and run an index before connecting MCP clients. The index records symbols, imports, inheritance, calls, files, and concepts. Symbol lookup uses the reverse index for fast file-and-line results, while semantic and lexical searches retrieve broader context. A background watcher can keep the index updated after the initial scan.

The architecture is local and CPU-oriented by default. Embeddings use fastembed and ONNX without requiring PyTorch or CUDA. Architectural summaries are generated from the local AST index, so that operation does not require an external model API. The project also describes an optional orchestration path that classifies query complexity, assembles context, and routes requests to models such as Claude or Gemini Flash; provider credentials are relevant to that workflow, not to indexing or the MCP tools themselves.

Setup and configuration

Python 3.11 or newer is required. The recommended installation is:

bash
pipx install cognirepo

A virtual environment installation is also documented with pip install cognirepo. Run cognirepo setup for onboarding, including initialization, indexing, and automatic MCP configuration for supported local clients. For manual setup, use cognirepo init --no-index, then cognirepo index-repo .. The --daemon option starts a background watcher during indexing.

Use cognirepo status to inspect symbol and graph counts, and cognirepo doctor for a health check. Optional provider keys include ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY, and GROK_API_KEY; they are needed only for cognirepo ask. No credentials are required for repository indexing, memory features, or MCP access.

Tools and capabilities

The MCP interface covers capabilities including:

  • Fast symbol-to-file-and-line lookup
  • Semantic retrieval over code, summaries, notes, and decisions
  • Graph queries for imports, inheritance, calls, and repository relationships
  • Persistent session and episodic event storage
  • Error recording with prevention guidance
  • User behavior profile retrieval
  • Architectural decision recording
  • Cross-tool context handoff through shared local state

CogniRepo MCP server is most appropriate for repositories around 15,000 lines of code or larger. On smaller projects, native file reads may be faster because the MCP schema itself adds context overhead.

Limitations and notes

Results are strongest on Python projects with relatively clear static structure. Dynamic dispatch, plugin registries, deep asynchronous patterns, Ansible variable precedence, and incomplete Go grammar support can reduce retrieval confidence. The project states that it reports uncertainty instead of fabricating call chains.

The reported token savings and lookup timings come from the project's benchmarks and vary by repository and task. Complex dynamic codebases show smaller gains than straightforward Python repositories. CogniRepo MCP server is offline for indexing and MCP operations, but optional model-based commands can require a user's provider API key. The repository is released under the MIT license.

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 CogniRepo

Install the PyPI package with `pipx install cognirepo`, or install it inside a virtual environment with `pip install cognirepo`.

No API key is required for indexing, memory features, or MCP tools. Provider keys are optional and only needed for `cognirepo ask`.

The setup command also documents automatic MCP configuration for Claude, Cursor, and VS Code.

Run `cognirepo init --no-index`, followed by `cognirepo index-repo .`. The `cognirepo setup` command can perform onboarding and indexing automatically.

It is intended mainly for codebases around 15,000 lines or larger. On smaller repositories, native file reads may outweigh the benefit because of MCP tool-schema overhead.

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 PreviewCogniRepo AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/cognirepo?style=directory)](https://allmcps.com/mcp/cognirepo)
HTML Embed
<a href="https://allmcps.com/mcp/cognirepo"><img src="https://allmcps.com/api/badge/cognirepo?style=directory" alt="CogniRepo on AllMCPs" /></a>