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-0.1.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-0.1.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vecgrep-0.1.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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0138becbbb618e48fb3732688cd044435b5ce214a4d0aeeca956f64b4477528b
MD5 686dc80a9dd43f76ab0e4ebf3f77dbaa
BLAKE2b-256 b7207d2dad5f6e13150072bdb9bf045f0e24ca403c5cdf740d7bc945adceb036

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vecgrep-0.1.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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78b50f706093e44b66a6e2f36e1ac8c25ebfc6fd702e0f70690ff56e4315fc8a
MD5 4552ef879bcad4cbfbfb7634642254f5
BLAKE2b-256 76f5b5890140447a5714d2a6f7770b1ee1e6a346a3b02f3578263429ca111ef4

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