Skip to main content

Cursor-style vector search MCP plugin for Claude Code

Project description

VecGrep

CI codecov

Cursor-style semantic code search as an MCP plugin for Claude Code.

Instead of grepping 50 files and sending 30,000 tokens to Claude, VecGrep returns the top 8 semantically relevant code chunks (~1,600 tokens). That's a ~95% token reduction for codebase queries.

How it works

  1. Chunk — Parses source files with tree-sitter to extract semantic units (functions, classes, methods)
  2. Embed — Encodes each chunk locally using all-MiniLM-L6-v2 (384-dim, ~80MB one-time download)
  3. Store — Saves embeddings + metadata in SQLite under ~/.vecgrep/<project_hash>/
  4. Search — Cosine similarity over all embeddings returns the most relevant snippets

Incremental re-indexing via SHA256 file hashing skips unchanged files.

Installation

Requires Python 3.12+ and uv.

pip install vecgrep        # standard pip
uv tool install vecgrep   # uv tool (isolated, recommended)

Claude Code integration

Add to your Claude Code MCP settings (~/.claude/claude_desktop_config.json or via claude mcp add):

{
  "mcpServers": {
    "vecgrep": {
      "command": "uvx",
      "args": ["vecgrep"]
    }
  }
}

Or with the CLI:

claude mcp add vecgrep -- uvx vecgrep

uvx downloads and runs VecGrep in an isolated environment on first use — no cloning or manual setup required.

Tools

index_codebase(path, force=False)

Index a project directory. Skips unchanged files on subsequent calls.

index_codebase("/path/to/myproject")
# → "Indexed 142 file(s), 1847 chunk(s) added (0 file(s) skipped, unchanged)"

search_code(query, path, top_k=8)

Semantic search. Auto-indexes if no index exists.

search_code("how does user authentication work", "/path/to/myproject")

Returns formatted snippets with file paths, line numbers, and similarity scores:

[1] src/auth.py:45-72 (score: 0.87)
def authenticate_user(token: str) -> User:
    ...

[2] src/middleware.py:12-28 (score: 0.81)
...

get_index_status(path)

Check index statistics.

Index status for: /path/to/myproject
  Files indexed:  142
  Total chunks:   1847
  Last indexed:   2026-02-22T07:20:31+00:00
  Index size:     28.4 MB

Supported languages

Python, JavaScript/TypeScript, Rust, Go, Java, C/C++, Ruby, Swift, Kotlin, C#

All other text files fall back to sliding-window line chunks.

Index location

~/.vecgrep/<sha256-of-project-path>/index.db

Each project gets its own isolated index. Delete the directory to wipe the index.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vecgrep-1.0.0.tar.gz (119.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vecgrep-1.0.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file vecgrep-1.0.0.tar.gz.

File metadata

  • Download URL: vecgrep-1.0.0.tar.gz
  • Upload date:
  • Size: 119.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vecgrep-1.0.0.tar.gz
Algorithm Hash digest
SHA256 38b30e57149d76b76116f1c423b70a44afca65f57e248a31b2849122c8194c54
MD5 eae2723d559ee88e15b292b5285a3a09
BLAKE2b-256 2b2bc37d22e2554af853f676bb86109e3d21e45beedb8b618421daa87495fee4

See more details on using hashes here.

File details

Details for the file vecgrep-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vecgrep-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vecgrep-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cf7eebf4dbae30659bdd62027d9e8cff9596a5f453e56ca82886fd5f41bc64d
MD5 6d21d961cd55fd0d602ca5abbecb4cdf
BLAKE2b-256 76ffd9c0e3a3d72678b2a1736daa26b5499183a2d8bb8ded9e74d785668c03ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page