# oss-search [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/sblattj/oss-search  
**GitHub Stars:** 0  
**npm Downloads (last month):** 576  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/oss-search

## Description
Fast local and federated OSS code search and repo discovery for AI agents

## Tools
Capabilities this server exposes over MCP:

- **oss_search_repos** — Find open-source repositories by topic, name, or description. Returns a ranked shortlist with pre-computed fitness evidence (stars, license class, last release, archived flag, one-line what-it-is, one-line the-catch) — not a link dump. Lead with this for 'is there a tool for X' questions; use oss_search_code when the capability is an implementation detail no README advertises.
- **oss_search_code** — Find repos by distinctive code idioms, not marketing. Fires 2-5 orthogonal literal or /regex/ probes, aggregates hits PER REPO, and ranks by probe breadth (repos hitting several independent idioms outrank any star count). Use for: implementations of an API idiom, error string, or config key; finding peers of a known-good repo (steal its identifiers as probes). Do NOT use to test whether a category exists — probing your own idioms finds only clones; lead with oss_search_repos instead.
- **oss_repo_profile** — Pre-digested brief for ONE known repo: metadata, computed health verdicts, license compatibility class, README digest (<=1200 chars), top-level architecture from the file tree, release cadence, runtime-support evidence. Use instead of 5+ raw metadata calls; use oss_fetch_docs / oss_fetch_file to drill in.
- **oss_repo_tree** — Whole-repo file list in ONE call, path-filtered. ALWAYS call this before fetching any file whose path you are guessing — a 404 from a guessed path proves nothing. Response declares the total file count and returns up to `limit` paths with truncated/has_more set beyond.
- **oss_fetch_file** — Read one file's exact contents — byte-exact, never via a summarizer for opaque tokens, paths, or config keys. Prefer a line_range to keep payloads small; large files return the range plus total_lines.
- **oss_fetch_docs** — Fetch a project's docs the reliable way: resolve llms.txt / llms-full.txt aggregates, then return search hits WITH their 'Source: <url>' breadcrumbs so each hit maps back to its page. Falls back to raw docs/*.md and flags redirect-stub pages. One aggregate fetch replaces a dozen lossy page fetches.
- **oss_guide** — Returns the probe-writing and query-syntax playbook on demand: good vs bad probes, the backend regex support matrix, rate-limit traps, license-class meanings, and which tool answers which question (discovery vs vetting vs drill-down). Call once when unsure which oss_ tool to use.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "oss-search": {
    "command": "npx",
    "args": ["-y","oss-search"]
  }
}
```

## Documentation

## What oss-search does

oss-search exposes seven MCP tools for researching open-source software rather than only returning repository links. `oss_search_repos` finds projects by topic, name, or description and ranks them with evidence such as stars, license class, release recency, maintenance and security signals, dependents, and archived status. Results also include short explanations of what a project does and potential drawbacks.

`oss_search_code` searches for concrete implementation evidence. It combines several literal or regular-expression probes, groups matches by repository, and favors projects matching multiple independent idioms. This makes it useful for locating API patterns, error messages, configuration keys, or peers of a known repository. It is deliberately different from broad category discovery: use repository search to ask whether a type of tool exists.

The remaining tools support investigation. A repository profile condenses metadata, health judgments, license compatibility, README content, file-tree architecture, release cadence, and runtime-support evidence. Tree, file, and documentation tools then let an agent inspect exact paths, source contents, and documentation with source-page breadcrumbs.

## How it works

The local engine uses a positional trigram index over a hot-set corpus and updates only changed blobs during reindexing. A semantic layer can split code into function-level chunks for Rust, Python, JavaScript, TypeScript, Go, and C, create local embeddings, and combine semantic and lexical results with reciprocal-rank fusion. Identifier-oriented queries stay on the lexical path instead of incurring model latency.

For live searches, the production engine can query GitHub repository and code search, grep.app, Sourcegraph, deps.dev, ecosyste.ms, and npms.io. Repository candidates from npm and GitHub are deduplicated by owner and name before scoring. The service returns structured envelopes with totals, continuation status, partial-result status, and backend status.

Queries support structured JSON fields and a text syntax with filters for repositories, languages, paths, scope, hot-set membership, and match type. Arrays act as OR conditions, fields combine as AND conditions, and prefixed exclusions are supported. Invalid fields, malformed regular expressions, and unsupported searches produce typed errors instead of being silently ignored.

## Setup and configuration

Install the MCP binary through the `oss-search` npm shim, Cargo, a prebuilt release archive, or a source checkout. The npm option downloads and caches a platform-specific binary; the cache location can be changed with `OSS_SEARCH_CACHE_DIR`. Cargo installation requires a Rust toolchain. Prebuilt archives are published for Apple Silicon macOS, Intel macOS, and the two listed Linux GNU targets.

Run `oss-mcp` with no arguments to serve MCP over stdio. Add `--live` to enable remote backends; without that flag, the server uses its offline stub engine. Claude Code and Claude Desktop can launch the binary directly or through `npx`, while an `opencode.json` configuration can define it as a local MCP process. Use an absolute binary path in client configurations where path expansion is unavailable.

`GITHUB_TOKEN` enables the GitHub backend and avoids its anonymous repository-search limit of 10 requests per minute. `SOURCEGRAPH_TOKEN` raises Sourcegraph rate limits; Sourcegraph also supports anonymous requests. The CLI mirrors the MCP tools and emits the same structured JSON envelope, making it useful for checking queries before wiring them into an agent.

## Tools and capabilities

- `oss_search_repos`: discover repositories by topic, name, or description and inspect ranked fitness evidence.
- `oss_search_code`: find repositories containing distinctive literals or RE2-compatible regular expressions.
- `oss_repo_profile`: obtain a compact assessment of one known repository.
- `oss_repo_tree`: list repository paths with filtering, limits, and truncation metadata.
- `oss_fetch_file`: retrieve exact file contents, optionally constrained to a line range.
- `oss_fetch_docs`: resolve aggregate documentation such as `llms.txt` and return searchable passages with source URLs.
- `oss_guide`: explain probe design, query syntax, backend behavior, license classes, and tool selection.

The agent-facing contract caps responses at roughly 25 KB, escapes terminal and bidirectional-control characters, applies file-admission checks, and uses linear-time regular-expression behavior. The repository also includes tests, end-to-end reports, evaluation data, and latency measurements.

## Limitations and notes

Live coverage depends on remote backend availability and rate limits. GitHub repository search is especially constrained without a token, and a GitHub-only project lacks the dependents signal used for npm-backed candidates. Code search should use distinctive probes: searching broad concepts or idioms copied from the caller’s own code can return clones rather than establish that a category exists.

`oss_repo_tree` should precede file retrieval when a path is uncertain, because a guessed path can produce a 404 that says nothing about the repository’s contents. Large files are returned by range with their total line count, and tree results can be truncated when the repository exceeds the requested limit. The project is licensed under MIT.

_Full upstream README: https://allmcps.com/mcp/oss-search/readme_

