reuse-before-generate

reuse-before-generate

Stop your AI agent from rebuilding what already exists. MCP server that checks GitHub, npm and Python repos for maintained alternatives before you scaffold.

Category
Visit Server

README

reuse-before-generate

npm CI license reuse-before-generate MCP server

Your idea probably already exists. Find out before you build it, not after.

Here is how it usually goes. You have an idea. You ask a frontier model what it thinks, and it tells you the space is wide open and people would love it. So you tell your agent to build it, and it writes thousands of lines for something that already exists.

That happened to me. I kept hitting the same failing Android CI build, waiting for a re-run, hitting it again. I thought: someone should be able to pause the build and get a shell inside it. I asked an AI, it told me this was a genuinely good idea, and I built fermata.

Then I found action-tmate. 3,566 stars. Does exactly that. Has for years.

This server is the check I wish I'd run. Ask your agent to build something and it looks first:

Before building — this already exists:

  1. action-tmate (3,566★, updated today) — "Debug your GitHub Actions via SSH by using tmate to get access to the runner system itself."

Actively maintained and widely used. Want to try it, or is there something yours would do differently?

Sometimes the answer really is "mine is different, keep going." Sometimes it saves you a weekend. Either way you find out in ten seconds instead of after.

Why bother: fewer wasted hours, fewer abandoned projects nobody uses, and less energy burned generating code that already exists. Jenna Pederson put the general case well in You Can Build It, But Should You? — AI removed the friction that used to force you to ask whether something is worth building at all.

For the record, this tool did not survive its own test either! But I had to build it to find out. Hopefully it will prevent me from doing it again.

Install

No API key. No account. Nothing to configure.

claude mcp add reuse-before-generate -- npx -y reuse-before-generate

Then start a new session and try it on an idea of your own — the one you were about to build.

Or add it to .mcp.json yourself — this works in Cursor, Claude Desktop, and any other MCP client:

{
  "mcpServers": {
    "reuse-before-generate": {
      "command": "npx",
      "args": ["-y", "reuse-before-generate"]
    }
  }
}

Optional but recommended: add a GitHub token. Without one, GitHub limits you to 10 searches a minute; with one, 30.

{
  "mcpServers": {
    "reuse-before-generate": {
      "command": "npx",
      "args": ["-y", "reuse-before-generate"],
      "env": { "GITHUB_TOKEN": "ghp_your_token_here" }
    }
  }
}

Running from source

git clone https://github.com/aradar46/reuse-before-generate
cd reuse-before-generate
npm install && npm run build
claude mcp add reuse-before-generate -- node "$PWD/dist/index.js"

Make it automatic

By default your agent only checks when you ask it to. To make it check every time, paste this into your CLAUDE.md (or .cursorrules):

Before scaffolding a new project or a substantial new module, call
`check_before_building` first. If it finds a maintained alternative that
really does the job, tell me about it and ask whether to extend that
instead of building from scratch.

That one paragraph is the whole point of the tool. Without it, the check only happens when you remember to ask.

Does it actually work?

It's measured, not vibes. There are 12 test cases with known right answers — "find gitleaks from a description of a secret scanner", that sort of thing — and the search is scored on what position the right answer comes back at.

Current scores:

Found the right tool in the top 10 11 of 11
Found it in the top 5 10 of 11
Made something up when nothing existed never

The last row matters most. A tool that reports matches for everything is useless, so one test case describes something no real tool does. It correctly returns nothing.

Details, including where it still fails, are in docs/findings.md.

Settings

There's one setting worth knowing about: GITHUB_TOKEN. Without it GitHub allows 10 searches a minute, with it 30. Set it in the env block shown in Install.

It also keeps a local count of its own usage in ~/.reuse-before-generate/events.jsonl — a random ID, a timestamp, and how many results came back. Nothing is sent anywhere. See local state to read or disable it, and all environment variables for the rest.

Where it still falls short

Honest list, because you'll hit these:

  • Bad search terms miss real tools. If you describe a JSON viewer as a "pretty-printer", it may find nothing — real ones call themselves "viewers". The agent is told to think about how a maintainer would describe their own tool, but it doesn't always get it right.
  • Very small or oddly-named repos are hard to find. GitHub's own search buries them. There's a dedicated search lane for this and it helps, but doesn't fully solve it.
  • "Maintained" just means "touched in the last year." It doesn't check whether issues get answered or whether the project is actually healthy.

All measured and written up in docs/findings.md.

More

  • How it works — the pipeline, and why the server never calls an LLM itself
  • Findings — what's been measured, and what's still broken
  • Contributing — tests, local CLI, eval

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured