PHPackages                             whallysson/log-viewer-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. whallysson/log-viewer-mcp

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

whallysson/log-viewer-mcp
=========================

MCP Server for opcodesio/log-viewer - expose log analysis tools to AI agents via Laravel MCP

v1.0.1(3mo ago)492MITPHPPHP ^8.2CI passing

Since Mar 15Pushed 3mo agoCompare

[ Source](https://github.com/whallysson/log-viewer-mcp)[ Packagist](https://packagist.org/packages/whallysson/log-viewer-mcp)[ Docs](https://github.com/whallysson/log-viewer-mcp)[ RSS](/packages/whallysson-log-viewer-mcp/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Log Viewer MCP
==============

[](#log-viewer-mcp)

[![Tests](https://github.com/whallysson/log-viewer-mcp/actions/workflows/tests.yml/badge.svg)](https://github.com/whallysson/log-viewer-mcp/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/b004db2e9e64ed16d0f4aef2d9c92e1ef1017eb8288f5a618be87d1f08910c5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7768616c6c7973736f6e2f6c6f672d7669657765722d6d63702e737667)](https://packagist.org/packages/whallysson/log-viewer-mcp)[![PHP Version](https://camo.githubusercontent.com/cba9dde68928ebcbc5b5286ec81ec8cf46689ca426339370740e5b9ba23502d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7768616c6c7973736f6e2f6c6f672d7669657765722d6d63702e737667)](https://packagist.org/packages/whallysson/log-viewer-mcp)[![License](https://camo.githubusercontent.com/c12906bf50bf55859c090a9f1abd7cbb6ea7063c32ae359e1a7cb704179b8c1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7768616c6c7973736f6e2f6c6f672d7669657765722d6d63702e737667)](https://github.com/whallysson/log-viewer-mcp/blob/main/LICENSE)

An [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that exposes [opcodesio/log-viewer](https://github.com/opcodesio/log-viewer) to AI agents. Let Claude, GPT, and other AI assistants read, search, and analyze your Laravel application logs.

Built on top of the official [laravel/mcp](https://github.com/laravel/mcp) package using STDIO transport.

Why?
----

[](#why)

When debugging production issues with AI, the agent needs to see your logs. Instead of copy-pasting stack traces, this package gives your AI assistant direct access to your log files — with search, filtering, and structured output.

**4 tools, zero config.** Install the package and your AI agent can immediately:

- List all available log files
- Search logs by text or severity level
- Get full details of any log entry (stack trace, context, extra data)
- Get a health overview with error counts and recent failures

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

[](#requirements)

- PHP 8.2+
- Laravel 10.x, 11.x, or 12.x
- [opcodesio/log-viewer](https://github.com/opcodesio/log-viewer) 3.x or 4.x
- [laravel/mcp](https://github.com/laravel/mcp) 0.6+

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

[](#installation)

```
composer require whallysson/log-viewer-mcp
```

The package auto-discovers its service provider. No additional setup required.

### Publish Configuration (Optional)

[](#publish-configuration-optional)

```
php artisan vendor:publish --tag=log-viewer-mcp-config
```

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

[](#configuration)

```
// config/log-viewer-mcp.php

return [
    // Enable or disable the MCP server
    'enabled' => env('LOG_VIEWER_MCP_ENABLED', true),

    // Maximum results per search page
    'max_results' => 50,

    // Truncate full log text (stack traces) longer than this
    'max_log_text_length' => 10000,
];
```

Available Tools
---------------

[](#available-tools)

### `list_log_files`

[](#list_log_files)

Discover available log files with metadata (name, size, date range, type).

ParameterTypeRequiredDescription`folder`stringNoFolder identifier to filter by### `search_logs`

[](#search_logs)

Search logs by text query and/or severity level with pagination.

ParameterTypeRequiredDescription`file`stringNo\*File identifier from `list_log_files``query`stringNo\*Text to search (case-insensitive regex)`level`stringNoSeverity: emergency, alert, critical, error, warning, notice, info, debug`per_page`integerNoResults per page (default: 15, max: 50)`page`integerNoPage number (default: 1)\*At least `file` or `query` is required.

### `get_log_entry`

[](#get_log_entry)

Get full details of a specific log entry including stack trace, context, and extra data.

ParameterTypeRequiredDescription`file`stringYesFile identifier`index`integerYesLog entry index from search results### `get_error_summary`

[](#get_error_summary)

Get a high-level health overview: counts per severity level and most recent errors.

ParameterTypeRequiredDescription`file`stringNoFile identifier (omit for overview of all files)`recent_errors_count`integerNoNumber of recent errors to include (default: 5, max: 20)Usage with Claude Desktop
-------------------------

[](#usage-with-claude-desktop)

Add to your `claude_desktop_config.json`:

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

Then ask Claude things like:

- *"Check my application logs for recent errors"*
- *"Search for any SQLSTATE errors in the last log file"*
- *"Give me a health summary of the application"*
- *"Show me the full stack trace for that error"*

Suggested Workflow
------------------

[](#suggested-workflow)

The tools are designed to be used in sequence:

```
1. list_log_files      → discover what log files exist
2. get_error_summary   → quick health check
3. search_logs         → find specific errors
4. get_log_entry       → get full details + stack trace

```

Testing
-------

[](#testing)

```
composer test
```

Code Style
----------

[](#code-style)

This package uses [Laravel Pint](https://laravel.com/docs/pint) for code style.

```
# Check for style issues
composer lint

# Fix style issues
composer lint:fix
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Contributions are welcome! Please see the [pull request template](.github/PULL_REQUEST_TEMPLATE.md) for details.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/new-tool`)
3. Ensure tests pass (`composer test`) and code style is clean (`composer lint`)
4. Submit a pull request

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance81

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

2

Last Release

102d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33d38ee9fb28a8bcf4176205ebf880d039cda8bf32f231c43614d047c1c042c2?d=identicon)[whallysson](/maintainers/whallysson)

---

Top Contributors

[![whallysson](https://avatars.githubusercontent.com/u/6969398?v=4)](https://github.com/whallysson "whallysson (3 commits)")

---

Tags

laravelloggingmcpaidebugginglog viewerModel Context Protocolai-agents

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/whallysson-log-viewer-mcp/health.svg)

```
[![Health](https://phpackages.com/badges/whallysson-log-viewer-mcp/health.svg)](https://phpackages.com/packages/whallysson-log-viewer-mcp)
```

###  Alternatives

[vizra/vizra-adk

Vizra Agent Development Kit - A comprehensive Laravel package for building intelligent AI agents.

29431.7k](/packages/vizra-vizra-adk)[lucianotonet/laravel-telescope-mcp

MCP Server extension for Laravel Telescope

2019.6k](/packages/lucianotonet-laravel-telescope-mcp)[moesif/moesif-laravel

Moesif Collection/Data Ingestion Middleware for Laravel

1167.3k](/packages/moesif-moesif-laravel)[kssadi/log-tracker

A powerful, intuitive, and efficient log viewer for Laravel applications.

275.9k](/packages/kssadi-log-tracker)[melihovv/laravel-log-viewer

A Laravel log viewer

1031.6k1](/packages/melihovv-laravel-log-viewer)

PHPackages © 2026

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