A Bugsnag MCP server for interacting with Bugsnag API
npm install bugsnag-mcp-serverA Model Context Protocol (MCP) server for interacting with Bugsnag. This server allows LLM tools like Cursor and Claude to investigate and resolve issues in Bugsnag.
Setting up the Bugsnag MCP server is simple and doesn't require any installation or downloading source code.
1. Add the Bugsnag MCP server configuration:
``json`
{
"mcpServers": {
"bugsnag": {
"command": "npx",
"args": ["-y", "bugsnag-mcp-server"],
"env": {
"BUGSNAG_API_KEY": "your-bugsnag-api-key"
},
"disabled": false,
"alwaysAllow": []
}
}
}
2. Replace your-bugsnag-api-key with your Bugsnag API key
1. Add the Bugsnag MCP server configuration:
`json`
{
"mcpServers": {
"bugsnag": {
"command": "npx",
"args": ["-y", "bugsnag-mcp-server"],
"env": {
"BUGSNAG_API_KEY": "your-bugsnag-api-key"
},
"disabled": false,
"alwaysAllow": []
}
}
}
2. Replace your-bugsnag-api-key with your Bugsnag API key
To use this MCP server, you'll need a Bugsnag API key:
1. Log in to your Bugsnag account at https://app.bugsnag.com/
2. Go to Settings > Organization settings > Access tokens
3. Create a new personal access token with the following permissions:
- Read projects
- Read and write errors
- Read and write comments
4. Copy the generated token for use with the MCP server
Once configured, you can use the Bugsnag MCP server with your LLM tool. Here are some example prompts:
``
List all my Bugsnag organizations
``
Show me all projects in organization "org_12345"
``
List the open errors in my Bugsnag project "project_12345"
``
Show me the details for Bugsnag error ID "error_12345"
``
Show me the detailed stacktrace for event "event_12345" in project "project_12345"
``
View the exception chain for event "event_12345" in project "project_12345"
``
Search for Bugsnag issues in project "project_12345" related to "NullPointerException"
``
List all events for error "error_12345" in project "project_12345"
The Bugsnag MCP server provides the following tools:
#### list_organizations
Lists available Bugsnag organizations.
Parameters:
- None required
#### list_projects
Lists projects in an organization.
Parameters:
- organization_id (required): Bugsnag organization ID
#### list_errors
Lists errors in a project with filtering options.
Parameters:
- project_id (required): Bugsnag project IDstatus
- : Filter by error status ("open", "fixed", "ignored")sort
- : Sort order for errors ("newest", "oldest", "priority")limit
- : Maximum number of errors to return
#### view_error
Gets detailed information about a specific error.
Parameters:
- error_id (required): Bugsnag error ID
#### list_error_events
Lists events (occurrences) for a specific error.
Parameters:
- project_id (required): Bugsnag project IDerror_id
- (required): Bugsnag error IDlimit
- : Maximum number of events to return
#### view_latest_event
Views the latest event for an error.
Parameters:
- error_id (required): Bugsnag error ID
#### view_event
Views detailed information about a specific event.
Parameters:
- project_id (required): Bugsnag project IDevent_id
- (required): Bugsnag event ID
#### view_stacktrace
Extracts and formats stacktrace information from an event.
Parameters:
- project_id (required): Bugsnag project IDevent_id
- (required): Bugsnag event IDinclude_code
- : Include source code context if available (default: true)
#### view_exception_chain
Views the full chain of exceptions for an event.
Parameters:
- project_id (required): Bugsnag project IDevent_id
- (required): Bugsnag event ID
#### search_issues
Searches for issues using various criteria.
Parameters:
- project_id (required): Bugsnag project IDquery
- : Search queryerror_class
- : Filter by error classapp_version
- : Filter by app version
You can test if your Bugsnag API key is valid using:
`bash`
npx bugsnag-mcp-server test-api-key your-bugsnag-api-key
If your API key is valid, this will display a list of your Bugsnag projects with their IDs.
While using npx is recommended for most users, you can also install the package globally if you prefer:
`bash`
npm install -g bugsnag-mcp-server
If you're interested in contributing or modifying the code:
1. Clone the repository:
`bash`
git clone https://github.com/yourusername/bugsnag-mcp.git
cd bugsnag-mcp
2. Install dependencies:
`bash`
npm install
3. Build the project:
`bash`
npm run build
4. Run tests:
`bash`
npm test
5. Run tests with coverage:
`bash`
npm run test:coverage
6. Format code:
`bash`
npm run format
7. Check code formatting:
`bash`
npm run format:check
This project uses GitHub Actions for continuous integration. The workflows automatically:
- Runs on push to the main branch and on pull requests
- Tests against multiple Node.js versions (18.x and 20.x)
- Runs the test suite
- Generates and uploads test coverage reports
- Checks code formatting with Prettier
You can view the workflow configurations in:
- .github/workflows/test.yml - For running tests.github/workflows/prettier.yml` - For checking code formatting
-
MIT