# CogniRepo

Local MCP server providing persistent memory and AST code indexing for coding agents. It retains context and speeds up symbol lookups across sessions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 15
- Author: ashlesh-t
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ashlesh-t/cognirepo
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/cognirepo

## What it does

CogniRepo adds persistent storage and repository structure directly to coding assistants. It uses FAISS vector search for architecture notes alongside NetworkX graphs for call relationships. AST indexing finds function and class definitions without slow text scans. Everything runs locally on your machine.

The server keeps an append-only event log. It also logs recurring errors so agents avoid repeating known mistakes. Context stays intact when you switch agents or begin a new chat.

Running it requires Python 3.11+ and the `uvx` runner. On smaller repositories, schema definitions for 36 tools consume ~3,700 tokens, which can exceed the savings from targeted lookups. Break-even arrives after roughly 4 tool calls.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add cognirepo -- uvx cognirepo
```
uvx runs the command named after the package; if the README names another one, use uvx --from cognirepo <command>

### Codex

**Platform CLI**
```bash
codex mcp add cognirepo -- uvx cognirepo
```
uvx runs the command named after the package; if the README names another one, use uvx --from cognirepo <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cognirepo": {
            "command": "uvx",
            "args": [
                "cognirepo"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from cognirepo <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cognirepo": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "cognirepo"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from cognirepo <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add cognirepo uvx cognirepo
```
uvx runs the command named after the package; if the README names another one, use uvx --from cognirepo <command>

## When to use it
- locate symbol definitions via AST indexing
- persist architectural decisions across agent sessions
- share codebase context between different coding tools
- prevent repeated coding mistakes using error logs

## Example prompts
- Find where `DatabaseSession` is defined and show its call graph
- Record our decision to adopt background worker queues
- Check the error history to see why the test run failed

## Similar
- [telemem](https://affpapa.org/en/nevibecode/mcp/telemem.md) — MCP server · ★ 494
- [coldstart](https://affpapa.org/en/nevibecode/mcp/coldstart.md) — MCP server · ★ 11
- [tooluniverse](https://affpapa.org/en/nevibecode/mcp/tooluniverse.md) — MCP server · ★ 1760
- [Local FAISS MCP Server](https://affpapa.org/en/nevibecode/mcp/local-faiss-mcp-server.md) — MCP server · ★ 36
- [velocirag](https://affpapa.org/en/nevibecode/mcp/velocirag.md) — MCP server · ★ 12
- [ast-grep-outline](https://affpapa.org/en/nevibecode/skills/ast-grep-outline.md) — skill · 2400 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
