New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

exeque/laravel-monocle

Agent-focused request profiler for Laravel with an MCP server: timing spans, queries, cache, filesystem, AI agent calls and more.
1,162 3
Install
composer require exeque/laravel-monocle
Latest Version:v0.12.1
PHP:^8.4
Laravel:13
License:MIT
Last Updated:Oct 23, 2026
Links: GitHub  ·  Packagist
Maintainer: ExeQue

Monocle - the Laravel profiler your coding agent reads

Latest version Total downloads Tests Documentation PHP version Laravel version License

Monocle

Documentation: exeque.github.io/laravel-monocle

A request profiler for Laravel, built for AI coding agents. Monocle records what your application did while handling a request, a queued job or an artisan command - timing, middleware, database queries, cache, views, mail, HTTP calls, filesystem operations, AI agent calls and more - and lets an agent read it through an MCP server. The same data is available from artisan and in a web dashboard at /_monocle.

Install

composer require --dev exeque/laravel-monocle
php artisan monocle:install

monocle:install asks what to record, where to store it and which MCP clients to configure, then writes config/monocle.php and registers the MCP server. Restart your MCP client afterwards.

For the Monocle button on your pages, which opens their captures in the dashboard, set trace.browser.enabled to true in config/monocle.php. See Browser tracing.

Monocle records only outside production and only with APP_DEBUG=true, and never while your test suite runs unless you enable it.

What your agent can do

Tool Purpose
monocle-list Recent captures with duration, status, per-section counts and how many errors and warnings
monocle-show Where the time went, totals, errors (exceptions, failed calls and jobs) and warnings (slow queries, N+1, duplicates, slow middleware)
monocle-rows Any section, filtered, sorted and paginated
monocle-queries Queries grouped by shape, caller, table or transaction
monocle-trace A request and every job it dispatched
monocle-compare Two captures side by side - did the change help?
monocle-clear Start from a clean slate
monocle-lenses The sections this application records

Every recorded response carries an X-Monocle-Id header, and every recorded row points to the file:line in your code that caused it.

From the terminal: monocle:list, monocle:show, monocle:rows, monocle:queries, monocle:trace, monocle:compare, monocle:clear. monocle:install sets Monocle up and monocle:editor links files to your editor.

Measure your own code

use Monocle;

$span = Monocle::span('import photos')->start(['album' => $album->id]);
// ...
$span->stop(['count' => $count]);

Monocle::measure('resize', fn () => $this->resize($file));

Learn more

Contributing

Read CONTRIBUTING.md before opening a pull request. Report security issues privately as described in SECURITY.md. Everyone taking part follows the Code of Conduct.

License

MIT

Related Packages

adobrovolsky97/illuminar

Debug tool for Laravel Framework

97,071 23
chocofamilyme/laravel-pinba

Integrates pinba with Laravel

20,957 0
conserto/pomm-symfony-bridge

Pomm profiler for Symfony.

20,626 4
tochka-developers/laravel-pinba-extension

Integrates pinba + pinboard with Laravel

5,779 2
daylerees/anbu

The Anbu profiler for Laravel 4.

4,872 304

Version History

Version Released PHP Laravel License
v0.12.1 ^8.4 ^13.0 MIT
v0.12.0 ^8.4 ^13.0 MIT
v0.11.1 ^8.4 ^13.0 MIT
v0.11.0 ^8.4 ^13.0 MIT
v0.10.1 ^8.4 ^13.0 MIT