Srclight: code index for AI agents
Srclight
A local MCP server builds a SQLite and tree-sitter code index so an agent finds symbols, calls and meaning in one query
- 59 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The server reads the whole project source and documents and writes a .srclight index next to the repository
- Git hooks after commit start reindexing, and choosing Voyage AI sends code symbols to an external API
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/srclightDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The server reads the whole project source and documents and writes a .srclight index next to the repository
- Git hooks after commit start reindexing, and choosing Voyage AI sends code symbols to an external API
This is third-party code. Review the repository files before installing.
What it does
Srclight indexes a repository into a single SQLite file with tree-sitter and keeps it fresh by rebuilding only changed files. The MCP server gives an agent 42 tools. They search symbols, source code and documentation, show who calls whom, find code clusters and estimate what an edit will affect. There are tools for git history, build systems and documents: PDF, DOCX, XLSX, HTML, CSV, emails and images. The index understands 19 languages, including Python, C, C++, Java, Kotlin, Go, Rust and TypeScript. Semantic search is built on embeddings from Ollama or Voyage AI, and hybrid search merges it with keyword search. Several repositories can form a workspace and be searched together. Git hooks after commit and checkout refresh the index on their own. Every symbol and graph answer carries an index freshness stamp, and the server rejects unknown arguments instead of silently dropping them. The same tools are reachable from the terminal with srclight tool.
Who it is for. Developers of large multi-language codebases where an agent spends many calls finding files and callers.
Good fit when
- Before editing a function an agent runs grep dozens of times to find every call site
- A repository with C++, Python and PDF documentation must be searched with a single tool
- Before a commit you want to see what a change will affect, ahead of running the tests
- Code must be found by meaning, for example where the database connection pool is created
- Several repositories of one product should answer queries as one
Not a fit when
- The project is small and the agent copes with built-in search
- You work where git hooks cannot be installed or a .srclight folder cannot sit next to the code
- There is neither Ollama nor a Voyage key for semantic search, which leaves name and keyword search
- You need exact references without ambiguity, while links labeled name_only give only a candidate list
Example request
Show every caller of the lookup function and estimate which files a change to its signature will affect.MCP
- Transport
- stdio, sse
- Authentication
- not required
Environment variables
SRCLIGHT_EMBED_MODEL- Default embedding model for new indexes
VOYAGE_API_KEYsecret- Voyage AI key for the voyage-code-3 model
Limitations
Python 3.11 or newer and Git are required. Semantic search needs Ollama with an embedding model, for example qwen3-embedding with 6 GB of VRAM, or a Voyage AI key. The index is stored in a .srclight folder next to the project and should not be committed to git. An answer marked stale describes the code as it was indexed, and links marked name_only should be checked with get_symbol before editing. GPU-accelerated search needs CUDA 12 and is optional.
How to disable. Run claude mcp remove srclight. The srclight index --forget-embed-model command turns off embeddings in the hooks, and the .srclight folder can be deleted with the project.
FAQ
How do I connect Srclight to Claude Code?
Install the package with pip install srclight, run srclight index in the project root and add the server with claude mcp add srclight -- srclight serve. The --scope user flag makes it available in all projects.
Does my code go to external services?
Not by default: the index is a local SQLite file and a local Ollama computes embeddings. Symbols leave the machine only if you choose Voyage AI with a VOYAGE_API_KEY.
How does Srclight work in Cursor?
Start srclight serve --workspace name and add a srclight entry to mcp.json with the address http://127.0.0.1:8742/sse or the srclight command with the serve argument. Restart Cursor fully after editing.
How do I know the index lags behind the code?
Look at the index_freshness field in the answer: verified-fresh means files match the index. The check_freshness tool probes any paths on request, and srclight index refreshes the index.
Can I search by meaning without Ollama?
No, semantic search needs an embedding model: a local one through Ollama or the cloud Voyage AI. Without it, search by symbol names, source code and documentation remains.
Discussion
No questions or reviews yet.
Related
MCP serversAn MCP server that indexes a local repository with tree-sitter and gives the agent code search, file lookup and a structure summary of a file
A local codebase index for agents: hybrid search, dependency graphs and change impact analysis
Local code index for agents: the MCP tool map searches by meaning and structure, and code never leaves your machine
A structural code search MCP server for agents: finds the right file by query intent and runs locally
codesearch searches code across several repositories with hybrid retrieval and runs fully offline, without a GPU or Docker.
An MCP server that indexes code with tree-sitter so an agent reads single symbols, not files, traces paths and weighs edits
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Srclight: code index for AI agents (this card) | yes | not required | 59 | |
| jCodeMunch MCP | no | not required | 2,850 | returns single functions and classes instead of files, without documents, git history or workspaces |
| Serena | no | not required | 31,335 | gives IDE features through LSP and edits code, while Srclight only searches and analyzes |
| Claude Context | yes | API key | 12,690 | semantic search in a vector database, without a call graph or git analytics |
README in short
The README walks through indexing, four search modes, multi-repository workspaces and connecting to Claude Code, Cursor and OpenClaw. It separately explains freshness stamps, index coverage and the resolution labels on call graph edges.