Code MemorySAFE
MCP server with local vector search for your codebase. Smart indexing, semantic search, Git history — all offline.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](#privacy--security) [](#why-code-memory) [](#air-gapped--offline-support)
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 .gitignore patterns are automatically skipped.Architecture: Progressive Disclosure
Instead of a single monolithic search, code-memory routes queries through three purpose-built tools:
c7ad3ab668f6OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add code-memory -- None code-memory==1.0.33
Exposed tools (7)
7 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
check_index_status | read | USE THIS TOOL to check if the codebase has been indexed and whether search tools will return results. Call this BEFORE search_code or search_docs if you |
find_dead_code | read | USE THIS TOOL to find functions, methods, and classes that look like dead code (defined but never called). |
get_index_stats | read | USE THIS TOOL to get comprehensive statistics about the code index. |
index_codebase | read | YOU MUST CALL THIS TOOL FIRST before using search_code or search_docs. Use this tool to build the searchable index that powers all other code intelligence features. |
search_code | read | USE THIS INSTEAD OF grep/glob/find for ANY code search. This tool provides SEMANTIC code understanding - it finds related concepts, not just text matches. |
search_docs | read | USE THIS TOOL for conceptual understanding and |
search_history | read | USE THIS TOOL for Git history queries: understanding WHY changes were made, debugging regressions, or finding commit context. This tool operates on the local Git repository. |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (5)
The server listens on `http://127.0.0.1:8765/sse` by default.
"url": "http://127.0.0.1:8765/sse"
"url": "http://127.0.0.1:8765/sse"
"url": "http://127.0.0.1:8765/sse"
curl -LsSf https://astral.sh/uv/install.sh | sh
Gates applied: no_behavioural_pass.
c7ad3ab668f6full audit observations/trust-audit/mcp-server/kapillamba4__code-memory-1.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | c7ad3ab668f6 | SAFE | B | 89 | first audit |
Questions
What is the Code Memory MCP server?
MCP server with local vector search for your codebase. Smart indexing, semantic search, Git history — all offline.
What tools does Code Memory expose?
7 in total: 7 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Code Memory safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Code Memory need?
No credential environment variables were found in its source, so it appears to need none.
How does Code Memory run?
It speaks sse and stdio, so it runs as a local process your client starts. It is published on PyPI as code-memory.
How current is this page?
The grade is for one exact copy of the source (c7ad3ab668f6), read on 2026-10-08. The repository is watched and re-audited when it changes.