Skip to main content

Local semantic code search MCP server for Claude Code

Project description

claude-context-local

Local semantic code search MCP server for Claude Code. Zero external APIs — runs entirely on your machine.

A lightweight alternative to zilliztech/claude-context that uses local embeddings instead of OpenAI + Zilliz Cloud.

How it works

  • sentence-transformers (all-MiniLM-L6-v2, 88 MB) for embeddings — no API keys needed
  • ChromaDB for persistent vector storage — per-project isolation
  • Incremental indexing — only re-indexes changed files (MD5 hash check)
  • MCP protocol over stdio — plug into Claude Code or any MCP client

Quick start

claude mcp add claude-context-local -- uvx claude-context-local

That's it. Restart Claude Code and the tools are available.

Alternative: pip

pip install claude-context-local
claude mcp add claude-context-local -- claude-context-local

Alternative: from source

git clone https://github.com/tazhate/claude-context-local.git
cd claude-context-local
pip install -e .
claude mcp add claude-context-local -- claude-context-local

MCP Tools

Tool Description
index_project(project_path) Index a codebase. Incremental by default, force=True to rebuild.
search_code(query, project_path) Semantic search. Optional n_results and file_filter (e.g. "*.py").
index_status(project_path) Show indexed files/chunks count.
drop_index(project_path) Remove project index.

Usage

Once connected, Claude Code will automatically use these tools. You can also ask directly:

  • "Index this project" — triggers index_project with current working directory
  • "Search for authentication logic" — triggers search_code
  • "How many files are indexed?" — triggers index_status

Configuration

Environment variables:

Variable Default Description
CCL_MODEL all-MiniLM-L6-v2 sentence-transformers model name
CCL_CHUNK_LINES 50 Max lines per chunk
CCL_CHUNK_OVERLAP 10 Overlap lines between chunks
CCL_DATA_DIR ~/.cache/claude-context-local Index storage directory

Resource usage

Resource Value
RAM ~780 MB (PyTorch + model in memory)
Model on disk 88 MB
Index size ~27 MB per 500 files
CPU Near zero at idle

Per-project isolation

Each project gets its own ChromaDB database under ~/.cache/claude-context-local/<hash>/, where <hash> is derived from the absolute project path. Projects never mix.

Supported file types

Code: .py .go .js .ts .tsx .jsx .rs .java .kt .c .cpp .h .hpp .cs .rb .php .swift .scala .sh .bash .lua .zig .nim .ex .exs .erl .nix

Config: .yaml .yml .toml .json .hcl .tf .sql .graphql .proto

Docs: .md .txt .rst

Web: .html .css .scss .less

Plus Dockerfile and Makefile.

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

claude_context_local-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for claude_context_local-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5897efe60fefe12215d18aaf081075b21cf8aebf0a522b8a5c1ca895e9f4bf46
MD5 7d9de0aaf48eb5ed071f1d3dc881af74
BLAKE2b-256 c70bc891662b1d35485f67edd204839e70dade9314f20fa3947d3a4afa36bdc1

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