Skip to main content

RepoSniffer

RepoSniffer

CI PyPI License: MIT

There's a repo for that. Let RepoSniffer find it.

RepoSniffer demo

AI-first GitHub repo discovery. Describe a feature in plain language — "markdown editor with live preview" — and RepoSniffer returns a ranked, adoption-grade list of open-source projects that implement it, with evidence and quality signals (stars, activity, license, archived status).

Built to be the grounding layer for coding agents: stop hallucinating repos, get a verifiable "best of kind" answer with reasons.

Quickstart

# CLI
uvx reposniffer "markdown editor live preview" --language python --top-k 5

# MCP server (stdio) — wire into opencode, Claude Code, Codex, Cursor, ...
uvx --from reposniffer reposniffer-mcp

Set GITHUB_TOKEN to raise search rate limits (authenticated = 30 req/min vs ~10).

Wire into your agent

opencode — add to opencode.json:

{
  "mcp": {
    "reposniffer": {
      "type": "local",
      "command": ["uvx", "--from", "reposniffer", "reposniffer-mcp"],
      "environment": { "GITHUB_TOKEN": "ghp_..." }
    }
  }
}

Claude Code: claude mcp add reposniffer -- uvx --from reposniffer reposniffer-mcp Codex/Cursor: add an MCP server pointing at uvx --from reposniffer reposniffer-mcp (stdio).

MCP tools

Tool Purpose
find_repos Feature query → ranked candidates with score breakdown, snippet evidence, license verdict, recommendation
repo_intel Verify an existing repo (alive? licensed? best-of-kind?) + 2 alternatives
health Embedding backend, model, auth status

Every result carries as_of (a freshness timestamp agents can cite), a flags list (archived, no-license, strong-copyleft, stale, ...), a license_category (permissive / weak-copyleft / strong-copyleft / unknown), and a targeted snippet showing why the repo matched.

Architecture

  1. Coarse candidate fetch — GitHub Search API (in:readme, language/license/stars filters).
  2. Hybrid rerank — embed each candidate's description + README front matter (not the whole README, to avoid dilution), cosine vs embedded query, plus a lexical-overlap boost for literal matches.
  3. Quality scoring — popularity (log stars), activity (pushed_at half-life), license category, archived penalty; weights differ by intent (adopt vs study).
  4. Adoption safety — permissive/weak/strong-copyleft classification flags GPL/AGPL repos before you depend on them.
  5. Local SQLite cache — repos, READMEs, embeddings, query results → fast repeat queries, index grows over time.

Embeddings are pluggable: default is a zero-config local fastembed ONNX model (no torch, no API key); set REPOSNIFFER_EMBED_BACKEND=api plus an OpenAI-compatible endpoint for stronger quality.

Eval

Ground-truth queries live in eval/queries.py (feature → known-good repos). Run with a token (each query fetches ~50 READMEs):

GITHUB_TOKEN=ghp_... uv run python -m eval.run

Reports hit@1 / hit@3 / hit@5. Current live result: hit@1 0.50, hit@3 0.83, hit@5 0.83.

Known limitation: the candidate stage depends on GitHub Search API relevance, which can fail to recall canonical repos with weak descriptions/READMEs (e.g. Kozea/WeasyPrint — description is just "The awesome document factory"). Semantic rerank can only rank what the candidate fetch surfaces.

Project layout

src/reposniffer/
  config.py        # env-driven settings
  cache.py         # sqlite store (repos, readmes, embeddings, query cache)
  engine/
    github.py      # GitHub REST client + search query builder + text/snippet utils
    embed.py       # Embedder protocol: local fastembed + OpenAI-compatible API
    score.py       # quality + license-category + lexical scoring
    search.py      # orchestration (Engine)
  mcp/server.py    # MCPServer (mcp 2.x)
  cli.py           # Typer CLI
eval/              # golden query → repo eval harness
tests/             # offline (fake transport + fake embedder)

Development

uv sync
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest

CI (lint/format/type/tests) runs on every push and PR. Publishing to PyPI happens on v* tags via trusted publishing — enable it once on the PyPI project settings, then: git tag v0.1.0 && git push --tags.

Note: mcp 2.x is used — MCPServer (FastMCP was renamed in mcp 2.0). Pin mcp<2 if you need the v1 API.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reposniffer-0.1.1.tar.gz (705.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reposniffer-0.1.1-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file reposniffer-0.1.1.tar.gz.

File metadata

  • Download URL: reposniffer-0.1.1.tar.gz
  • Upload date:
  • Size: 705.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for reposniffer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5b159550358c87463eb1e5e2f6e2e2bba9b021d8d7aaa651b52609b83f518be8
MD5 37c5e6f36dc7b464d5e4939c0d4f6164
BLAKE2b-256 8bff244bb0f5eef8ca5715d2ad1cc4645ca9f3d781135a30988b02dc72159639

See more details on using hashes here.

Provenance

The following attestation bundles were made for reposniffer-0.1.1.tar.gz:

Publisher: publish.yml on nathan-hoche/RepoSniffer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reposniffer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: reposniffer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for reposniffer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9be9ea049fe8901e7697a47e86bc4208d4acfa768545e1ba6f53858a875cffba
MD5 b159398b2abcf95c3eb961695981e241
BLAKE2b-256 08acfee3066254fc4ce16ad324fa907c87c31722e68132e1ad5921748a3b48d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for reposniffer-0.1.1-py3-none-any.whl:

Publisher: publish.yml on nathan-hoche/RepoSniffer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 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