Explore documentation
Bulk resolving errors using MCP tools
Use the Better Stack MCP server to let your AI coding agent interact with your error data directly from your terminal.
Automate your debugging workflow from fetching error details to creating pull requests and resolving issues in Better Stack without opening the browser.
An AI agent in your terminal can handle the entire workflow, from identifying an error to resolving it. This includes:
- Fetching error details and stack traces for an application.
- Finding related errors to fix together.
- Creating a feature branch and a pull request with the fix.
- Verifying that the fix has been deployed.
- Resolving the error and all its occurrences in Better Stack.
Try it out in 10 minutes
First, ensure you have an application sending errors to Better Stack and an AI agent, such as Claude Code, with the Better Stack MCP server integrated.
Step 1: List your errors
Navigate to your project's directory and ask your AI agent to list the current errors for your application.
Your agent will use the MCP tools to find the correct application based on your current directory and return a summary of the latest errors.
Step 2: Investigate the error
Pick an error from the list and ask your agent for its full details. You can also ask it to find related errors to fix at the same time.
The agent will return the root cause of the issue, often with a suggested fix.
Step 3: Create a pull request
Once you have enough information, instruct your agent to create a new branch and open a pull request with a fix.
The agent will write the code and provide a link to the newly created pull request.
Step 4: Review and merge
This is a manual step. Open the pull request, review the proposed changes, test them locally to ensure the bug is fixed, and then merge the PR into your main branch.
Step 5: Resolve the issue in Better Stack
After merging the fix, pull the latest changes into your local branch. Then, ask your agent to confirm the fix is present and resolve the corresponding issue in Better Stack.
The agent confirms the code changes and then uses the MCP tools to mark the error and all its previous occurrences as Resolved in the Better Stack UI. Repeat this process until all your application's errors are fixed.