CogniRepo is an MCP server that indexes a local codebase to provide persistent memory, semantic search, an AST-based symbol reverse index, and a knowledge graph for AI coding tools. It supports offline indexing and retrieval across sessions, with optional model-based querying only when API keys are provided.
From the registry: FAISS, call graph, AST, BM25 — 34 MCP tools for AI agents. 50-80% token reduction. Offline.

$ pip install pipx --userhttps://pypa.github.io/pipx/$ pipx install cognirepohttps://pypi.org/project/cognirepo/$ cognirepo init --no-index && cognirepo index-repo .Please install the `cognirepo` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Install Python 3.11+** — Python 3.11 or newer is required to run CogniRepo. (https://www.python.org/downloads/)
- **Install pipx** — The README recommends installing CogniRepo with pipx for the simplest and most portable setup. Run: `pip install pipx --user` (https://pypa.github.io/pipx/)
- **Install CogniRepo** — Install the CogniRepo CLI globally using pipx. Run: `pipx install cognirepo` (https://pypi.org/project/cognirepo/)
- **Initialize and index your project** — Before MCP tools return data, initialize CogniRepo in the target project and complete indexing. The README states first-time setup must complete before MCP tools work. Run: `cognirepo init --no-index && cognirepo index-repo .`
Optional prerequisites:
- Optional API key for cognirepo ask only — API keys are optional for MCP usage and indexing. They are only needed for the separate `cognirepo ask` feature.
Canonical MCP server config (stdio transport):
- command: `cognirepo`
- args: ["serve","--project-dir","<absolute-path-to-project>"]
- optional environment variables:
- `ANTHROPIC_API_KEY`: Optional API key for the `cognirepo ask` feature; not required for MCP tools or indexing. (example: `<your-anthropic-api-key>`)
- `GEMINI_API_KEY`: Optional API key for the `cognirepo ask` feature; not required for MCP tools or indexing. (example: `<your-gemini-api-key>`)
- `OPENAI_API_KEY`: Optional API key for the `cognirepo ask` feature; not required for MCP tools or indexing. (example: `<your-openai-api-key>`)
- `GROK_API_KEY`: Optional API key for the `cognirepo ask` feature; not required for MCP tools or indexing. (example: `<your-grok-api-key>`)
Note: The README provides a project-scoped stdio MCP command using `cognirepo serve --project-dir <project>`. It also notes that `cognirepo setup` can auto-configure clients, but the canonical MCP shape is the stdio command above. MCP tools work fully offline after project initialization and indexing.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.ANTHROPIC_API_KEYrequiredOptional API key used only for `cognirepo ask` with Anthropic modelsGEMINI_API_KEYrequiredOptional API key used only for `cognirepo ask` with Gemini modelsOPENAI_API_KEYrequiredOptional API key used only for `cognirepo ask` with OpenAI modelsGROK_API_KEYrequiredOptional API key used only for `cognirepo ask` with Grok modelsMCP server for searching Airweave collections with natural language queries.