PHPackages                             dcodegroup/bugsnag-laravel-mcp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. dcodegroup/bugsnag-laravel-mcp

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

dcodegroup/bugsnag-laravel-mcp
==============================

Basic MCP for integrating Bugsnag into AI workflows

v0.0.3(2w ago)041↑75%MITPHP

Since May 20Pushed 2w agoCompare

[ Source](https://github.com/DCODE-GROUP/bugsnag-laravel-mcp)[ Packagist](https://packagist.org/packages/dcodegroup/bugsnag-laravel-mcp)[ RSS](/packages/dcodegroup-bugsnag-laravel-mcp/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (9)Versions (4)Used By (0)

Bugsnag Laravel MCP
===================

[](#bugsnag-laravel-mcp)

A Laravel package that integrates [Bugsnag](https://www.bugsnag.com/) error monitoring with [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), enabling AI assistants like Claude to access and analyze Bugsnag error data directly.

Features
--------

[](#features)

- 🔗 **MCP Server Integration**: Exposes Bugsnag error data through the Model Context Protocol
- 🐛 **Error Analysis**: Fetch detailed error information including stack traces, events, and context
- 🤖 **AI-Ready**: Built for seamless integration with AI assistants and large language models
- 📋 **Full Event History**: Access the latest event details for any Bugsnag error
- 🔐 **Secure**: Uses personal access tokens for authentication with the Bugsnag API

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 11+
- Bugsnag account with personal access token

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require dcodegroup/bugsnag-laravel-mcp
```

Publish the configuration file:

```
php artisan vendor:publish --provider="Dcodegroup\BugsnagLaravelMcp\Providers\BugsnagMcpProvider" --tag=bugsnag-mcp-config
```

Configuration
-------------

[](#configuration)

Add the following environment variables to your `.env` file:

```
BUGSNAG_PERSONAL_ACCESS_TOKEN=your_bugsnag_personal_access_token
BUGSNAG_ORGANIZATION_ID=your_organization_id
BUGSNAG_PROJECT_ID=your_project_id
BUGSNAG_API_BASE_URL=https://api.bugsnag.com  # Optional, defaults to https://api.bugsnag.com
```

You can also configure these settings in the `config/bugsnag-mcp.php` file:

```
return [
    'access_token' => env('BUGSNAG_PERSONAL_ACCESS_TOKEN', ''),
    'organization_id' => env('BUGSNAG_ORGANIZATION_ID', ''),
    'project_id' => env('BUGSNAG_PROJECT_ID', ''),
    'api_base_url' => env('BUGSNAG_API_BASE_URL', 'https://api.bugsnag.com'),
];
```

Installing the MCP Server
-------------------------

[](#installing-the-mcp-server)

After configuration, install the MCP server into your MCP client configuration:

```
php artisan bugsnag-mcp:install
```

This command will:

1. Display the configuration snippet needed for your `.mcp.json` or `mcp.json` file
2. Prompt you to automatically write it to the file (if one exists)
3. Optionally write to a specific file using the `--write` option

### Manual Installation

[](#manual-installation)

If you prefer to manually add the configuration, add the following to your `.mcp.json` or `mcp.json` file:

```
{
  "bugsnag": {
    "command": "php",
    "args": ["artisan", "mcp:start", "bugsnag"],
    "cwd": "/path/to/your/laravel/app"
  }
}
```

Replace `/path/to/your/laravel/app` with the absolute path to your Laravel application.

Usage
-----

[](#usage)

### Using with MCP Client

[](#using-with-mcp-client)

Once configured, the Bugsnag MCP Server will be available as a local MCP server named `bugsnag`. Connect your MCP client to use it.

### Available Tools

[](#available-tools)

#### GetBugsnagError

[](#getbugsnagerror)

Fetches detailed information about a specific Bugsnag error, including the most recent event, stack traces, request context, breadcrumbs, and metadata.

**Parameters:**

- `error_id` (string): The Bugsnag error ID to fetch

**Response:**The tool returns a JSON response containing:

- `error`: Full error details (ID, message, status, severity, etc.)
- `latest_event`: The most recent event for the error with full context
- `instructions_for_copilot`: Suggested analysis steps for AI assistants

**Example:**

```
Tool: GetBugsnagError
Input: {"error_id": "6a0af4dc8c3285d1a53ea587"}

Response:
{
  "error": {
    "id": "6a0af4dc8c3285d1a53ea587",
    "error_class": "InvalidArgumentException",
    "message": "Invalid argument provided",
    "severity": "error",
    "status": "open",
    "events": 5,
    "first_seen": "2026-05-18T11:16:27.688Z",
    "last_seen": "2026-05-20T10:01:34.581Z"
  },
  "latest_event": {
    "id": "3ca351b6-ab75-3d22-9d92-49056734d2fc",
    "context": "GET /api/users",
    "severity": "error",
    "received_at": "2026-05-20T10:01:34.581Z",
    "exceptions": [...],
    "request": {...},
    "breadcrumbs": [...]
  },
  "instructions_for_copilot": [
    "Infer likely root cause.",
    "Suggest local reproduction steps.",
    "Point to likely files to inspect in the Laravel app."
  ]
}

```

Architecture
------------

[](#architecture)

### Core Components

[](#core-components)

- **BugsnagClient**: HTTP client for communicating with the Bugsnag API using Saloon
- **BugsnagServer**: MCP Server definition that exposes tools and resources
- **GetBugsnagError**: Tool for fetching error data
- **Data Models**: Spatie Laravel Data models for type-safe error and event handling

### API Integration

[](#api-integration)

The package uses [Saloon](https://docs.saloon.dev/) for HTTP requests and includes:

- Request/Response classes for each Bugsnag API endpoint
- Automatic DTO transformation using Spatie Laravel Data
- Fixture-based testing with mock responses

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

Run tests with coverage:

```
composer test -- --coverage
```

Run linting and static analysis:

```
composer lint
```

Development
-----------

[](#development)

### Local Development

[](#local-development)

Build the workbench:

```
composer build
```

Serve the application:

```
composer serve
```

### File Structure

[](#file-structure)

```
src/
├── Tools/              # MCP tools
├── Bugsnag/           # Bugsnag API integration
│   ├── Requests/      # Saloon request classes
│   ├── Data/          # DTO models
│   └── BugsnagConnector.php
├── Services/          # Business logic services
├── Providers/         # Laravel service providers
└── BugsnagServer.php  # MCP server definition

tests/
├── Feature/           # Feature tests
├── Integration/       # Integration tests with API
├── Fixtures/          # Mock API responses
└── Support/           # Test utilities

```

Configuration Reference
-----------------------

[](#configuration-reference)

### bugsnag-mcp.php

[](#bugsnag-mcpphp)

```
return [
    // Your Bugsnag personal access token
    'access_token' => env('BUGSNAG_PERSONAL_ACCESS_TOKEN', ''),

    // Your Bugsnag organization ID
    'organization_id' => env('BUGSNAG_ORGANIZATION_ID', ''),

    // Your Bugsnag project ID
    'project_id' => env('BUGSNAG_PROJECT_ID', ''),

    // Bugsnag API base URL
    'api_base_url' => env('BUGSNAG_API_BASE_URL', 'https://api.bugsnag.com'),

    // Default instructions for Copilot when analyzing errors
    'copilot_instructions' => [
        'Infer likely root cause.',
        'Suggest local reproduction steps.',
        'Point to likely files to inspect in the Laravel app.',
    ],
];
```

Obtaining Bugsnag Credentials
-----------------------------

[](#obtaining-bugsnag-credentials)

1. **Personal Access Token**:

    - Log in to [Bugsnag](https://bugsnag.com/)
    - Navigate to Settings → Personal Access Tokens
    - Create a new token with `read` scope
2. **Organization ID**:

    - Found in your Bugsnag account Settings → Organization
3. **Project ID**:

    - Found in your project's Settings → General

Troubleshooting
---------------

[](#troubleshooting)

### Missing Configuration

[](#missing-configuration)

Ensure all required environment variables are set:

- `BUGSNAG_PERSONAL_ACCESS_TOKEN`
- `BUGSNAG_ORGANIZATION_ID`
- `BUGSNAG_PROJECT_ID`

### Authentication Errors

[](#authentication-errors)

Verify your personal access token is valid and has the required permissions.

### API Connection Issues

[](#api-connection-issues)

Check that:

- Your firewall allows outbound connections to `api.bugsnag.com`
- Your credentials are correct
- The Bugsnag API is accessible

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit pull requests.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

About
-----

[](#about)

Created by [Dcode Group](https://dcodegroup.com.au/)

Support
-------

[](#support)

For issues and questions:

- GitHub Issues: [Issues](https://github.com/dcodegroup/bugsnag-laravel-mcp/issues)
- Email:

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance96

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

20d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0e8e7e3202508183e3ba9f9a95abcffdab114ce86e33e52a67abd58194d3d86?d=identicon)[dcodegroup](/maintainers/dcodegroup)

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dcodegroup-bugsnag-laravel-mcp/health.svg)

```
[![Health](https://phpackages.com/badges/dcodegroup-bugsnag-laravel-mcp/health.svg)](https://phpackages.com/packages/dcodegroup-bugsnag-laravel-mcp)
```

###  Alternatives

[ohdearapp/ohdear-php-sdk

An SDK to easily work with the Oh Dear API

742.9M16](/packages/ohdearapp-ohdear-php-sdk)[binaryk/laravel-restify

Laravel REST API helpers

675410.3k](/packages/binaryk-laravel-restify)[crescat-io/saloon-sdk-generator

Simplified SDK Scaffolding for Saloon

13231.8k9](/packages/crescat-io-saloon-sdk-generator)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1122.7k](/packages/codebar-ag-laravel-docuware)[helgesverre/chromadb

PHP Client for the Chromadb Rest API

321.1k](/packages/helgesverre-chromadb)[codebar-ag/laravel-zammad

Zammad integration with Laravel

116.7k](/packages/codebar-ag-laravel-zammad)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
