reuse-before-generate
A zero-dependency MCP server/CLI that checks for existing open-source projects and competing products before you build something new, helping AI agents reuse rather than generate code.
Intercepts the AI workflow before scaffolding with tools
check_before_buildingandreuse_before_generate.Searches GitHub, GitLab, npm, crates.io, NuGet, Hugging Face, Docker Hub, Maven Central, RubyGems, and Packagist in parallel.
Returns reusable projects, competing products, and retrieval evidence for the agent to judge relevance.
Uses best-effort public endpoints with no API keys required; optional GitHub token raises rate limits.
Requires the caller to supply precise keywords and a plain-language description for quality results.
Supports optional structured intent: category, outcome, synonyms, constraints, priorities, and artifact type (application, service, CLI, library).
Can be run as an MCP server configured in Claude Code, Cursor, Claude Desktop, VS Code, Windsurf, or Antigravity, or directly in the terminal via
npx reuse-before-generate "query".Designed to be automated by adding instructions to CLAUDE.md, .cursorrules, GEMINI.md, or AGENTS.md so agents always check before building.
Searches GitHub for existing repositories that match the project idea, helping to find reusable open-source code or competing products.
Searches GitLab repositories for existing open-source projects relevant to the user's query.
Searches npm registry for existing packages that could be reused or indicate competitors.
Searches Python Package Index for existing packages that may serve the same purpose.
Searches RubyGems for existing libraries that could be alternatives.
reuse-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 |
npm | JavaScript packages |
crates.io | Rust crates |
NuGet | .NET packages |
Hugging Face | Public models |
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-generate2. 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"Related MCP server: idea-reality-mcp
🤖 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
Available Tools
2 toolscheck_before_buildingA
Run before building from scratch. Searches GitHub, GitLab, npm, crates.io, NuGet, Hugging Face, Docker Hub, Maven Central, RubyGems, and Packagist across multiple query angles to find existing codebases, and provides targeted web search queries for finding commercial SaaS competitors.
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search query or project description | |
| queries | No | RECOMMENDED: 2-4 distinct technical search queries / keywords maintainers would use (e.g. ['gnome speech to text', 'gnome whisper dictation', 'linux offline voice typing']). | |
| keywords | No | Optional search keywords | |
| description | No | Description of what you want to build |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It names the exact registries covered, notes that multiple query angles are used, and states that it also generates targeted web search queries for competitor research. It stops short of describing the return format or error/edge-case behavior, but it is substantially transparent for a read-oriented search tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one focused, front-loaded sentence with no filler: the usage trigger comes first, followed by the precise scope. The long list of registries is justified because it defines the tool's coverage and prevents confusion with sibling tools.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a discovery tool with no output schema, the description explains what it searches and partially what it returns ('provides targeted web search queries'). However, it does not specify the format or nature of the codebase-search results, nor does it address how this tool relates to reuse_before_generate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all four parameters. The description adds only a general hint about 'multiple query angles,' which explains how queries are used at a high level but does not add detail beyond the schema's parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's action and resource: it runs before building from scratch, searches a specific set of code registries, and finds existing codebases. It does not explicitly contrast itself with reuse_before_generate, so sibling differentiation is only implicit rather than named.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The opening phrase gives an explicit trigger condition: 'Run before building from scratch.' This tells the agent when to use the tool, but it does not provide explicit when-not-to-use guidance or name the sibling as an alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
reuse_before_generateA
Run before building from scratch. Searches GitHub, GitLab, npm, crates.io, NuGet, Hugging Face, Docker Hub, Maven Central, RubyGems, and Packagist across multiple query angles to find existing codebases, and provides targeted web search queries for finding commercial SaaS competitors.
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search query or project description | |
| queries | No | RECOMMENDED: 2-4 distinct technical search queries / keywords maintainers would use (e.g. ['gnome speech to text', 'gnome whisper dictation', 'linux offline voice typing']). | |
| keywords | No | Optional search keywords | |
| description | No | Description of what you want to build |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the search spans many registries 'across multiple query angles' and that it 'provides targeted web search queries'—useful behavioral traits. However, it does not state whether the operation is read-only, whether it makes external network calls, or what the result structure looks like. This is a moderate gap for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no filler. The imperative instruction is front-loaded, and the platform list is compact yet specific. Every phrase earns its place; there is no redundant restating of the tool name or schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers input intent, scope, and one output aspect (web search queries for competitors), but it does not explain what the agent will actually receive back (e.g., a list of repos, links, scores). With no output schema and no annotations, this missing return-value information is a clear gap for correct invocation and result handling.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all four parameters. The description adds general context (e.g., multiple query angles, competitor search) but does not add specific syntax, defaults, or parameter relationships beyond what the schema provides. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('Run before building from scratch') and resource ('Searches GitHub, GitLab, npm...') with a clear purpose: finding existing codebases and providing competitor-search queries. This fully distinguishes it from the sibling 'check_before_building' by focusing on reuse rather than validation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The first phrase 'Run before building from scratch' gives an explicit when-to-use signal. It does not name alternatives or exclusions, but the context is clear enough for an agent to select this tool at the appropriate stage. Slight deduction for not contrasting with check_before_building.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.2.5- Changed
check_before_building18 fields changed- removed
Input schema / $schemaRemoved value: -"http://json-schema.org/draft-07/schema#" - removed
Input schema / additionalPropertiesRemoved value: -false - changed
Input schema / properties / description / descriptionPrevious value: -"Plain-language description of the project/module about to be built — what it does, not how. The more specific, the better the match quality."New value: +"Description of what you want to build" - removed
Input schema / properties / description / minLengthRemoved value: -10 - changed
Input schema / properties / keywords / descriptionPrevious value: -"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."New value: +"Optional search keywords" - removed
Input schema / properties / keywords / itemsRemoved value: -{ - "type": "string" -} - removed
Input schema / properties / keywords / maxItemsRemoved value: -6 - removed
Input schema / properties / keywords / minItemsRemoved value: -3 - added
Input schema / properties / keywords / oneOfAdded value: +[ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "string" + } +] - removed
Input schema / properties / keywords / typeRemoved value: -"array" - removed
Input schema / properties / queries / additionalPropertiesRemoved value: -false - changed
Input schema / properties / queries / descriptionPrevious value: -"Optional high-quality intent inferred semantically by the calling agent: category names what this is, outcome says what it accomplishes, synonyms supplies distinct terminology maintainers or product makers may use, constraints supplies up to 8 must-have properties, priorities supplies up to 4 ordered preferences, and artifactType says whether the desired result is an application, hosted service, CLI, or library. Older callers may omit these optional fields; the server will infer conservative fallbacks."New value: +"RECOMMENDED: 2-4 distinct technical search queries / keywords maintainers would use (e.g. ['gnome speech to text', 'gnome whisper dictation', 'linux offline voice typing'])." - added
Input schema / properties / queries / itemsAdded value: +{ + "type": "string" +} - removed
Input schema / properties / queries / propertiesRemoved value: -{ - "artifactType": { - "enum": [ - "application", - "service", - "cli", - "library" - ], - "type": "string" - }, - "category": { - "minLength": 2, - "type": "string" - }, - "constraints": { - "items": { - "minLength": 2, - "type": "string" - }, - "maxItems": 8, - "type": "array" - }, - "outcome": { - "minLength": 2, - "type": "string" - }, - "priorities": { - "description": "Ordered preferences from most important to least important, such as [\"Android\", \"iOS\"]. Both can appear in results, but earlier entries receive more ranking weight.", - "items": { - "minLength": 2, - "type": "string" - }, - "maxItems": 4, - "type": "array" - }, - "synonyms": { - "minLength": 2, - "type": "string" - } -} - removed
Input schema / properties / queries / requiredRemoved value: -[ - "category", - "outcome", - "synonyms" -] - changed
Input schema / properties / queries / typePrevious value: -"object"New value: +"array" - added
Input schema / properties / queryAdded value: +{ + "description": "Search query or project description", + "type": "string" +} - removed
Input schema / requiredRemoved value: -[ - "description", - "keywords" -]
- Changed
reuse_before_generate18 fields changed- removed
Input schema / $schemaRemoved value: -"http://json-schema.org/draft-07/schema#" - removed
Input schema / additionalPropertiesRemoved value: -false - changed
Input schema / properties / description / descriptionPrevious value: -"Plain-language description of the project/module about to be built — what it does, not how. The more specific, the better the match quality."New value: +"Description of what you want to build" - removed
Input schema / properties / description / minLengthRemoved value: -10 - changed
Input schema / properties / keywords / descriptionPrevious value: -"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."New value: +"Optional search keywords" - removed
Input schema / properties / keywords / itemsRemoved value: -{ - "type": "string" -} - removed
Input schema / properties / keywords / maxItemsRemoved value: -6 - removed
Input schema / properties / keywords / minItemsRemoved value: -3 - added
Input schema / properties / keywords / oneOfAdded value: +[ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "string" + } +] - removed
Input schema / properties / keywords / typeRemoved value: -"array" - removed
Input schema / properties / queries / additionalPropertiesRemoved value: -false - changed
Input schema / properties / queries / descriptionPrevious value: -"Optional high-quality intent inferred semantically by the calling agent: category names what this is, outcome says what it accomplishes, synonyms supplies distinct terminology maintainers or product makers may use, constraints supplies up to 8 must-have properties, priorities supplies up to 4 ordered preferences, and artifactType says whether the desired result is an application, hosted service, CLI, or library. Older callers may omit these optional fields; the server will infer conservative fallbacks."New value: +"RECOMMENDED: 2-4 distinct technical search queries / keywords maintainers would use (e.g. ['gnome speech to text', 'gnome whisper dictation', 'linux offline voice typing'])." - added
Input schema / properties / queries / itemsAdded value: +{ + "type": "string" +} - removed
Input schema / properties / queries / propertiesRemoved value: -{ - "artifactType": { - "enum": [ - "application", - "service", - "cli", - "library" - ], - "type": "string" - }, - "category": { - "minLength": 2, - "type": "string" - }, - "constraints": { - "items": { - "minLength": 2, - "type": "string" - }, - "maxItems": 8, - "type": "array" - }, - "outcome": { - "minLength": 2, - "type": "string" - }, - "priorities": { - "description": "Ordered preferences from most important to least important, such as [\"Android\", \"iOS\"]. Both can appear in results, but earlier entries receive more ranking weight.", - "items": { - "minLength": 2, - "type": "string" - }, - "maxItems": 4, - "type": "array" - }, - "synonyms": { - "minLength": 2, - "type": "string" - } -} - removed
Input schema / properties / queries / requiredRemoved value: -[ - "category", - "outcome", - "synonyms" -] - changed
Input schema / properties / queries / typePrevious value: -"object"New value: +"array" - added
Input schema / properties / queryAdded value: +{ + "description": "Search query or project description", + "type": "string" +} - removed
Input schema / requiredRemoved value: -[ - "description", - "keywords" -]
2 tool updates
v0.2.4- Changed
check_before_building1 field changed- added
Input schema / properties / queriesAdded value: +{ + "additionalProperties": false, + "description": "Optional high-quality intent inferred semantically by the calling agent: category names what this is, outcome says what it accomplishes, synonyms supplies distinct terminology maintainers or product makers may use, constraints supplies up to 8 must-have properties, priorities supplies up to 4 ordered preferences, and artifactType says whether the desired result is an application, hosted service, CLI, or library. Older callers may omit these optional fields; the server will infer conservative fallbacks.", + "properties": { + "artifactType": { + "enum": [ + "application", + "service", + "cli", + "library" + ], + "type": "string" + }, + "category": { + "minLength": 2, + "type": "string" + }, + "constraints": { + "items": { + "minLength": 2, + "type": "string" + }, + "maxItems": 8, + "type": "array" + }, + "outcome": { + "minLength": 2, + "type": "string" + }, + "priorities": { + "description": "Ordered preferences from most important to least important, such as [\"Android\", \"iOS\"]. Both can appear in results, but earlier entries receive more ranking weight.", + "items": { + "minLength": 2, + "type": "string" + }, + "maxItems": 4, + "type": "array" + }, + "synonyms": { + "minLength": 2, + "type": "string" + } + }, + "required": [ + "category", + "outcome", + "synonyms" + ], + "type": "object" +}
- Added
reuse_before_generate
1 tool update
v0.2.3- First observed
check_before_building
TDQS
Scored across 2 tools
Both tools have identical descriptions and perform the exact same search across the same registries. There is no way for an agent to distinguish between them, making misselection certain.
Both names follow a snake_case verb_noun pattern, but the verbs 'check' and 'reuse' are synonyms in this context, and the nouns 'building' and 'generate' are also synonymous. The consistent pattern does not help because the semantics are essentially the same.
With only 2 tools that duplicate the same functionality, the server is severely under-scoped. A single tool would suffice, or the server should provide a broader set of distinct capabilities.
The server's entire surface is one search operation offered twice. There are no complementary tools (e.g., to process results, filter, or initiate generation), leaving the domain coverage incomplete and redundant.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Find, compare, and audit software for AI agents. Scored registry of tools and MCP servers.
Search GitHub, npm, PyPI, StackOverflow, ArXiv from one MCP — built for coding agents.
Finds real, maintained open-source repos that fit your project. MCP grounding for coding agents.
Related MCP Servers
- MIT
- AlicenseAqualityCmaintenancePre-build reality check for AI coding agents. Scans GitHub, Hacker News, npm, PyPI & Product Hunt in parallel — returns a 0-100 reality signal with real competitor data.163 PyPI821MIT
- FlicenseAqualityDmaintenancePackage intelligence MCP server. Stops AI agents from installing hallucinated/malicious packages across 17 ecosystems. 22 tools, free, no auth.221-
- AlicenseNot gradedqualityBmaintenanceCombines GitHub repository analysis, npm/PyPI package info, and deps.dev security advisories into a single MCP server, requiring no API keys.MIT