Semantic codebase search + persistent working memory for AI code editors. Local, zero-config, MCP. No API key.
claude mcp add vectr -- python -m vectr{
"mcpServers": {
"vectr": {
"command": "python",
"args": ["-m", "vectr"]
}
}
}MCP Servers overview
<!-- mcp-name: io.github.swapnanil/vectr -->
<p align="center">
<img src="https://raw.githubusercontent.com/swapnanil/vectr/main/assets/banner.svg" alt="vectr — semantic codebase search + persistent working memory for AI code editors" width="560">
</p>
# Vectr
> **Semantic search and persistent memory for AI code editors.**
[](https://github.com/swapnanil/vectr/actions/workflows/ci.yml)
[](LICENSE)
[](https://www.python.org/downloads/)
[](CHANGELOG.md)
[](#19-mcp-tools)
Version 1.5.0 · Last updated 2026-07-23 · [CHANGELOG](CHANGELOG.md)
Vectr gives AI code editors two things they lack: **semantic codebase search** and **persistent working memory** — both served over MCP with zero configuration.
Your AI editor forgets everything. Vectr doesn't.
---
## The problem
Every time an AI code editor starts a task, it re-reads the same files it read yesterday. On an unfamiliar codebase it runs ripgrep, reads entire files hunting for the right function, and fills its context window with noise. In a long session it loses findings from turn 1 by turn 40. Across sessions it starts over from zero.
Vectr breaks the re-discovery loop:
- **One index** → semantic search over your whole codebase in <20ms
- **One recall call** → structured notes from any prior session, verbatim, in <50ms
- **Survives `/compact`** → notes are persisted to disk, not stored in context
**Measured, not hypothetical:** recalling 3 stored notes with `vectr_recall` costs 360 tokens in one tool call. Re-deriving the same three facts with grep + Read costs ~2,060 tokens across six tool calls on the same 182-file Python repo — **~5.7× fewer tokens, 6× fewer tool calls**, in under 50ms (chars/4 tokenization; full breakdown in [Measured costs, honestly](#measured-costs-honestly)). Across a 6-task CPython sprint measuring real Read+Bash calls, that recall discipline cut re-discovery by **39% overall**, with per-task reductions ranging **0%–85%** depending on how unfamiliar the code was to the model (the 0% task is one the model could already navigate from training — see [When vectr can hurt](#when-vectr-can-hurt)).
Notes are persisted to disk, not held in the conversation — they survive `/compact` and a fresh session equally; the session boundary doesn't matter.
**No API key required.** The embedding model runs locally.
---
## Benchmarks — CPython internals sprint (6 tasks, 2 agents)
The benchmark simulates a week of feature work on an unfamiliar C codebase (CPython internals). One research session stores findings with `vectr_remember`; six isolated implementation sessions each open cold and call `vectr_recall`.
**Implementation sessions only — 6 tasks combined:**
| Metric | Vanilla | Vectr | Delta |
|---|---|---|---|
| Cost | $2.50 | $1.97 | **−21%** |
| Wall time | 17.6 min | 13.5 min | **−24%** |
| Turns | 123 | 94 | **−24%** |
| Read + Bash calls | 102 | 62 | **−39%** |
**Per-task re-discovery (Read+Bash before first write):**
| Task | Vanilla | Vectr | Delta |
|---|---|---|---|
| `debug_gc_finalizer` | 16 | 6 | −62% |
| `feature_dict_pop_last` | 13 | 3 | −77% |
| `cross_session_set_cartesian` | 23 | 9 | −61% |
| `debug_descriptor_priority` | 6 | 6 | 0% |
| `cross_session_bytes_find_all` | 13 | 2 | −85% |
| `cross_session_list_rotate` | 21 | 16 | −24% |
**Research vs implementation cost breakdown:**
The research phase (paid once to build notes) costs more for vectr (+94%) because it stores rich code stubs and function signatures via `vectr_remember`. The implementation phases (which repeat every task) cost less because `vectr_recall` replaces file re-discovery. The research overhead breaks even after ~8 tasks of note reuse.
| Phase | Vanilla | Vectr | Why |
|---|---|---|---|
| Research (1 session, paid once) | $1.36 | $2.63 | Vectr stores notes — more output tokens |
| Impl (6 sessions, repeating) | $2.50 | $1.97 | Notes replace re-discovery |
| Total sprint | $3.86 | $4.60 | Inverts to net gain after ~8 tasks |
Earlier runs on Apache Camel (Java, 5,856 files): **−58% impl cost · −72% impl tool calls · −39% wall time.**
Full results: [`benchmarks/`](https://github.com/swapnanil/vectr/tree/main/benchmarks)
---
## Measured costs, honestly
Per-call token cost (median, 182-file Python repo, chars/4 tokenization):
| Tool | Median tokens | Range |
|---|---:|---|
| `vectr_search` | ~2,320 | 1,437–3,091 (n=8) |
| `vectr_locate` | ~192 | — |
| `vectr_trace` | ~720 | — |
| `vectr_recall` (index tier) | ~180 | — |
The trade-off, stated plainly: for a single pointed lookup on a small, already-familiar repo, grep is cheaper — vectr's median cost across 5 single-fact tasks was **+60% more tokens** — and faster, since a `vectr_search` round-trip takes 1.7–3.6s against ~28ms for grep. Vectr doesn't win on per-call cost; it wins on tool-call count (one round-trip instead of several), answer completeness (a whole symbol back, not a partial file read), and everything in working memory — the 5.7× recall refund from the opening section compounds with every task you resume.
Fine print: the automatic eviction/reminder banners riding along on tool responses cost tokens too — an always-on re-fetch footer runs ~27 tokens, a light nudge ~89 tokens, and the escalated action-required banner (fires only after both the chunk and token thresholds are crossed without a save) scales from ~480 to ~535 tokens before it plateaus.
**When it pays off:** unfamiliar or large codebases, work you resume (later this session, after `/compact`, or in a new session), and long sessions with many turns. **When it doesn't:** a one-off grep on code you already know cold — reach for grep instead.
---
## Quick start
**Local (recommended)**
```bash
python3.14 -m venv ~/.vectr-env
source ~/.vectr-env/bin/activate # Windows: ~/.vectr-env/Scripts/activate
pip install vectr
cd /path/to/your/project
vectr start
```
**Requires Python 3.14+.** To install:
- macOS: `brew install python@3.14`
- Ubuntu/Debian: `sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt install python3.14 python3.14-venv`
- Windows: [python.org/downloads](https://www.python.org/downloads/)
`vectr start` returns immediately. Indexing runs in the background — run `vectr status` to check progress. On first run the embedding model downloads once (~290 MB). Restart your AI code editor once to pick up the new MCP config.
**Docker (CI/servers)**
```bash
git clone https://github.com/swapnanil/vectr
cd vectr
docker-compose up api
```
Exposes port 8765. Docker does not auto-write IDE config files — use local install for IDE integration.
---
## Connect to your AI code editor
`vectr start` writes the MCP config for your editor automatically. Restart your editor once.
| Editor | Config | Status |
|---|---|---|
| Claude Code | Auto — `.claude/settings.json`, guidance file, and session hooks (memory auto-injected at session start, per prompt, and before file read/edit) | **Verified** |
| Cursor | Auto — `.cursor/mcp.json` | Experimental |
| VS Code / GitHub Copilot | Auto — `.vscode/mcp.json` | Experimental |
| Windsurf | Manual — see below | Experimental |
| Cline | Manual — see below | Experimental |
| Continue | Manual — see below | Experimental |
| Codex CLI | Auto — `.codex/config.toml`, `AGENTS.md` guidance, and `.codex/hooks.json` (`vectr init --hooks`) | Experimental |
"Verified" means the full integration (config, guidance, and hooks) has been exercised end to end. "Experimental" means the MCP config is written and works, but the integration hasn't been run through the same verification pass. "Planned" means no support yet.
<details>
<summary>Manual setup</summary>
**Claude Code** — `.claude/settings.json`:
```json
{ "mcpServers": { "vectr": { "type": "http", "url": "http://localhost:8765/mcp" } } }
```
**Cursor** — `.cursor/mcp.json`:
```json
{ "mcpServers": { "vectr": { "url": "http://localhost:8765/mcp" } } }
```
**VS Code / GitHub Copilot** (1.99+) — `.vscode/mcp.json`:
```json
{ "servers": { "vectr": { "type": "http", "url": "http://localhost:8765/mcp" } } }
```
**Windsurf** — `~/.codeium/windsurf/mcp_settings.json`:
```json
{ "mcpServers": { "vectr": { "serverUrl": "http://localhost:8765/mcp" } } }
```
**Continue.dev** — `.continue/config.json`:
```json
{ "mcpServers": [{ "name": "vectr", "transport": { "type": "http", "url": "http://localhost:8765/mcp" } }] }
```
**Codex CLI** — project-scoped `.codex/config.toml` (written automatically by `vectr start`):
```toml
[mcp_servers.vectr]
url = "http://localhost:8765/mcp"
```
On its first run in the workspace, Codex shows a one-time interactive prompt to trust the project before it loads a project-scoped config; if you also ran `vectr init --hooks`, Codex shows a second one-time prompt to trust the hook commands. Both persist after you accept them once — a config writer cannot clear them for you without weakening your security posture.
</details>
### Stdio transport
The editors above connect over HTTP (`vectr start` + `POST /mcp`). For MCP clients and hosting platforms that spawn the server as a subprocess and speak MCP over its stdin/stdout instead of opening an HTTP connection, run:
```bash
vectr mcp-stdio [WORKSPACE]
```
No port, no daemon — a single foreground process framed as newline-delimited JSON-RPC 2.0 (one JSON object per line on each of stdin/stdout, no `Content-Length` headers). `initialize` and `tools/list` answer immediately; the embedding model load and initial indexing happen on a background thread, and a `tools/call` made before that finishes gets a graceful "still starting up" response instead of hanging. Stdout carries protocol JSON only — all logging goes to stderr. ThWhat people ask about vectr
What is swapnanil/vectr?
+
swapnanil/vectr is mcp servers for the Claude AI ecosystem. Semantic codebase search + persistent working memory for AI code editors. Local, zero-config, MCP. No API key. It has 1 GitHub stars and was last updated today.
How do I install vectr?
+
You can install vectr by cloning the repository (https://github.com/swapnanil/vectr) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is swapnanil/vectr safe to use?
+
swapnanil/vectr has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.
Who maintains swapnanil/vectr?
+
swapnanil/vectr is maintained by swapnanil. The last recorded GitHub activity is from today, with 0 open issues.
Are there alternatives to vectr?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy vectr to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/swapnanil-vectr)<a href="https://claudewave.com/repo/swapnanil-vectr"><img src="https://claudewave.com/api/badge/swapnanil-vectr" alt="Featured on ClaudeWave: swapnanil/vectr" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface