About Reuse Before Generate
Reuse Before Generate is a zero-dependency MCP server and CLI that checks public code and package indexes before an AI coding assistant generates a new project or module. Its parallel searches cover repositories, package registries, and software directories.
Key features
- 01Search public repositories and package indexes
- 02Query multiple sources in parallel
- 03Return structured Markdown results
- 04Continue when a source is unavailable
- 05Run searches from the CLI
Use cases
- 01Check for an existing library before scaffolding
- 02Find desktop apps or CLI tools for an idea
- 03Compare packages across language registries
MCP support
Provides the `check_before_building` and `reuse_before_generate` tools so MCP clients can search for existing solutions before generating code.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y reuse-before-generateGITHUB_TOKENSecretOptional GitHub token. Raises the search rate limit from 10 requests/minute to 30.Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
1Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| keywords | array | Yes | REQUIRED: 3-4 precise search terms YOU infer from the description, using your own understanding of what the user actually means — do this especially when the description is vague, informal, or from a non-native speaker. Pick the concrete domain noun a maintainer would actually put in their README, not a generic category word: e.g. for 'thing that checks my code doesn't have secret keys by mistake' prefer ["git", "secrets", "detect", "leak"] over ["secret", "scanner", "detect", "git"] — 'scanner' is broad enough to pull in unrelated security-tool listicles, while 'leak'/'secrets' matches how gitleaks/trufflehog actually describe themselves. Avoid generic tooling-ecosystem words (mcp, agent, server, tool, app) unless the description has nothing more specific — they return noise (awesome-lists, unrelated MCP servers) rather than real competitors. Critically, favor the word a maintainer would use to describe WHAT THE TOOL IS over the word describing the USER'S PROBLEM: a real 'pretty JSON in the terminal' tool likely calls itself a 'viewer' or 'processor', not a 'pretty-printer'/'colorizer'; a real static-site link checker likely says it validates 'rendered HTML', not 'static site alt-text'. If your first guess doesn't match, mentally simulate the README of the tool you're picturing and pull words straight from that sentence. |
| description | string | Yes | Plain-language description of the project/module about to be built — what it does, not how. The more specific, the better the match quality. |
Details
From the project READMEreuse-before-generate
Your idea probably already exists. Find out before you build it, not after.
When you ask an AI coding assistant to build an app or module, it overenthusiastically starts scaffolding thousands of lines of code from scratch—even when battle-tested open-source libraries or maintained tools already exist.
reuse-before-generate is a zero-dependency MCP server (and CLI tool) that intercepts the AI workflow before code generation begins. It searches public code and package indexes across multiple angles, formats results as structured Markdown, and directs the AI to search the web for existing SaaS products and community discussions.
Sources checked
The server checks these sources in parallel:
| Source | What it searches |
|---|---|
| GitHub | Public repositories |
| GitLab | Public projects |
| Show HN | Hacker News product & project launches |
| Flathub | Linux desktop GUI applications |
| F-Droid | Android open-source apps & utilities |
| GNOME Extensions | Desktop shell extensions |
| Homebrew | Curated CLI utilities & formulas |
| AUR | Arch Linux tools, daemons, & scripts |
| PyPI | Python packages & utilities |
| Conda / Bioconda | Conda-forge & Bioconda packages |
| CRAN / Bioconductor | R packages & bioinformatics libraries |
| npm | JavaScript & TypeScript packages |
| crates.io | Rust crates |
| NuGet | .NET packages |
| Hugging Face | AI models & pipelines |
| Docker Hub | Public container images |
| Maven Central | Java artifacts |
| RubyGems | Ruby gems |
| Packagist | PHP packages |
All added sources use public endpoints and do not require API keys. They are queried on a best-effort basis: if one source is unavailable or rate-limited, results from the other sources are still returned. A GitHub token is optional and only raises GitHub's search rate limit.
Quick Start & Installation
No API keys required to start.
1. Claude Code CLI
claude mcp add -s user reuse-before-generate -- npx -y reuse-before-generate
2. Cursor, Claude Desktop, Antigravity, Windsurf, or VS Code
Add this to your mcpServers configuration (e.g. ~/.claude/mcp.json, ~/.gemini/antigravity-ide/mcp_config.json, or Cursor settings):
{
"mcpServers": {
"reuse-before-generate": {
"command": "npx",
"args": ["-y", "reuse-before-generate@latest"]
}
}
}
Optional: Higher GitHub API Limits
You can optionally pass a GitHub token to raise GitHub's rate limits:
{
"mcpServers": {
"reuse-before-generate": {
"command": "npx",
"args": ["-y", "reuse-before-generate@latest"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
3. Run Directly in Terminal (CLI Mode)
You can run searches directly from your shell without an MCP client:
npx reuse-before-generate "terminal markdown viewer"
# or if cloned locally:
node index.js "gnome speech to text offline"
4. Slash Command / Agent Skill
In supported AI coding assistants (Antigravity, Claude Code), you can invoke it directly via slash command:
/reuse-before-generate <project description or keywords>
🤖 Make It Automatic for AI Agents
To ensure your AI assistant checks for existing solutions before writing code, add this instruction to your CLAUDE.md, .cursorrules, GEMINI.md, or AGENTS.md:
Before scaffolding a new project or substantial new module from scratch:
1. Call `check_before_building` (or `reuse_before_generate`) from the `reuse-before-generate` MCP server.
2. Follow up with web search for existing commercial products or self-hosted tools as directed by the tool.
3. Present existing alternatives in a concise table and ask the user whether to reuse or extend an existing project instead of building from scratch.
🤖 AI Disclosure
For details on how AI is used in this project, see What I delegate to AI and what I don't.
License
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.