Claude Code Fixes Errors via Better Stack MCP

Better Stackgo watch the original →

Better Stack MCP server lets Claude Code pull error details and stack traces into the terminal for direct debugging, PR creation, and auto-resolution without opening a browser.

The Breakthrough

Better Stack MCP server integrates with Claude Code to fetch error details, stack traces, related issues, browser info, and session replay context directly into the agent's terminal workflow.

What Actually Worked

  • Run the Better Stack MCP server by executing a setup command or editing the coding harness configuration, then sign into Better Stack to enable tools like app discovery, error summaries, and issue details.
  • In Claude Code, prompt give all the error details for this application to retrieve the latest errors; enable deferred tool loading in Claude settings JSON to load only needed tools and save context.
  • Follow up with prompts like if there are any other errors related to this one to group issues, analyze root cause, and generate fixes; Claude Code fetches codebase details in parallel.
  • Instruct Claude Code to fix the security issue in a new feature branch and create a pull request; it adds a one-line code change that prevents the uncaught security error on video timeline scrubbing.
  • After merging the PR, prompt Claude Code to check the fix is in place and if it is resolve the issue in better stack, confirming the code and marking three security issues as resolved.

Context

The author replicates a real uncaught security error in the Hance film emulation React app, triggered by scrubbing the video timeline after upload. Better Stack tracks it via Sentry React SDK and a project-specific DSN, providing browser info, steps to reproduce, and an AI prompt. Manual browser copying of prompts into Claude Code is inefficient for multiple errors, so MCP automates terminal access. This workflow fixes the bug, creates/merges a PR, and resolves issues in Better Stack, reducing UI visits.

Notable Quotes

  • "I genuinely believe this is the direction things are going in. We'll be using more agents and less visiting the UI or visiting our browser because it's just more convenient."
  • "Now it's confirmed the fix is in place and it's resolving the three security issues in better stack which it did while I was talking."

Content References

No external books, papers, reports, podcasts, datasets, or events are referenced. Tools mentioned include the demo app and integration docs.

  • #demo
  • #tutorial

summary by x-ai/grok-4.1-fast. probably wrong about something. check the source.