MCP server with local vector search for your codebase. Smart indexing, semantic search, Git history — all offline.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"code-memory": {
"args": [
"code-memory"
],
"command": "uvx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
MCP server with local vector search for your codebase. Smart indexing, semantic search, Git history — all offline.
This server supports HTTP transport. Be the first to test it — help the community know if it works.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked code-memory against OSV.dev.
Click any tool to inspect its schema.
This server is missing a description.If you've used it, help the community.
Add informationBe the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in search
Web and local search using Brave Search API
Production ready MCP server with real-time search, extract, map & crawl.
Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors
mini cli search engine for your docs, knowledge bases, meeting notes, whatever. Tracking current sota approaches while being all local
MCP Security Weekly
Get CVE alerts and security updates for Code Memory and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A deterministic, high-precision code intelligence layer exposed as a Model Context Protocol (MCP) server.
uvx code-memory and you're readyPlease help star code-memory if you like this project!
Finding the right context from a large codebase is expensive, inaccurate, and limited by context windows. Dumping files into prompts wastes tokens, and LLMs lose track of the actual task as context fills up.
Instead of manually hunting with grep/find or dumping raw file text, code-memory runs semantic searches against a locally indexed codebase. Inspired by claude-context, but designed from the ground up for large-scale local search.
Full AST Support (structural parsing with symbol extraction): Python, JavaScript/TypeScript, Java, Go, Rust, C/C++, Ruby, Kotlin
Fallback Support (whole-file indexing): C#, Swift, Scala, Lua, Shell, Config (yaml/toml/json), Web (html/css), SQL, Markdown
Files matching
.gitignorepatterns are automatically skipped.
Instead of a single monolithic search, code-memory routes queries through three purpose-built tools:
| Question Type | Tool | Data Source |
|---|---|---|
| "Where / What / How?" — find definitions, references, structure, semantic search | search_code | BM25 + Dense Vector (SQLite vec) |
| "Architecture / Patterns" — understand architecture, explain workflows | search_docs | Semantic / Fuzzy |
| "Who / Why?" — debug regressions, understand intent | search_history | Git + BM25 + Dense Vector (SQLite vec) |
| "Setup / Prepare" — index parsing & embedding generation | index_codebase | AST Parser + sentence-transformers |
This forces the LLM to pick the right retrieval strategy before any data is fetched.
# Install with pip
pip install code-memory
# Or with uvx (for MCP hosts)
uvx code-memory
# Clone the repo
git clone https://github.com/kapillamba4/code-memory.git
cd code-memory
# Install dependencies
uv sync
# Run the MCP server (stdio transport)
uv run mcp run code_memory/server.py
Download standalone executables from GitHub Releases — no Python installation required.
| Platform | Architecture | File |
|---|---|---|
| Linux | x86_64 | code-memory-linux-x86_64 |
| macOS | x86_64 (Intel) | code-memory-macos-x86_64 |
| macOS | ARM64 (Apple Silicon) | code-memory-macos-arm64 |
| Windows | x86_64 | code-memory-windows-x86_64.exe |
# Linux/macOS: Download and make executable
chmod +x code-memory-*
./code-memory-*
# Windows: Run directly
code-memory-windows-x86_64.exe
Note: The first run will download the embedding model (~600MB) to ~/.cache/huggingface/. Subsequent runs use the cached model.
uv package manager (recommended) or pipInstall uv if you don't have it:
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install from PyPI
pip install code-memory
#
... [View full README on GitHub](https://github.com/kapillamba4/code-memory#readme)