PHPackages                             laplace-demon-ai/laravel-mcp-log - 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. laplace-demon-ai/laravel-mcp-log

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

laplace-demon-ai/laravel-mcp-log
================================

MCP tool for Laravel log analysing with AI.

v0.1.0(6mo ago)411MITPHPPHP ^8.4CI passing

Since Oct 18Pushed 6mo agoCompare

[ Source](https://github.com/laplace-demon-ai/laravel-mcp-log)[ Packagist](https://packagist.org/packages/laplace-demon-ai/laravel-mcp-log)[ Docs](https://github.com/laplace-demon-ai/laravel-mcp-log)[ RSS](/packages/laplace-demon-ai-laravel-mcp-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (5)Versions (7)Used By (0)

Laravel MCP Log
===============

[](#laravel-mcp-log)

MCP tool for Laravel log analysing with AI.

> This package uses the core log reading functionality provided by the [Laravel Log Reader](https://github.com/moe-mizrak/laravel-log-reader), so for the details about how the log reading works, please check that repository.

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

[](#installation)

You can install the package (that you created with this template) via composer:

```
composer require laplace-demon-ai/laravel-mcp-log
```

You can publish the configuration file with:

```
php artisan vendor:publish --tag="laravel-mcp-log"
```

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

[](#configuration)

You can enable/disable the MCP Log Reader as:

```
'enabled' => env('MCP_LOG_READER_ENABLED', true),
```

The package supports two log storage drivers: `file` and `db` for now.

### Database Logs

[](#database-logs)

If your logs are stored in database (e.g. `log_entries` table), in the config file (`laravel-mcp-log.php`) set the **driver** to `db` as:

```
'driver' => env('LOG_READER_DRIVER', LogDriverType::DB->value),
```

And set the other database related configurations as:

```
'table' => env('LOG_DB_TABLE_NAME', 'log_entries'),
'limit' => env('LOG_READER_DB_QUERY_LIMIT', 10000), // max number of records to fetch in queries

// Column mapping: maps DB columns to LogData properties
'columns' => [
    LogTableColumnType::ID->value => 'id',
    LogTableColumnType::LEVEL->value => 'level', // e.g. 'ERROR', 'INFO'
    LogTableColumnType::MESSAGE->value => 'message', // main log message
    LogTableColumnType::TIMESTAMP->value => 'created_at', // time of the log entry (e.g. 'created_at' or 'logged_at')
    LogTableColumnType::CHANNEL->value => 'channel', // e.g. 'production', 'local'
    LogTableColumnType::CONTEXT->value => 'context', // additional context info, often JSON e.g. '{"action":"UserLogin"}'
    LogTableColumnType::EXTRA->value => 'extra', // any extra data, often JSON e.g. '{"ip":172.0.0.1, "session_id":"abc", "user_id":123}'
],

'searchable_columns' => [
    ['name' => LogTableColumnType::MESSAGE->value, 'type' => ColumnType::TEXT->value],
    ['name' => LogTableColumnType::CONTEXT->value, 'type' => ColumnType::JSON->value],
    ['name' => LogTableColumnType::EXTRA->value, 'type' => ColumnType::JSON->value],
],
```

Basically we do a mapping between the database columns of your log table and the package, so that it can read the logs properly.

- The `searchable_columns` defines which columns are searchable and their types. It is used for the `search` queries. And we require `text` and `json` column types so that we choose the right search strategy (default is `text`).
- The `limit` defines the maximum number of records to fetch in queries to avoid performance issues.

### File Logs

[](#file-logs)

If your logs are stored in files (`laravel.log`), in the config file (`laravel-mcp-log.php`) set the **driver** to `file` as:

```
'driver' => env('LOG_READER_DRIVER', LogDriverType::FILE->value),
```

And set the log file path as:

```
'path' => env('LOG_FILE_PATH', storage_path('logs/laravel.log')),
'limit' => env('LOG_READER_FILE_QUERY_LIMIT', 10000), // max number of lines to read
```

- The `path` defines the full path to your Laravel log file.
- The `limit` defines the maximum number of lines to read in queries to avoid performance issues

Usage
-----

[](#usage)

This package automatically registers MCP Server (`LogReaderServer`) and MCP tool (`LogReaderTool`) in `LaravelMcpLogServiceProvider`, so you don't need to register it manually within the ai.php in your Laravel application.

Warning

You only need to install official [Laravel MCP package](https://github.com/laravel/mcp) so that MCP can recognize this server.

We defined the log reader endpoint as following in the `LaravelMcpLogServiceProvider`:

```
Mcp::web('mcp/log-reader', LogReaderServer::class);
```

It means that you can access the log reader MCP tool in your MCP dashboard at `your-app-url/mcp/log-reader` URL.

Following is the video for a **quick demo** of how it works:

- This is how you can use [localtunnel](https://github.com/localtunnel/localtunnel) to expose your local Laravel application to the internet for MCP access:

[![Localtunnel and Chatgpt](assets/thumbnail_localtunnel.png)](https://youtu.be/DCo-NUpi6nU)

- And this is a demo of how the MCP Log Reader works with sample prompts:

[![Demo](assets/thumbnail_demo.png)](https://youtu.be/F5ZP6u4WTW4)

TODO (this is for [Laravel Log Reader](https://github.com/moe-mizrak/laravel-log-reader) )
------------------------------------------------------------------------------------------

[](#todo-this-is-for-laravel-log-reader-)

> - Add a `log_insights` migration/table which will be a normalized, summarized, and searchable table.
> - It unifies different log mechanisms into a single canonical format, enabling faster lookups over large data.
> - A background task should sync new log data periodically, basically everyday it summarizes the previous day's logs and inserts them into `log_insights`.
> - Be aware that summarization may lose some details (e.g., exact errors or stack traces).
> - Add support for cloud log readers (AWS CloudWatch, Azure Monitor, Google Cloud Logging).
> - Add streaming responses for overall logic.
> - Use a cheap/free model to summarize large log files before search/filter (experimental approach).
> - Laravel MCP Log can be integrated into coding agents where periodically logs are analysed by this tool, and issues are caught and reported to different channels (slack etc). And maybe even PRs can be generated by using the logs.

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

[](#contributing)

> **Your contributions are welcome!** If you'd like to improve this project, simply create a pull request with your changes. Your efforts help enhance its functionality and documentation.

> If you find this project useful, please consider ⭐ it to show your support!

Authors
-------

[](#authors)

This project is created and maintained by [Moe Mizrak](https://github.com/moe-mizrak).

License
-------

[](#license)

Laravel Package Template is an open-sourced software licensed under the **[MIT license](LICENSE)**.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance67

Regular maintenance activity

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

6

Last Release

203d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/178c884a892aaf6813e8af8e2cb685bc987a168d9a0ebe9336455a795247ff96?d=identicon)[moe-mizrak](/maintainers/moe-mizrak)

---

Top Contributors

[![moe-mizrak](https://avatars.githubusercontent.com/u/12977885?v=4)](https://github.com/moe-mizrak "moe-mizrak (27 commits)")

---

Tags

ailaravelllmlog-readerloggingmcpmcp-servermcp-toolsphp8raglaravelphp-8Laplace Demon AIlaravel-mcp-log

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/laplace-demon-ai-laravel-mcp-log/health.svg)

```
[![Health](https://phpackages.com/badges/laplace-demon-ai-laravel-mcp-log/health.svg)](https://phpackages.com/packages/laplace-demon-ai-laravel-mcp-log)
```

###  Alternatives

[insenseanalytics/nova-server-monitor

A Laravel Nova tool for Spatie's Server Monitor library.

6546.9k](/packages/insenseanalytics-nova-server-monitor)[lucianotonet/laravel-telescope-mcp

MCP Server extension for Laravel Telescope

198.6k](/packages/lucianotonet-laravel-telescope-mcp)[melihovv/laravel-log-viewer

A Laravel log viewer

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

PHPackages © 2026

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