Fast local and federated OSS code search and repo discovery for AI agents
Runs on your machine from its package; the steps are below.
At most: only reads or looks up information.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y oss-search
MCP client config
{
"mcpServers": {
"oss-search": {
"command": "npx",
"args": [
"-y",
"oss-search"
]
}
}
}Fast local + federated OSS code search and repo discovery, built for AI agents (MCP) with a CLI twin.
Not recreating the wheel is a superpower. oss-search answers two questions for an agent:
oss_search_repos, oss_search_code, oss_repo_profile, oss_repo_tree, oss_fetch_file, oss_fetch_docs, oss_guide) over stdio, plus a byte-identical CLI.unknown_field / regex_error / not_indexable) that echo the input and name the correction, declared total/hasMore/partial, ~25KB response cap, never silent degradation.Two front doors: oss-mcp (MCP server) and oss-cli (CLI twin). Three ways to get them:
1. npm — an oss-search shim that downloads the platform-matched prebuilt
binary on first run and caches it under ~/.cache/oss-search/bin/ (override
with OSS_SEARCH_CACHE_DIR):
npx -y oss-search --version
2. cargo install from git (requires a Rust toolchain):
cargo install --git https://github.com/sblattj/oss-search oss-mcp
cargo install --git https://github.com/sblattj/oss-search oss-cli
Binaries land in ~/.cargo/bin/.
3. Prebuilt binaries — every release publishes
oss-search-<version>-<target>.tar.gz plus checksums.txt (sha256) at
https://github.com/sblattj/oss-search/releases/latest, for targets
aarch64-apple-darwin, x86_64-apple-darwin, aarch64-unknown-linux-gnu,
x86_64-unknown-linux-gnu:
curl -fsSL https://github.com/sblattj/oss-search/releases/latest/download/oss-search-0.3.0-aarch64-apple-darwin.tar.gz | tar xz
From a checkout instead:
cargo build --release
# binaries: target/release/oss-mcp target/release/oss-cli
oss-cli mirrors the 7-tool surface one-to-one (offline stub engine by
default; --live switches to the real backends):
# Probe-writing and query-syntax playbook — offline, zero setup
oss-cli guide
# Repo discovery — which wheel exists?
oss-cli search-repos --query "express" --limit 5
# Code search by distinctive idioms (federated; GITHUB_TOKEN unlocks the github backend)
GITHUB_TOKEN=... oss-cli --live search-code --probe "retry_with_backoff" --limit 3
All commands emit the same structured JSON envelope (results, total,
has_more, partial, backend_status) that the MCP tools return.
oss-mcp speaks MCP over stdio. Invocation safety: --help / --version
print and exit 0 without ever starting the server; unknown arguments exit 2
with usage instead of silently serving a stub; with no arguments it serves
until stdin closes.
Claude Code — .mcp.json at the project root (use the absolute path your
install produced, or the npx form):
{
"mcpServers": {
"oss-search": {
"command": "/Users/YOU/.cargo/bin/oss-mcp",
"args": ["--live"],
"env": { "GITHUB_TOKEN": "ghp_..." }
}
}
}
npx form (no absolute path needed):
{
"mcpServers": {
"oss-search": {
"command": "npx",
"args": ["-y", "oss-search", "--live"],
"env": { "GITHUB_TOKEN": "ghp_..." }
}
}
}
Claude Desktop — claude_desktop_config.json (macOS:
~/Library/Application Support/Claude/claude_desktop_config.json; ~ is not
expanded inside the JSON — use the absolute path):
{
"mcpServers": {
"oss-search": {
"command": "/Users/YOU/.cargo/bin/oss-mcp",
"args": ["--live"],
"env": { "GITHUB_TOKEN": "ghp_..." }
}
}
}
opencode — opencode.json at the project root:
{
"mcp": {
"oss-search": {
"type": "local",
"command": ["oss-mcp", "--live"],
"environment": { "GITHUB_TOKEN": "ghp_..." },
"enabled": true
}
}
}
--live enables the remote backends (GitHub REST code and repository search,
grep.app via its MCP endpoint, Sourcegraph, deps.dev, ecosyste.ms, npms.io);
without it oss-mcp serves an offline stub. oss_search_repos draws
candidates from npms.io (npm packages) and GitHub repository search (any
language), dedupes them by owner/name, and scores both with the same
per-signal model; a GitHub-only repo has no dependents signal, so it is scored
on stars, recency, and license. Without GITHUB_TOKEN repository search is
limited to 10 requests/min. Sourcegraph answers anonymously; set
SOURCEGRAPH_TOKEN for higher rate limits.
oss-mcp --help prints the full invocation contract.
retry repo:tokio-rs/tokio lang:rust path:src/ case:yes scope:def in:hotset type:regex
Structured JSON fields are canonical (arrays = OR, across fields = AND, - prefixes = excludes). Unknown fields are rejected loudly with the known-field list — never silently dropped.
The repo ships its own evidence: data/e2e/E2E-REPORT.md (9/9 gate through the release binaries), golden-set eval (data/e2e/eval/EVAL.md), and the hot-set latency table (data/e2e/hotset/LATENCY.md).
cargo test --workspace # 432 tests
| Crate | Role |
|---|---|
oss-query | query schema, strict text⇄structured grammar, typed errors, backend planning |
oss-facade | remote clients: GitHub, grep.app, Sourcegraph, deps.dev, ecosyste.ms, npms.io (rate-limited) |
oss-corpus | cloning, CAS blob store, dedup, license detection |
oss-index | positional-trigram index, regex planning, ranking, incremental updates |
oss-semantic | tree-sitter chunking, embeddings, vector store, RRF fusion, query routing |
oss-rank | repo signals, PageRank over dependency graph, multi-signal ranker |
oss-eval | golden-set evaluation (nDCG/MRR/Recall), latency harness |
oss-core | envelope, shaping, escaping, engine trait |
oss-live | production engine wiring facade + ranker |
oss-mcp / oss-cli | the two front doors |
MIT