srclight
Deep code indexing MCP server for AI agents. 25 tools: hybrid FTS5 + embedding search, call graphs, git blame/hotspots, build system analysis. Multi-repo workspaces, GPU-accelerated semantic search, 10 languages via tree-sitter. Fully local, zero cloud dependencies.
claude mcp add --transport stdio srclight-srclight srclight serve
How to use
Srclight is a Python-based MCP server that builds a rich, local code index and exposes a suite of MCP-compatible tools for AI coding agents. It provides incremental code indexing, symbol and relationship querying, semantic search via embeddings, and multi-repo workspace support, all accessible through the MCP interface. The server offers 29 tools for symbol search, graph relationships, change intelligence, and document extraction, enabling agents to operate with a detailed and searchable understanding of your codebase. You can run the server in standard stdio mode or via SSE for persistent sessions, and you can integrate it with Claude Code, Cursor, or any MCP client.
Typical workflow: index your project with srclight index to build the local SQLite databases, optionally embed symbols with embeddings using Ollama or other providers, and then serve the MCP endpoint with srclight serve so clients can connect and issue mcp add, mcp query, and other MCP actions. Srclight also supports multi-repo workspaces, so you can attach and search across multiple repositories in a single session. The server exposes commands for indexing, searching, symbol lookup, and workspace management, plus extended capabilities like semantic search and document extraction for broader code understanding.
How to install
Prerequisites:
- Python 3.11+
- Git
- Optional: Ollama for embeddings, CUDA-capable GPU for GPU-accelerated vector search
Install from PyPI (recommended):
- Create a virtual environment (optional but recommended): python3 -m venv venv source venv/bin/activate
- Install Srclight from PyPI: pip install srclight
Install from source (optional):
- git clone https://github.com/srclight/srclight.git
- cd srclight
- pip install -e .
Optional extras (for full feature set):
- Embeddings / embeddings-based semantic search: pip install 'srclight[all]'
- PDF, DOCX, images support and OCR: pip install 'srclight[docs,pdf]'
- GPU acceleration (CUDA required): pip install 'srclight[gpu]'
Usage basics:
- Index a project: srclight index
- Start MCP server: srclight serve
- Embedding setup (optional): ensure Ollama is running and index with embeddings, e.g. srclight index --embed qwen3-embedding
Tips:
- The index and embedding data live under .srclight/ in your project root. Do not commit these to version control.
- For multi-repo workspaces, initialize a workspace and add repos, then index and serve within the workspace context.
Additional notes
Notes and tips:
- Srclight requires Python 3.11+ and Git. Optional components include Ollama for embeddings, PaddleOCR for scanned PDFs, and GPU acceleration via CUDA for faster vector search.
- You can run the MCP server in stdio mode or via SSE. SSE is recommended for multiple sessions and workspaces.
- Embeddings are stored in symbol_embeddings within the index database. Ensure sufficient disk and, if using GPU, available VRAM.
- If you use submodules, they are not indexed automatically; index submodules by adding them as separate workspaces.
- For best performance with large codebases, enable incremental reindexing and consider using multi-repo workspaces to consolidate search across repos.
Related MCP Servers
grepai
Semantic Search & Call Graphs for AI Agents (100% Local)
mcp-local-rag
Local-first RAG server for developers using MCP. Semantic + keyword search for code and technical docs. Fully private, zero setup.
code-memory
MCP server with local vector search for your codebase. Smart indexing, semantic search, Git history — all offline.
mcp-ragex
MCP server for intelligent code search: semantic (RAG), symbolic (tree-sitter), and regex (ripgrep) search modes. Built for Claude Code and AI coding assistants.
flyto-indexer
Code intelligence MCP server — impact analysis, semantic search, dependency graphs. Works with Claude Code, Cursor, Windsurf.
mnemos
🧠 Transform documentation chaos into a structured memory system with Mnemos, your self-hosted, multi-context knowledge server for developers.