Skip to main content

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; select scope="worktree" for current on-disk files, expand a subtree with path_prefix, or raise max_files and max_chars.
  • compare_versions: compare symbols, dependencies, and commits.
  • index_repository: explicitly index a Git version; searches index automatically when needed.

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.

The default install uses BM25 and does not install Torch or download a model.

For BGE-Code-v1 or GTE-ModernBERT, opt in to the Transformers 4 extra:

python -m pip install 'seraph-mcp[cpu]'  # CPU / Apple Silicon
# or, on an NVIDIA CUDA machine:
python -m pip install 'seraph-mcp[gpu]'

Seraph downloads BGE-Code-v1 (about 6 GB) from Hugging Face the first time semantic search needs it. Hugging Face caches the files, so the same user account reuses that model across repositories. Each teammate only downloads their own local cache if they opt in.

EmbeddingGemma-2 needs Transformers 5, so use its separate extra instead of 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.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seraph-mcp 0.1.9
File Size Uploaded
seraph_mcp-0.1.9.tar.gz 74.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for seraph-mcp 0.1.9
File Interpreter ABI Platform
seraph_mcp-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 163.6 kB

Release files / seraph_mcp-0.1.9.tar.gz

Download URL seraph_mcp-0.1.9.tar.gz
Size 74.0 kB
Tags Source
SHA-256 checksum
How to use checksums
084c935bce1d60325b9d72dc7294db93c86de2d562a3129c39b451bbf19e4db0
BLAKE2b-256 checksum
How to use checksums
49f15ea4d27d9f3fb6986916fde8642ca0b91cce538321026f453951f57371c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / seraph_mcp-0.1.9-py3-none-any.whl

Download URL seraph_mcp-0.1.9-py3-none-any.whl
Size 89.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bff261b62d2f5042382356f0e1d6092327d7c03d3eafc40a534b9215030e405f
BLAKE2b-256 checksum
How to use checksums
9958b30368325ee28db50b6e21b1393cf9760576436fe4b1a90c9afbac09ef34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page