Srclight
About
Deep code indexing for AI agents — 25 MCP tools: hybrid FTS5 + embedding search, call graphs, git blame/hotspots, build system analysis. Multi-repo workspaces, GPU-accelerated semantic search, 10 languages. Fully local, zero cloud dependencies.
Details
- Author
- srclight
- Categories
- Developer Tools, Search, Database
Jump to
Setup
Install Srclight in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/srclight/srclight
Follow the installation instructions in the repository README, then restart your MCP client.
Deep code indexing for AI agents.SQLite FTS5 + tree-sitter + embeddings + MCP.
Srclight builds a rich, searchable index of your codebase that AI coding agents can query instantly — replacing dozens of grep/glob calls with precise, structured lookups. It is the most comprehensive code intelligence MCP server available: 42 tools covering symbol search, relationship graphs, community detection, impact analysis, git change intelligence, semantic search, build system awareness, and document extraction — capabilities no other single MCP server combines. Fully local and private: your code never leaves your machine.
AI coding agents (Claude Code, Cursor, etc.) spend40-60% of their tokens on orientation— searching for files, reading code to understand structure, hunting for callers and callees. Srclight eliminates this waste.
- Minimal dependencies— single SQLite file per repo, no Docker/Redis/vector DB
- Fully offline— no API calls, works air-gapped (Ollama local embeddings)
- Incremental— only re-indexes changed files (content hash detection)
- 11 languages— Python, C, C++, C#, JavaScript, TypeScript, PHP, Dart, Swift, Kotlin, Java, Go
- 10 document formats— PDF, DOCX, XLSX, HTML, CSV/TSV, email (.eml), images (PNG/JPG/SVG/etc.), plain text, RST, Markdown
- Optional OCR— PaddleOCR for scanned/image-only PDF pages; pytesseract for images
- 4 search modes— symbol names, source code (trigram), documentation (stemmed), semantic (embeddings)
- Hybrid search— RRF fusion of keyword + semantic results for best accuracy
- Multi-repo workspaces— search across all your repos simultaneously via SQLite ATTACH+UNION
- MCP server— works with Claude Code, Cursor, and any MCP client
- CLI— index, search, and inspect from the terminal
- Auto-reindex— git post-commit/post-checkout hooks keep indexes fresh
- Python 3.11+
- Git(for change intelligence and auto-reindex hooks)
- Ollama(optional, for semantic search / embeddings) —ollama.com
- NVIDIA GPU + cupy(optional, for GPU-accelerated vector search)
- Poppler(optional, for PaddleOCR scanned-PDF support) —apt install poppler-utils/brew install poppler
# Install from PyPI pip install srclight # Install from source git clone https://github.com/srclight/srclight.git cd srclight pip install -e . # Optional: document format support (PDF, DOCX, XLSX, HTML, images) pip install 'srclight[docs,pdf]' # Optional: OCR for scanned PDFs (also needs poppler-utils on your system) pip install 'srclight[pdf,paddleocr]' # Optional: OCR for images (needs tesseract on your system) pip install 'srclight[docs,ocr]' # Optional: GPU-accelerated vector search (requires CUDA 12.x) pip install 'srclight[gpu]' # Everything (docs + pdf + ocr + paddleocr + gpu) pip install 'srclight[all]' # Index your project cd /path/to/your/project srclight index # Index with embeddings (requires Ollama running) srclight index --embed qwen3-embedding # Search srclight search "lookup" srclight search --kind function "parse" srclight symbols src/main.py # Start MCP server (for Claude Code / Cursor) srclight serve
Note:srclight indexautomatically adds.srclight/to your.gitignore. Index databases and embedding files can be large and should never be committed.
Srclight supports embedding-based semantic search for natural language queries like "find code that handles authentication" or "where is the database connection pool".
# Install Ollama (https://ollama.com) # Pull an embedding model ollama pull qwen3-embedding # Best quality (8B params, needs ~6GB VRAM) ollama pull nomic-embed-text # Lighter alternative (137M params) # Index with embeddings srclight index --embed qwen3-embedding # Or index workspace with embeddings srclight workspace index -w myworkspace --embed qwen3-embedding
- Each symbol's name + signature + docstring + content is embedded as a float vector
- Vectors are stored as BLOBs insymbol_embeddingstable (SQLite)
- After indexing, a.npysidecar snapshot is built and loaded toGPU VRAM(cupy) or CPU RAM (numpy) for fast search
- semantic_search(query)embeds the query and runs cosine similarity against the GPU-resident matrix (~3ms for 27K vectors on a modern GPU)
- hybrid_search(query)combines FTS5 keyword results + embedding results via Reciprocal Rank Fusion (RRF)
# Use Voyage Code 3 (API, highest quality) VOYAGE_API_KEY=your-key srclight index --embed voyage-code-3
Embeddings are stored insymbol_embeddingstable in.srclight/index.db. After indexing, a.npysidecar snapshot is built for fast GPU loading:
For ~27K symbols at 4096 dims (qwen3-embedding), that's ~428 MB on disk, ~450 MB in VRAM. Incremental: only re-embeds symbols whose content changed; sidecar rebuilt after each indexing run.
Search across multiple repos simultaneously. Each repo keeps its own.srclight/index.db; at query time, srclight ATTACHes them all and UNIONs across schemas.
# Create a workspace srclight workspace init myworkspace # Add repos srclight workspace add /path/to/repo1 -w myworkspace srclight workspace add /path/to/repo2 -w myworkspace -n custom-name # Index all repos (with optional embeddings) srclight workspace index -w myworkspace srclight workspace index -w myworkspace --embed qwen3-embedding # Search across all repos srclight workspace search "Dictionary" -w myworkspace srclight workspace search "Dictionary" -w myworkspace --project repo1 # Status srclight workspace status -w myworkspace srclight workspace list # Start MCP server in workspace mode srclight serve --workspace myworkspace
Git submodulesare not indexed automatically —git ls-filesdoes not recurse into them. To index a submodule, clone it separately and add it as its own workspace project. Seedocs/usage-guide.mdfor details.
Srclight supports two transport modes:stdio(one server per session) andSSE(persistent server, multiple sessions). SSE is recommended for workspaces.
Stdio (simplest — one server per session):
# Single repo claude mcp add srclight -- srclight serve # Workspace mode claude mcp add srclight -- srclight serve --workspace myworkspace # Make it available in all projects (user scope) claude mcp add --scope user srclight -- srclight serve --workspace myworkspace
SSE (persistent server — recommended for workspaces):
Run srclight as a long-lived server, then point Claude Code at it:
# Start the server (default: http://127.0.0.1:8742/sse) srclight serve --workspace myworkspace & # Or install as a systemd user service (Linux/WSL) # See docs/usage-guide.md for the service file # Connect Claude Code to the running server claude mcp add --transport sse srclight http://127.0.0.1:8742/sse
SSE mode supports multiple concurrent sessions and survives Claude Code restarts.
SSE (recommended):Run srclight once, then connect Cursor to it. Best for responsiveness and no cold-start per session.
Start the server:srclight serve --workspace myworkspace(default SSE on port 8742).
- UI:Settings → Tools & MCP → Add new MCP server → Type:streamableHttp, URL:http://127.0.0.1:8742/sse.
- JSON(project.cursor/mcp.jsonor global~/.cursor/mcp.json):
"srclight": { "url": "http://127.0.0.1:8742/sse" }
Stdio (alternative):One server process per Cursor session.
- UI:Type:command, Command:srclight, Args:serve --workspace myworkspace(orservefor single-repo).
- JSON:
"srclight": { "command": "srclight", "args": ["serve", "--workspace", "myworkspace"] }
For single-repo:"args": ["serve"]. Restart Cursor completely after adding the server.
Verify:In Cursor chat, ask "What projects are in the srclight workspace?" or "List srclight tools" — the agent should calllist_projects()or show srclight tools.
OpenClaw connects to srclight viamcporter, its built-in MCP tool server CLI.
# 1. Add srclight to mcporter's home config mcporter config add srclight http://127.0.0.1:8742/sse \ --transport sse --scope home \ --description "Srclight deep code indexing" # 2. Verify the connection mcporter call srclight.list_projects # 3. Restart the OpenClaw gateway to pick up the new server systemctl --user restart openclaw-gateway # if using systemd # or: openclaw daemon restart
The OpenClaw agent can then use srclight tools via themcporterskill:
mcporter call srclight.search_symbols query="my_function" mcporter call srclight.get_callers symbol_name="MyClass" project="my-repo" mcporter call srclight.hybrid_search query="authentication logic"
Prerequisite:Srclight must be running as an SSE server (see above). OpenClaw's mcporter connects over HTTP — stdio mode is not supported.
Claude Desktop (claude_desktop_config.json)
{ "mcpServers": { "srclight": { "command": "srclight", "args": ["serve", "--workspace", "myworkspace"] } } }
Any MCP-compatible client can connect to the SSE endpoint:
Srclight exposes 42 MCP tools organized in seven tiers. The MCP server includes built-in instructions that guide AI agents on which tool to use and when — agents receive a session protocol, tool selection guide, andprojectparameter documentation automatically on connection.
Tier 2b: Community & Impact Analysis
In workspace mode,search_symbols,get_symbol,codebase_map, andhybrid_searchaccept an optionalprojectfilter. Graph/git/build/community tools requireprojectin workspace mode.
Seedocs/usage-guide.mdfor the full deployment and usage guide, including:
- Setting up srclight as a global MCP server for Claude Code
- Adding/removing repos from workspaces
- What happens on commits and branch switches
- Re-embedding workflows
- Troubleshooting
# Install post-commit + post-checkout hooks in current repo srclight hook install # Install across all repos in a workspace srclight hook install --workspace myworkspace # Remove hooks srclight hook uninstall
The hooks runsrclight indexin the background after each commit and branch switch.
- tree-sitterparses every source file into an AST
- Document extractorshandle non-code files (PDF, DOCX, XLSX, HTML, CSV, images, email, text) — extracting headings, tables, pages, and metadata as searchable symbols. Scanned PDF pages are optionally OCR'd via PaddleOCR.
- Symbols (functions, classes, methods, structs, etc.) are extracted with full metadata
- ThreeSQLite FTS5indexes are built with different tokenization strategies:
- Names: code-aware tokenization (splitscamelCase, handles::,->)
- Content: trigram index for substring matching
- Docs: Porter stemming for natural language in docstrings
repo1/.srclight/index.db ──┐ repo2/.srclight/index.db ──┼── ATTACH ──→ :memory: ──→ UNION ALL queries repo3/.srclight/index.db ──┘
Each repo is indexed independently. At query time, SQLite's ATTACH mechanism joins them into a single searchable namespace. Handles >10 repos via automatic batching (SQLite's ATTACH limit).
A survey of 50+ MCP code intelligence servers across all major registries (Official MCP Registry, Smithery, Glama, mcp.so, awesome-mcp-servers) found that no other single server combines srclight's full capabilities:
Unlike grep-based tools, srclight builds a persistent index with structured lookups. Unlike cloud-based solutions, everything runs locally — your code never leaves your machine. Unlike IDE plugins, srclight works with any MCP client.
- Symbol intelligence + 3x FTS5 search
- Relationship graph: callers, callees, hierarchy
- Blast radius, test discovery, implementors
- Git change intelligence: blame, hotspots, recent changes
- Build system awareness: CMake, .csproj, platform conditionals
- Semantic search: embeddings via Ollama/Voyage, hybrid RRF
- GPU-accelerated vector search:.npysidecar, cupy/numpy vectorized math
- Multi-repo workspaces (ATTACH+UNION)
- Auto-reindex git hooks (post-commit + post-checkout)
- Document extraction: PDF, DOCX, XLSX, HTML, CSV, email, images, text (heading detection, tables, metadata)
- Optional OCR: PaddleOCR for scanned PDFs, pytesseract for images
- MCP agent guidance: comprehensive instructions, tool selection guide, session protocol
- Workspace config hot-reload (no server restart needed to add repos)
- VectorCache sidecar re-discovery (no restart needed after embedding)
- Project name suggestions in error messages
- Community detection: Louvain clustering on call-graph edges with TF-IDF auto-labeling
- Execution flow tracing: BFS from entry points across community boundaries
- Impact analysis: per-symbol blast radius with risk scoring (LOW/MEDIUM/HIGH/CRITICAL)
- detect_changes: map git diff to affected symbols and aggregate blast radius
- Cross-language concept mapping (explicit edges between equivalent symbols across languages)
- Pattern intelligence (convention detection, coding pattern extraction)
- AI pre-computation (symbol summaries via cheap LLM)
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
uild plug-and-play MCP servers for code search, docs, databases, and more. Integrates with Claude Code, Cursor, and Windsurf.
Local stdio MCP server that lets AI coding agents read and maintain structured architecture, rules, and decisions directly from your repository.
Persistent code index using Tree-sitter for fast, precise code search. Replaces grep with ~50 token responses instead of 2000+.
Searching and access your AI coding sessions from Claude Code, Gemini CLI, opencode, and OpenAI Codex.
Anchor is local repo and org memory for AI coding agents. It indexes GitHub PR history, current code, tests, regressions, architecture, and cross-repo impact locally, then exposes concise cited context through MCP and CLI workflows. Local-first. Read-only GitHub access. No CLI telemetry. No SaaS. No remote LLM calls.
Hosted MCP server and coordination layer for AI coding agents — live API contracts, database schema, frontend/backend mismatch detection, and shared handoff tickets for Claude Code, Cursor, Codex, and Lovable.
A platform-agnostic code analysis library with semantic search capabilities and MCP server support.
An intelligent codebase search engine that transforms local codebases into a natural language queryable knowledge base.
A local MCP server for AI coding agents. AST-aware indexing, semantic search, and automatic compression. Your agent stops re-reading your entire codebase every session.
An MCP server that indexes local code into a graph database to provide context to AI assistants.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




