ai newsMi., 25. Nov.
EilmeldungYale’s Sonnenfeld: Nvidia is a ‘detriment’ to U.S. industrial might — not a champion

Produktionsfehler mit Claude Code via MCP triagieren

Mit zwei Aenderungen lassen sich Sentry-Fehler aus einer Next.js-App direkt an Claude Code uebergeben: der DSN wird angepasst und Bugslys MCP-Server per Kommandozeile angebunden. Der Server stellt 16 Tools bereit, von denen die meisten nur lesend zugreifen.

dev.toDienstag 10:30 · 24.11.DE7 Min. Lesezeit
Bild: dev.to

Veröffentlicht am 24. Nov. • Ursprünglich veröffentlicht auf bugsly.dev • KI-unterstützt

Wir entwickeln Bugsly, einen gehosteten Error-Tracker, der Sentry-SDK-Events entgegennimmt. Dieser Beitrag ist der kürzeste Weg von "Fehler häufen sich" zu "mein Coding-Agent hat den obersten gelesen".

Eine DSN ist eine URL, die dem SDK mitteilt, wohin Events gesendet werden sollen. Die von Bugsly hat die Form https://<public_key>@bugsly.dev/<project_id> (das Format ist in Bugslys test-event.ts und auf der Migrationsseite dokumentiert). Wenn deine App bereits @sentry/nextjs nutzt, ändere nur den Wert:

#.env.local (der Variablenname ist der, den dein Sentry.init liest) NEXT_PUBLIC_SENTRY_DSN = https:// < public_key > @bugsly.dev/ < project_id > Vollbildmodus öffnen Vollbildmodus beenden // instrumentation-client.ts (unverändert, abgesehen davon, wohin die DSN zeigt) import * as Sentry from "@sentry/nextjs"; Sentry. init ( { dsn: process. env. NEXT_PUBLIC_SENTRY_DSN, tracesSampleRate: 0.2, } ); export const onRouterTransitionStart = Sentry. captureRouterTransitionStart; Vollbildmodus öffnen Vollbildmodus beenden So ist auch Bugslys eigenes Dashboard verkabelt: frontend/instrumentation-client.ts importiert @sentry/nextjs und liest NEXT_PUBLIC_SENTRY_DSN, und es läuft mit @sentry/nextjs ^10.68.0. Ich habe v11 nicht getestet (npms neueste Version ist heute 11.14.0).

Source Maps laufen über sentry-cli mit SENTRY_URL=https://bugsly.dev; die Migrationsanleitung enthält die Befehle.

Startest du ohne Sentry? Die Setup-Seite bietet npm install @bugsly/nextjs, das @sentry/nextjs ummantelt, sowie einen Tab "Ask your AI" mit einem Prompt, mit dem dein Agent dein Framework selbst herausfinden kann.

Um zu beweisen, dass Events ankommen, wirf absichtlich einen, zum Beispiel eine Route, die throw new Error("Hello from Bugsly!") ausführt, und öffne ihn. Prüfe dann das Issue im Dashboard. Ohne SDK getestet: Am 19.11.2026 habe ich ein Event an ein Wegwerfprojekt mit dem curl-Envelope von der Setup-Seite gesendet (HTTP 200), und es erschien als Issue (siehe die aufgezeichnete Session). Von mir ungetestet: eine Next.js-App mit @sentry/nextjs, die das Event selbst sendet.

Öffne in Bugsly dein Projekt, dann Settings → AI Agent / MCP → Generate Token. Das Token beginnt mit bgs_, ist 90 Tage gültig, tritt als dein Benutzer in jeder Organisation auf, der du angehörst, und kann auf derselben Seite widerrufen werden. Es wird nur einmal angezeigt; Bugsly speichert nur einen Hash.

Lieber ohne Token? Der gehostete Server nutzt stattdessen OAuth (siehe unten den Schritt für Claude Code).

claude mcp add bugsly -e BUGSLY_TOKEN = YOUR_BUGSLY_TOKEN -- npx -y @bugsly/mcp-server claude mcp list Vollbildmodus öffnen Vollbildmodus beenden Was ich am 18.11.2026 sah, Claude Code 2.1.322, in einem Wegwerf-Home-Verzeichnis mit einem Platzhalter-Token:

Added stdio MCP server bugsly with command: npx -y @bugsly/mcp-server to local config... bugsly: npx -y @bugsly/mcp-server - ✔ Connected Vollbildmodus öffnen Vollbildmodus beenden ✔ Connected beweist, dass das Paket heruntergeladen, gestartet wird und MCP spricht. Es beweist nicht, dass das Token gültig ist; ein ungültiges schlägt später fehl, wenn ein Tool die API aufruft. Der Befehl speichert den Server für das aktuelle Projekt; füge --scope user hinzu, um ihn für alle Projekte zu nutzen.

Die gehostete Alternative braucht keine Installation und kein Token in einer Datei:

claude mcp add --transport http bugsly https://bugsly.dev/api/mcp Vollbildmodus öffnen Vollbildmodus beenden Führe danach /mcp in Claude Code aus und melde dich an. Vor der Anmeldung zeigte claude mcp list bugsly-remote: https://bugsly.dev/api/mcp (HTTP) -! Needs authentication, was korrekt ist. Ein schlichtes curl -X POST https://bugsly.dev/api/mcp liefert HTTP 401 mit einem WWW-Authenticate-Header, der auf die OAuth-Metadaten verweist. Die OAuth-Anmeldung selbst ist ungetestet (sie braucht einen Browser und ein echtes Konto). Wenn du lieber ein Token an den gehosteten Endpunkt senden möchtest, füge --header "Authorization: Bearer YOUR_BUGSLY_TOKEN" hinzu; mit einem erfundenen Wert erhielt ich Failed to connect... HTTP 401... invalid_token, ein falsches Token wird also klar gemeldet.

Um die Konfiguration mit deinem Team zu teilen, nutze.mcp.json und halte das Token aus git heraus:

{ "mcpServers": { "bugsly": { "command": "npx", "args": [ "-y", "@bugsly/mcp-server" ], "env": { "BUGSLY_TOKEN": "${BUGSLY_TOKEN}" } } } } Vollbildmodus öffnen Vollbildmodus beenden In meinem Test führte Claude Code diesen Server als Pending approval auf (claude ausführen zum Freigeben): projektbezogene Server brauchen eine einmalige Freigabe. Ich bin nicht weiter vorgegangen.

~/.cursor/mcp.json für alle Projekte oder.cursor/mcp.json für eines:

{ "mcpServers": { "bugsly": { "command": "npx", "args": [ "-y", "@bugsly/mcp-server" ], "env": { "BUGSLY_TOKEN": "YOUR_BUGSLY_TOKEN" } } } } Vollbildmodus öffnen Vollbildmodus beenden Claude Desktop (ungetestet) Settings → Developer → Edit Config öffnet claude_desktop_config.json ( ~/Library/Application Support/Claude/ unter macOS, %APPDATA%\Claude\ unter Windows). Füge denselben Block wie für Cursor ein und starte die App neu.

Die Cursor- und Claude-Desktop-Snippets stammen aus der README des Pakets und sind dasselbe JSON wie der.mcp.json-Eintrag für Claude Code, den Claude Code erkannte. Ich habe keine der beiden Apps geöffnet.

Beginne mit Fragen, die nichts ändern können. Dieser Prompt steht auf Bugslys eigener MCP-Seite:

Use Bugsly to read the most frequent unresolved issue, find the failing line in this repository, and propose a fix. Do not change the issue's status. Vollbildmodus öffnen Vollbildmodus beenden Dahinter sollte der Agent in dieser Reihenfolge aufrufen (Argumente aus backend/app/mcp/tools.json):

Bugsly schreibt den Patch nicht. Dein Agent liest den Stacktrace und den Code in deinem Repository; du prüfst den Diff. Bei meiner manuellen Triage unserer 12 größten Issues brauchte etwa ein Fünftel des Fehleraufkommens nur eine Codeänderung (siehe den Beitrag zu den 16 Apps); der Rest brauchte Konfiguration oder Infrastruktur. Das war keine Agent-Session, und ich habe die Fix-Rate eines Agents nicht gemessen.

Alle 16 Tools, gruppiert danach, was sie mit deinen Daten tun können:

Aufgezeichnet am 19.11.2026 (UTC), @bugsly/mcp-server 0.5.2 aus npm. Ich legte ein Wegwerfprojekt mit der dokumentierten Agent-Registrierung an ( POST /api/v1/auth/agent-signup, HTTP 201), sendete einen Fehler mit dem öffentlichen curl-Envelope (HTTP 200), wartete sechs Sekunden, startete dann npx -y @bugsly/mcp-server und rief aus einem kleinen Node-Skript, das JSON-RPC über stdio spricht, drei Tools auf. Der Fehler ist ein realistischer erfundener (ein TypeError in einem Checkout-Handler), nicht der eines echten Kunden.

Das Token wird nicht angezeigt; der DSN-Schlüssel ist durch <public_key> ersetzt. Die vollständige Ausgabe ist unter bugsly.dev/data/claude-code-triage-transcript-2026-11-19.txt veröffentlicht, wortgetreu bis auf einen zweizeiligen Header und den DSN-Schlüssel, der ersetzt wurde; hier unten ist sie an markierten Stellen gekürzt.... Event-Zeitstempel stammen vom Client, der den Envelope gesendet hat, hier curl, nicht von Bugslys Uhr.

Eine Falle aus meinem eigenen Setup: Meine ersten beiden Versuche gaben version: 0.3.0 und ungefilterte Ausgabe aus, weil meine npm-Konfiguration min-release-age = 7 enthielt, wodurch npx Releases übersprang, die jünger als sieben Tage waren. Wenn npx -y @bugsly/mcp-server eine alte Version meldet, prüfe npm config get min-release-age.

Fehler-Events sind Text, geschrieben von deinen Nutzern und von jedem, der deine DSN kennt. Eine feindselige Zeichenkette in einer Fehlermeldung könnte versuchen, deinem Agent Anweisungen zu geben. Die README des Pakets sagt, dass Tools, die Event-Text zurückgeben, diesen in <untrusted_event_data>-Tags verpacken, auf 60.000 Zeichen begrenzen, aus get_issue_events Nutzer-E-Mail, IP, Nutzernamen und zusätzliche Daten entfernen, die Nutzer-ID hashen und Query-Strings aus Request-URLs streichen, und dass der Server den Agent anweist, zu fragen, bevor er irgendetwas auflöst, ignoriert oder erstellt. Ich habe das im Code und in der bestandenen Testsuite nachgelesen, und die aufgezeichnete Session oben zeigt den Wrapper und die entfernten Nutzerfelder; ich habe es nicht angegriffen.

Praktische Regeln: Lasse resolve_issue und ignore_issue hinter dem Bestätigungsdialog deines Clients und widerrufe Token, die du nicht mehr nutzt. Der gehostete Server begrenzt jeden Nutzer auf 60 Tool-Aufrufe pro Minute.

Der Server ist ein gewöhnlicher stdio-MCP-Server, daher sollte jeder Client funktionieren, der npx -y @bugsly/mcp-server mit einer Umgebungsvariable starten kann. Claude Code ist der einzige echte Client, den ich getestet habe, und nur für Installation und Verbindung; die aufgezeichnete Triage nutzte ein Skript als Client.

Nein. Bugsly akzeptiert Sentry-SDK-Envelopes, also änderst du die DSN und behältst das SDK. Die Kompatibilität ist eine Teilmenge, nicht alles: Bugsly hat kein SSO oder SAML, keine Minidump-Ingestion und keinen historischen Import aus Sentry. Sentry ist eine Marke ihres Eigentümers; Bugsly steht in keiner Verbindung zu Sentry und wird von Sentry nicht unterstützt.

Der gehostete Server erlaubt dir, den Zugriff zu widerrufen, ohne eine geheime Datei zu verwalten. Das lokale Paket läuft auf deiner Maschine über stdio und funktioniert in Clients, die keine URL aufrufen können. Beide lesen dieselbe Tool-Definition und stellen also dieselben 16 Tools bereit.

Ich zitiere hier keine Limits, weil sie sich ändern; siehe bugsly.dev/pricing. Wenn eine Organisation keinen aktiven Plan oder keine Testphase hat, antwortet die API mit HTTP 402 und dem Code trial_required, und die README des Repositorys weist Agents an, es nicht erneut zu versuchen, sondern dir Bescheid zu geben.

Token laufen nach 90 Tagen ab. Erstelle ein neues unter Settings → AI Agent / MCP und aktualisiere BUGSLY_TOKEN.

Es kann ein Projekt erstellen ( create_project ), und get_checkout_url liefert einen Link zur Abrechnungsseite. Keines davon verursacht Kosten; eine Person muss auf dieser Seite Bedingungen akzeptieren. Es gibt kein Tool, um Projekte zu löschen, Alert-Regeln zu bearbeiten oder Monitore zu erstellen.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

Posted on Nov 24 • Originally published at bugsly.dev • AI-assisted

We build Bugsly, a hosted error tracker that accepts Sentry SDK events. This post is the shortest path from "errors are piling up" to "my coding agent has read the top one".

A DSN is a URL that tells the SDK where to send events. Bugsly's has the form https://<public_key>@bugsly.dev/<project_id> (the format is documented in Bugsly's test-event.ts and on the migration page). If your app already runs @sentry/nextjs, change only the value:

#.env.local (the variable name is whatever your Sentry.init reads) NEXT_PUBLIC_SENTRY_DSN = https:// < public_key > @bugsly.dev/ < project_id > Enter fullscreen mode Exit fullscreen mode // instrumentation-client.ts (unchanged apart from where the DSN points) import * as Sentry from "@sentry/nextjs"; Sentry. init ( { dsn: process. env. NEXT_PUBLIC_SENTRY_DSN, tracesSampleRate: 0.2, } ); export const onRouterTransitionStart = Sentry. captureRouterTransitionStart; Enter fullscreen mode Exit fullscreen mode That is how Bugsly's own dashboard is wired: frontend/instrumentation-client.ts imports @sentry/nextjs and reads NEXT_PUBLIC_SENTRY_DSN, and it runs @sentry/nextjs ^10.68.0. I have not tested v11 (npm's latest is 11.14.0 today).

Source maps go through sentry-cli with SENTRY_URL=https://bugsly.dev; the migration guide has the commands.

Starting without Sentry? The setup page offers npm install @bugsly/nextjs, which wraps @sentry/nextjs, and an "Ask your AI" tab with a prompt that lets your agent work out your framework itself.

To prove events arrive, throw one on purpose, for example a route that does throw new Error("Hello from Bugsly!"), and open it. Then check the issue in the dashboard. Tested without the SDK: on 2026-11-19 I sent one event to a throwaway project with the curl envelope from the setup page (HTTP 200), and it appeared as an issue (see the recorded run). Untested by me: a Next.js app with @sentry/nextjs sending the event itself.

In Bugsly open your project, then Settings → AI Agent / MCP → Generate Token. The token starts with bgs_, lasts 90 days, acts as your user in every organization you belong to, and can be revoked on the same page. It is shown once; Bugsly stores only a hash.

Prefer no token? The hosted server uses OAuth instead (see the Claude Code step below).

claude mcp add bugsly -e BUGSLY_TOKEN = YOUR_BUGSLY_TOKEN -- npx -y @bugsly/mcp-server claude mcp list Enter fullscreen mode Exit fullscreen mode What I saw on 2026-11-18, Claude Code 2.1.322, in a throwaway home directory with a placeholder token:

Added stdio MCP server bugsly with command: npx -y @bugsly/mcp-server to local config... bugsly: npx -y @bugsly/mcp-server - ✔ Connected Enter fullscreen mode Exit fullscreen mode ✔ Connected proves the package downloads, starts and speaks MCP. It does not prove the token is valid; a bad one fails later, when a tool calls the API. The command saves the server for the current project; add --scope user for all projects.

The hosted alternative needs no install and no token in a file:

claude mcp add --transport http bugsly https://bugsly.dev/api/mcp Enter fullscreen mode Exit fullscreen mode Then run /mcp inside Claude Code and sign in. Before signing in, claude mcp list showed bugsly-remote: https://bugsly.dev/api/mcp (HTTP) -! Needs authentication, which is correct. A plain curl -X POST https://bugsly.dev/api/mcp returns HTTP 401 with a WWW-Authenticate header pointing at the OAuth metadata. The OAuth sign-in itself is untested (it needs a browser and a real account). If you would rather send a token to the hosted endpoint, add --header "Authorization: Bearer YOUR_BUGSLY_TOKEN"; with a fake value I got Failed to connect... HTTP 401... invalid_token, so a wrong token is reported clearly.

To share the config with your team, use.mcp.json and keep the token out of git:

{ "mcpServers": { "bugsly": { "command": "npx", "args": [ "-y", "@bugsly/mcp-server" ], "env": { "BUGSLY_TOKEN": "${BUGSLY_TOKEN}" } } } } Enter fullscreen mode Exit fullscreen mode In my test Claude Code listed this server as Pending approval (run claude to approve): project-scoped servers need a one-time approval. I did not go further.

~/.cursor/mcp.json for all projects, or.cursor/mcp.json for one:

{ "mcpServers": { "bugsly": { "command": "npx", "args": [ "-y", "@bugsly/mcp-server" ], "env": { "BUGSLY_TOKEN": "YOUR_BUGSLY_TOKEN" } } } } Enter fullscreen mode Exit fullscreen mode Claude Desktop (untested) Settings → Developer → Edit Config opens claude_desktop_config.json ( ~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows). Paste the same block as for Cursor and restart the app.

The Cursor and Claude Desktop snippets come from the package's README and are the same JSON as the Claude Code.mcp.json entry, which Claude Code recognised. I did not open either app.

Start with questions that cannot change anything. This prompt is on Bugsly's own MCP page:

Use Bugsly to read the most frequent unresolved issue, find the failing line in this repository, and propose a fix. Do not change the issue's status. Enter fullscreen mode Exit fullscreen mode Behind it the agent should call, in this order (arguments from backend/app/mcp/tools.json ):

Bugsly does not write the patch. Your agent reads the stack trace and the code in your repository; you review the diff. In my manual triage of our 12 largest issues, about one fifth of the error volume needed only a code change (see the 16-apps post ); the rest needed config or infrastructure. That was not an agent run, and I have not measured an agent's fix rate.

All 16 tools, grouped by what they can do to your data:

Recorded 2026-11-19 (UTC), @bugsly/mcp-server 0.5.2 from npm. I created one throwaway project with the documented agent sign-up ( POST /api/v1/auth/agent-signup, HTTP 201), sent one error with the public curl envelope (HTTP 200), waited six seconds, then started npx -y @bugsly/mcp-server and called three tools from a small Node script that speaks JSON-RPC over stdio. The error is a realistic made-up one (a TypeError in a checkout handler), not a real customer's.

The token is not shown; the DSN key is replaced by <public_key>. The full output is published at bugsly.dev/data/claude-code-triage-transcript-2026-11-19.txt, verbatim except a two-line header and the DSN key, which is replaced; below it is trimmed where marked.... Event timestamps come from the client that sent the envelope, here curl, not from Bugsly's clock.

A gotcha from my own setup: my first two attempts printed version: 0.3.0 and unfiltered output because my npm config had min-release-age = 7, which made npx skip releases newer than seven days. If npx -y @bugsly/mcp-server reports an old version, check npm config get min-release-age.

Error events are text written by your users and by anyone who knows your DSN. A hostile string in an error message could try to instruct your agent. The package's README says tools that return event text wrap it in <untrusted_event_data> tags, cap it at 60,000 characters, drop user email, IP, username and extra data from get_issue_events, hash the user ID and strip query strings from request URLs, and that the server tells the agent to ask before it resolves, ignores or creates anything. I read that in the code and the passing test suite, and the recorded run above shows the wrapper and the dropped user fields; I did not attack it.

Practical rules: leave resolve_issue and ignore_issue behind your client's confirmation prompt and revoke tokens you stop using. The hosted server limits each user to 60 tool calls a minute.

The server is a standard stdio MCP server, so any client that can launch npx -y @bugsly/mcp-server with an environment variable should work. Claude Code is the only real client I tested, and only for install and connection; the recorded triage used a script as the client.

No. Bugsly accepts Sentry SDK envelopes, so you change the DSN and keep the SDK. Compatibility is a subset, not everything: Bugsly has no SSO or SAML, no minidump ingestion and no history import from Sentry. Sentry is a trademark of its owner; Bugsly is not affiliated with or endorsed by Sentry.

The hosted server lets you revoke access without handling a secret file. The local package runs on your machine over stdio and works in clients that cannot call a URL. Both read the same tool definition, so they expose the same 16 tools.

I am not quoting limits here because they change; see bugsly.dev/pricing. If an organization has no active plan or trial, the API answers HTTP 402 with the code trial_required, and the repository's README tells agents not to retry but to tell you.

Tokens expire after 90 days. Create a new one in Settings → AI Agent / MCP and update BUGSLY_TOKEN.

It can create a project ( create_project ), and get_checkout_url returns a link to the billing page. Neither charges anything; a person has to accept terms on that page. There is no tool to delete projects, edit alert rules or create monitors.

Originaltitel: Let Claude Code triage production errors via MCPQuelle: dev.to (dev.to). Original öffnen