Seraph
Local code search and Git-aware code intelligence for coding agents. Seraph indexes a local Git checkout into a SQLite database and exposes working-tree search, change impact, task context, repository maps, symbols, dependencies, history, and version comparison over MCP. Source parsing covers Python, JavaScript, TypeScript, Go, C, C++, Java, C#, Rust, PHP, Ruby, Swift, Kotlin, Bash, Dart, Lua, SQL, Fortran, and Scala.
Install from a checkout
Requires Python 3.12 and Git. With uv:
uv tool install --from . seraph-mcp
For development directly from this directory:
uv sync
uv run seraph-mcp
Install the published package from PyPI:
python -m pip install seraph-mcp
Agent setup
Register a local stdio MCP server in your agent with command seraph-mcp and no arguments, then reload the MCP connection. Use your agent's own MCP setup UI or command because configuration differs by host. On every Seraph tool call, pass repo as the absolute path to the local Git checkout you want searched. Use the active workspace path for that project, or a different repository path when the question is about another checkout.
Seraph runs on the user's machine. Each tool accepts repo, the absolute path to the local Git checkout to search. The agent should pass the active workspace path on every call; if asked about another checkout, pass that checkout's path. The index is stored at <repo>/.seraph/index.sqlite and ignored by Git.
MCP tools
search_code: retrieve relevant code from the selected checkout.search_at_version: retrieve code from a commit, branch, or tag.search_history: search indexed Git versions.find_symbol: locate a function, class, or method.find_dependencies: walk call, import, and inheritance relationships.get_working_tree_status: see staged, unstaged, and untracked source changes.search_worktree: search current on-disk source, including uncommitted edits and untracked files.change_impact: find statically resolved callers, importers, and related tests for symbols or changed paths.prepare_change_context: bundle task-relevant code, a repo map, change impact, and Git history in one bounded response.get_repo_map: get a compact file-to-symbol overview; selectscope="worktree"for current on-disk files, expand a subtree withpath_prefix, or raisemax_filesandmax_chars.compare_versions: compare symbols, dependencies, and commits.index_repository: explicitly index a Git version; searches index automatically when needed.retrieval_status: show the active search tier, what each tier needs, and whether the user has chosen.set_retrieval_tier: switch betweenlite,fastandqualityafter the user agrees.
The default retrieval setup is local and needs no API key. Benchmark/evaluation code and submission assets are intentionally excluded from this slim distribution.
prepare_change_context uses the active retrieval configuration for both HEAD and working-tree searches. Its character cap preserves at least one ranked code result while compacting the repo map and impact details. Search responses report the active retrieval mode. Explicit requests for implementations or tests search a wider candidate list and prioritize the requested kind; broad behavior questions keep the retrieval order.
Working-tree tools overlay changed supported source files on indexed HEAD; the overlay itself is temporary.
When a repository already has a Seraph index, the first request after upgrading backfills files using newly added language support. Cross-file graph links are statically resolved where the language syntax and import path can be mapped; dynamic dispatch and framework-specific loading can remain unresolved.
Search tiers
Keyword search (BM25 over code-aware tokens) is the default and needs no model, no API key and no network, so pip install seraph-mcp stays small and search works immediately. It is exact about names but blind to paraphrases: asking "how do we stop hammering the API" will not find RateLimiter. Each user can choose a stronger tier; nothing is downloaded until they do.
| Tier | What runs | Download | First search | Install |
|---|---|---|---|---|
lite (default) |
BM25 | none | instant | seraph-mcp |
fast |
BM25 + potion-code-16M static embeddings (numpy, no Torch) | about 62 MB | about a second | seraph-mcp[fast] |
quality |
BM25 + BGE-Code-v1 (1.5B) | about 6 GB | tens of seconds while the repository is embedded | seraph-mcp[quality] |
seraph models status # active tier and what each one needs
seraph setup # interactive choice
seraph setup --tier fast --install # install packages, download the model, verify it, save the choice
seraph setup --tier quality --install --json
seraph models enable --model fast # or: quality, static:<hf id>, or an embedder name such as qwen3-emb-0.6b
seraph models disable # back to lite
The choice is saved in ~/.config/seraph/config.yaml (SERAPH_CONFIG points elsewhere) and applies to every repository. Weights download once into the Hugging Face cache; embeddings cache under ~/.cache/seraph. The fast and quality extras install together in one environment.
Agents can do the same over MCP: retrieval_status reports the active tier and whether the user has chosen, and set_retrieval_tier switches it with no restart. The server instructions tell the agent to ask the user first and never pick for them. The quality download is too long for a tool call, so the tool returns the terminal command instead. Search responses also carry a retrieval_hint when a query barely overlaps the repository's vocabulary, and a notice when a chosen tier cannot load, in which case search falls back to keywords instead of failing.
When a query's vocabulary barely overlaps the repository, keyword hits are coincidences, so the semantic view takes over; otherwise keyword search stays in front and the semantic view breaks ties. Tune that with retrieval.dense_router and retrieval.dense_router_threshold.
quality needs transformers<5 because BGE-Code-v1 ships remote code that is not compatible with v5. EmbeddingGemma-2 needs Transformers 5, so it has its own extra and cannot share an environment with quality, cpu or gpu:
python -m pip install 'seraph-mcp[gemma2]'
Choose embeddinggemma-2 in Seraph's model configuration. The selected model weights download on first use and are then cached locally.
CLI
seraph --repo /path/to/repo index
seraph --repo /path/to/repo search "where is request authentication checked?"
seraph --repo /path/to/repo symbol authenticate_request
seraph --repo /path/to/repo deps authenticate_request
seraph --repo /path/to/repo compare <old-commit> <new-commit>
License
Released under the MIT License.
Metadata
Release files for seraph-mcp 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| seraph_mcp-0.2.1.tar.gz | 85.2 kB | Without provenance | Details for seraph_mcp-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| seraph_mcp-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for seraph_mcp-0.2.1-py3-none-any.whl |
Total release size: 185.6 kB
Release files / seraph_mcp-0.2.1.tar.gz
| Download URL | seraph_mcp-0.2.1.tar.gz |
|---|---|
| Size | 85.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e55ba7c2e633eb9090a07735ba374d91c6b13282b581a50b8f1f95189c39e3d
|
|
BLAKE2b-256 checksum How to use checksums |
e5719583356f26894863700f2192f6d9a695e633206b8e30d32a5c7bb54309cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / seraph_mcp-0.2.1-py3-none-any.whl
| Download URL | seraph_mcp-0.2.1-py3-none-any.whl |
|---|---|
| Size | 100.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f361956eca2e28dcd1702f89b4c0dc8b6a5545f166a42c20f5ca45a70b35ce4
|
|
BLAKE2b-256 checksum How to use checksums |
7bba4e76fa767ff3f915b5c825295791ced1be10992524e831c389c28a13c1a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for seraph-mcp 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.