
Code Memory
io.github.kapillamba4Published by GitHub account kapillamba4v1.0.33Updated Oct 25, 2026
Local semantic code search with Git history. Works offline, no API key needed.
The publisher's own server: Memory.fit
Overview
A local MCP server that indexes a codebase and lets an assistant run semantic code, documentation and Git history searches offline.
- What you can do
- Index source files and docs in a directory, building a local SQLite vector index with tree-sitter parsing and local embeddings, and re-index after changes or model switches. Search code semantically or structurally for definitions, references, call graphs and file structure using hybrid BM25 plus vector retrieval. Search documentation, READMEs and extracted docstrings to explain architecture and workflows. Search Git history for commits, per-file history and blame to trace regressions and intent.
- When to use it
- Useful when an assistant needs to work in a large or unfamiliar repository and you want precise retrieval instead of pasting whole files, and when code must stay on the machine, including offline or air-gapped setups.
- Requirements
- Runs locally over stdio. Needs Python 3.13 or newer with uv or pip, or a standalone binary from GitHub Releases. The first run downloads an embedding model of about 600MB to the Hugging Face cache; the loaded model needs roughly 1GB of RAM. Optional environment variables CODE_MEMORY_LOG_LEVEL and EMBEDDING_MODEL. Git history search requires a Git repository. No API key.
Installation
In SourceWeft
- Open Code Memory in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
code-memory
[code-memory logo][Zero Telemetry] [No API Key] [Offline First]
A deterministic, high-precision code intelligence layer exposed as a Model Context Protocol (MCP) server.
- Zero telemetry — your code never leaves your machine
- No API key required — runs entirely locally with sentence-transformers
- 1 min setup — just
uvx code-memoryand you're ready - Token saving by 50% — precise code retrieval instead of dumping entire files
Please help star code-memory if you like this project!
Why code-memory?
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.
Supported Languages
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.
Architecture: Progressive Disclosure
Instead of a single monolithic search, code-memory routes queries through three purpose-built tools:
This forces the LLM to pick the right retrieval strategy before any data is fetched.
Installation
From PyPI (Recommended)
From Source
Pre-built Binaries (Standalone)
Download standalone executables from GitHub Releases — no Python installation required.
Note: The first run will download the embedding model (~600MB) to ~/.cache/huggingface/. Subsequent runs use the cached model.
Quickstart
Prerequisites
- Python ≥ 3.13
uvpackage manager (recommended) or pip
Install uv if you don't have it:
Install & Run
Development
Configure Your MCP Host
You can use either uvx (requires Python) or the standalone binary (no dependencies).
Using uvx (Python required)
Gemini CLI / Gemini Code Assist
Add to your MCP settings (e.g. ~/.gemini/settings.json):
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Claude Code (CLI)
Add to .mcp.json in your project root or ~/.mcp.json for global access:
VS Code (Copilot / Continue)
Add to .vscode/mcp.json in your workspace:
Using Standalone Binary (No Python required)
Replace the path with the location of your downloaded binary:
For Windows:
Shared SSE Server (Reduce Memory Usage)
By default, each MCP host project launches its own code-memory process, which loads the embedding model (~1–2 GB) once per project. To avoid this, you can run a single shared instance over SSE (Server-Sent Events) and point all your MCP hosts at it.
Start the shared server
The server listens on http://127.0.0.1:8765/sse by default.
Configure MCP hosts to use the shared server
Instead of launching a new process, point your MCP host at the running SSE endpoint.
Claude Desktop
VS Code (Copilot / Continue)
Claude Code (CLI) — .mcp.json
Tip: Configure
uvx code-memory --transport sseto start via a single-instance service manager (e.g. systemd user service, launchd agent, or another one-time login/startup mechanism) so the shared server starts automatically.
Security: The SSE endpoint is unauthenticated. Keep the default
--host 127.0.0.1so only local processes can connect; do not bind to0.0.0.0or a public interface unless you've put authentication in front of it.
Configuration
CLI Options
Environment Variables
Example:
Custom Embedding Model
You can use a different embedding model by setting the EMBEDDING_MODEL environment variable:
For MCP hosts, add the environment variable to your configuration:
Note: Changing the embedding model will invalidate existing indexes. You'll need to re-run
index_codebaseafter switching models.
Tools
index_codebase
Indexes or re-indexes source files and documentation in the given directory. Run this before using search_code or search_docs to ensure the database is up to date. Uses tree-sitter for language-agnostic structural extraction and generates dense vector embeddings using sentence-transformers (runs locally, in-process) for semantic search.
search_code
Perform semantic search and find structural code definitions, locate where functions/classes are defined, or map out dependency references (call graphs). Uses hybrid retrieval (BM25 + vector embeddings) to find exact matches and semantic similarities.
search_docs
Understand the codebase conceptually — how things work, architectural patterns, SOPs. Searches markdown documentation, READMEs, and docstrings extracted from code.
search_history
Debug regressions and understand developer intent through Git history.
Project Structure
Troubleshooting
"Git repository not found" error
Make sure you're running search_history from within a git repository. The tool searches upward from the current directory to find .git.
Empty search results
Run index_codebase(directory=".") first to index your code and documentation. The index is stored locally in code_memory.db.
Slow indexing
Indexing generates embeddings using a local sentence-transformers model. The first run downloads the model (~600MB for jina-code-embeddings-0.5b). Subsequent runs are faster.
Embedding model errors
Ensure you have enough disk space and memory. The jina-code-embeddings-0.5b model requires ~1GB RAM when loaded.
Privacy & Security
Your code never leaves your machine. Unlike cloud-based code intelligence tools, code-memory runs entirely locally:
- Zero telemetry — no usage data, analytics, or tracking
- Zero external API calls — all processing happens in-process
- Zero cloud dependencies — works without internet (after initial setup)
- Your data stays local — indexes stored in local SQLite database
This makes code-memory ideal for:
- Proprietary and confidential codebases
- Security-conscious organizations
- Air-gapped development environments
- Privacy-focused developers
See COMPARISON.md for a detailed comparison with cloud-based alternatives.
Air-gapped & Offline Support
code-memory works in completely isolated environments:
Method 1: Pre-built Binary + Cached Model
-
On a connected machine, run code-memory once to cache the embedding model:
-
Transfer to air-gapped machine:
- Standalone binary from GitHub Releases
- Model cache directory (
~/.cache/huggingface/hub/models--*)
-
Run on air-gapped machine — no network required.
Method 2: Offline pip Install
- Download the wheel from PyPI on a connected machine
- Transfer and install:
pip install code-memory-*.whl - Pre-cache the model as above
- Run offline
Roadmap
- Milestone 1 — Project scaffolding & MCP protocol wiring
- Milestone 2 — Implement
search_codewith AST parsing + SQLite +sqlite-vec - Milestone 3 — Implement
search_historywith Git integration - Milestone 4 — Implement
search_docswith semantic search - Milestone 5 — Production hardening & packaging
Contributing
See CONTRIBUTING.md for development setup and guidelines.
Changelog
See CHANGELOG.md for version history.
License
MIT
Source: README.md at commit 5a8db16
Tools
0Version history
1- v1.0.33LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Other Memory integrations

Memory.fit
fit.memoryOfficial publisher
Hosted Memory.fit server that lets an AI read your training, sleep, recovery and nutrition data and write back weekly plans, targets and meal plans.
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pgOfficial publisher
pg.ddx.io: the PostgreSQL community's memory's hosted MCP server, published by pg.ddx.io; no sign-in required; Streamable HTTP; 29 tools.
var.gg Naming Memory
gg.varOfficial publisher
Remote MCP server that suggests and searches code identifier names from domain concepts in Korean, Japanese, Chinese, Vietnamese and English, and exposes ERD…

Counterparts
ai.counterparts
Local-first long-term memory for Claude Code and Claude Desktop: the assistant writes notes about you and your projects and recalls them in later sessions.

LAHZE - Persian AI Memory Platform
Published by GitHub account pedramgholizadeh
LAHZE - Persian AI Memory Platform's hosted MCP server; no sign-in required; Streamable HTTP; 13 tools.