oss-search

io.github.sblattj由 GitHub 账号 sblattj 发布v0.3.2更新于 Oct 30, 2026

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

概览

AI 生成的概览

本地 MCP 服务器,用于开源项目发现:按主题或代码写法搜索仓库,并查看文件、目录树与文档。

可以做什么
  • 按主题、名称或描述搜索开源仓库,返回带星标、许可证类别和发布信息的排序结果
  • 用特征代码写法或正则探针查找仓库,并按命中探针数量排序
  • 获取单个已知仓库的预整理档案:元数据、健康判定、许可证类别、README 摘要与架构
  • 一次调用列出整个仓库的文件树,可按路径过滤
  • 按行范围读取文件精确内容,并通过 llms.txt 聚合获取项目文档及来源标注
  • 按需返回探针编写、查询语法、限流陷阱与工具选择的说明手册
适用场景
适合回答“有没有做 X 的工具”、比较候选开源项目,或在采用某个库前确认它如何实现某个 API 写法。主要用于对公开仓库的调研与核查,而非修改代码。
运行要求
通过 npx 作为本地 stdio 进程运行(Node.js 18 及以上仅用于引导二进制);支持 macOS 或 Linux 的 x64、arm64。首次运行会从 GitHub Releases 下载预编译 Rust 二进制并缓存,需要网络访问。远程后端(如 GitHub 代码搜索)需加 --live 参数启用,可能用到 GITHUB_TOKEN;缓存位置可用 OSS_SEARCH_CACHE_DIR 修改。
安装前请注意
首次运行会下载并执行来自 GitHub Releases 的二进制,仅在存在 checksums.txt 时进行校验。live 模式会把查询发送给 GitHub 代码搜索、grep.app、deps.dev 等第三方服务,并可能因限流需要 GITHUB_TOKEN。工具只读取公开仓库数据,未描述写入操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 oss-search,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

oss-mcp (npm distribution)

npm/npx distribution of oss-search — fast local + federated OSS code search and repo discovery, exposing 7 MCP tools over stdio plus a byte-identical CLI.

This package contains no compiled code and has zero runtime dependencies. On first run, the oss-mcp shim downloads the prebuilt Rust binary for your platform from GitHub Releases, verifies it against the release's checksums.txt (when present), and caches it. Subsequent runs start instantly from the cache.

Requirements

  • Node.js >= 18 (only to bootstrap the binary)
  • macOS (x64, arm64) or Linux (x64, arm64)
  • A published release v<version> with assets named oss-search-<version>-<target>.tar.gz (containing the oss-mcp binary) and, optionally, checksums.txt

Run once

sh
npx oss-search            # speaks MCP over stdionpx oss-search --live     # enable remote backends (GitHub code search, grep.app, deps.dev, ...)

Install globally

sh
npm install -g oss-searchoss-mcp

Use with an MCP client

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

Or point directly at the cached binary (~/.cache/oss-search/bin/<version>-<target>/oss-mcp) to skip the Node shim entirely.

Cache

Binaries are cached at ~/.cache/oss-search/bin/<version>-<target>/oss-mcp. Override the location with the OSS_SEARCH_CACHE_DIR environment variable. Delete the cache to force a re-download.

For GITHUB_TOKEN-backed live search and other options, see the repository README.

License

MIT — see LICENSE.

来源:npm/oss-search/README.md,提交 ef7cbc0

工具

7

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.

输入参数sortlimitquery必填topiccursorfieldslanguagemin_starsresponse_format

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.

输入参数modepathlimitcursorprobes必填languagerepo_filterexclude_knownresponse_formatsnippets_per_repo

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.

输入参数repo必填deep_docs

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.

输入参数refglobrepo必填limitpath_prefix

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.

输入参数refpath必填repo必填line_range

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.

输入参数repo必填pattern必填docs_host

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.

无需输入参数。

版本历史

3
  1. v0.3.2最新Oct 21, 2026
  2. v0.3.1Oct 20, 2026
  3. v0.2.0Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分