npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@meinzeug/mcp-ai-bug-helper

v1.2.0

Published

MCP server that routes tough coding questions through OpenRouter coding advisors.

Downloads

37

Readme


🔗 Inhaltsverzeichnis

  1. ✨ Highlights
  2. ⚡️ Schnellstart
  3. 🛠️ Tool-Flow
  4. 🤝 Codex-Integration
  5. ⚙️ Konfiguration
  6. 🏗️ Architektur
  7. 🧪 Entwicklungs-Workflow
  8. 🧩 Troubleshooting
  9. 📜 Lizenz

✨ Highlights

  • 🧠 Mehrstufige Advisor-Pipeline: 3 kostenlose OpenRouter-Codingmodelle + automatische Premium-Fallbacks bei Rate-Limits.
  • 🤖 Codex-native Instruktionen: MCP Instructions erklären dem Agent genau, wann das Tool sinnvoll ist.
  • 📉 Kosten- & Latenz-Telemetrie: Jede Antwort liefert Token-Usage + Antwortzeit direkt an Codex zurück.
  • npx-fähig: npx @meinzeug/mcp-ai-bug-helper reicht – kein Clonen erforderlich.
  • 🔐 Secretsafe: .env + dotenv für API Keys, keine versehentlichen Commits.

⚡️ Schnellstart

Option A – Zero Install via npx

export OPENROUTER_API_KEY=sk-or-v1-...   # einmalig setzen
npx @meinzeug/mcp-ai-bug-helper

Option B – Lokal entwickeln

git clone https://github.com/meinzeug/mcp-ai-bug-helper.git
cd mcp-ai-bug-helper
npm install
cp .env.example .env && $EDITOR .env   # Key eintragen
npm run dev

💡 npm run dev startet den MCP-Server via ts-node und streamt Logs – perfekt zum Debuggen.

📦 Veröffentlichtes Paket: @meinzeug/mcp-ai-bug-helper – überprüfbar mit npm view @meinzeug/mcp-ai-bug-helper.


🛠️ Tool-Flow

| Phase | Beschreibung | |-------|--------------| | 🔍 Analyse | ask-coding-advisors nimmt question + optional context entgegen (Stacktraces, Diffs, Logs). | | 🧑‍💻 Advisor-Fächer | qwen/qwen3-coder:free, qwen/qwen-2.5-coder-32b-instruct:free, agentica-org/deepcoder-14b-preview:free. | | 🚨 Fallback-Trigger | Erstes HTTP 429 schaltet auf Premium-Rotation: anthropic/claude-3.7-sonnet, mistralai/codestral-2508. | | 📊 Response-Payload | Drei unabhängige Antworten + Latency + Token-Stats + Hinweis, ob Fallback aktiv war. |

Adaptive Modellwahl

  • 🔎 Jeder Prompt wird analysiert (Keywords für React/Go/infra/LLM etc.), daraus entstehen ScenarioTags (z. B. frontend, node, go).
  • 🤖 Für jeden Tag gibt es passende Modelle mit hinterlegten Stärken und Zuverlässigkeitsskalen (platinum/gold/silver).
  • ✅ Vor jedem Call prüft der Server über GET /api/v1/models, ob das Modell beim Account verfügbar ist. Modelle mit 404/500 werden für einige Minuten automatisch gesperrt.
  • 💳 Wenn kein gesundes Free-Modell verfügbar ist oder ein 429 zurückkommt, wird automatisch auf Premium-Fallbacks (Claude, Codestral, GPT-5.1 Codex) gewechselt.
  • 🚫 Sobald die kostenlosen Modelle dauerhaft fehlschlagen (z. B. Quota aufgebraucht oder Provider-404), werden sie für den gesamten Prozess deaktiviert – alle weiteren Aufrufe laufen direkt über die kostenpflichtigen Advisors.
sequenceDiagram
    participant Codex
    participant MCP as MCP Server
    participant OR as OpenRouter
    Codex->>MCP: call ask-coding-advisors(question, context)
    loop 3 advisors
        MCP->>OR: chat(model=free[i])
        alt HTTP 429
            MCP->>OR: chat(model=paid[j])
        end
        OR-->>MCP: text + usage + latency
        MCP-->>Codex: stream advisor result
    end

🤝 Codex-Integration

  1. Server in Codex registrieren
    codex mcp add coding-advisors \
      --env "OPENROUTER_API_KEY=sk-or-v1-..." \
      npx @meinzeug/mcp-ai-bug-helper
    
    # Syntax entspricht auch anderen MCP-Beispielen wie
    # codex mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
  2. Verifizieren
    codex mcp list | grep coding-advisors
  3. Im Prompt nutzen
    • /toolsask-coding-advisors
    • oder direkt mit @ask-coding-advisors im Prompt.

📎 Wenn du lieber aus dem Repo startest: --cmd "node" --args "dist/server.js" verwenden.

Andere MCP-Clients

  • Claude Code: Anthropic beschreibt in den Claude-Code-MCP-Docs exakt den gleichen stdio-/HTTP-Mechanismus. Du kannst denselben Befehl wie oben benutzen (oder einen claude.json-Eintrag), und die Tools erscheinen dort unter /mcp bzw. @ask-coding-advisors.
  • Sonstige IDEs: Jede Umgebung, die MCP spricht (z. B. VS Code-Extensions, Cursor, Eigene Agenten), kann denselben Server starten. Wichtig ist nur, dass OPENROUTER_API_KEY gesetzt ist und der Prozess via stdio oder TCP erreichbar ist.

Schnellbefehle für gängige Clients

  • Amp CLIamp mcp add coding-advisors -- npx @meinzeug/mcp-ai-bug-helper
  • Claude Code CLIclaude mcp add coding-advisors npx @meinzeug/mcp-ai-bug-helper
  • Codex CLIcodex mcp add coding-advisors --env "OPENROUTER_API_KEY=sk-or-v1-..." npx @meinzeug/mcp-ai-bug-helper
  • Copilot CLI/mcp add → Name coding-advisors, Command npx @meinzeug/mcp-ai-bug-helper
  • VS Code / Copilotcode --add-mcp '{"name":"coding-advisors","command":"npx","args":["@meinzeug/mcp-ai-bug-helper"]}'
  • Cursor / Amp / Cline / Kiro / Qoder / Warp / Windsurf / JetBrains AI / Gemini / Droid (Factory CLI) – überall einfach denselben Command + Name übernehmen; falls der Client eine Konfigurationsdatei verlangt, setzt du command = "npx", args = ["@meinzeug/mcp-ai-bug-helper"] und ergänzt OPENROUTER_API_KEY in der jeweiligen env-Sektion. Mobile Beispiele findest du in deren MCP-Handbüchern (Links: Amp, Cline, Gemini CLI, JetBrains AI Assistant).
  • Windows 11 & Codex – falls npx Chrome oder Node aus Program Files laden muss, ergänze in ~/.codex/config.toml:
    [mcp_servers.coding-advisors]
    command = "cmd"
    args = ["/c", "npx", "@meinzeug/mcp-ai-bug-helper"]
    env = { SystemRoot="C:\\Windows", PROGRAMFILES="C:\\Program Files", OPENROUTER_API_KEY="sk-or-v1-..." }
    startup_timeout_ms = 20_000

⚙️ Konfiguration

| Variable | Pflicht | Beschreibung | |----------|---------|--------------| | OPENROUTER_API_KEY | ✅ | Persönlicher OpenRouter Key (liegt in .env). | | OPENROUTER_APP_NAME | ⛔ optional | Eigener Analytics-Tag (Default: MCP AI Bug Helper). | | OPENROUTER_REFERRER | ⛔ optional | Referrer-URL für OpenRouter-Dashboard. |

.env.example liefert ein Template. Für Mehrfach-Workspaces einfach mehrere .env Dateien pflegen und vor dem Start sourcen.


🏗️ Architektur

  • Transport: @modelcontextprotocol/sdk + StdioServerTransport
  • Domainlogik: CodingAdvisorCoordinator orchestriert freie + paid Modelle.
  • HTTP-Layer: OpenRouterClient (native fetch, Retry auf Rate-Limits, Usage-Mapping).
  • Config: config.ts liest .env, assertConfig() schützt vor fehlendem Key.
  • Packaging: Scoped npm Modul, bindist/server.js, prepare/postbuild erzeugen ausführbares Artefakt.
src/
├─ server.ts            # MCP Bootstrap + Tool Definition
├─ codingAdvisors.ts    # Sequencer + Fallback-Rotation
├─ openrouterClient.ts  # REST Wrapper + Error Handling
├─ modelCatalog.ts      # Liste freier & paid Modelle
├─ config.ts            # dotenv + Validation
└─ errors.ts / types.ts # Hilfsklassen & DTOs

🧪 Entwicklungs-Workflow

| Script | Zweck | |--------|-------| | npm run dev | MCP Server mit ts-node (Logs in Echtzeit). | | npm run build | TypeScript Build + .d.ts + Sourcemaps + postbuild chmod. | | npm run typecheck | Schneller TS-Check ohne Emit. | | npm start | Führt das gebaute CLI (dist/server.js). | | npm run scenarios | Führt reale OpenRouter-Tests auf mehreren Debug-Szenarien aus (filterbar via SCENARIO=react). |

Bei Veröffentlichung sorgt npm publish automatisch für frische Builds (via prepare).


🧩 Troubleshooting

  • Missing OPENROUTER_API_KEY.env nicht geladen? Terminal neu starten oder source .env.
  • 429 Too Many Requests – Die App schwenkt automatisch auf die Premiumliste. Wenn alles blockiert ist, hilft nur Warten oder eigener OpenRouter-Plan.
  • codex mcp add ... schlägt fehl – Prüfe, ob codex Zugriff auf npx hat (Pfad) oder wechsle auf direkten node dist/server.js Befehl.
  • Keine Antworten im Codex-UInpm run dev separat starten und schauen, ob Requests ankommen (stdout).

📜 Lizenz

MIT © meinzeug – Mit Liebe für MCP + Codex gebaut. Contributions willkommen! 🎉