PHPackages                             skylence/laravel-optimize-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. skylence/laravel-optimize-mcp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

skylence/laravel-optimize-mcp
=============================

Laravel Optimize MCP provides optimization tools and utilities for AI-assisted development

v1.0.3(1mo ago)01521MITPHPPHP ^8.1

Since Nov 2Pushed 1mo agoCompare

[ Source](https://github.com/skylence-be/laravel-optimize-mcp)[ Packagist](https://packagist.org/packages/skylence/laravel-optimize-mcp)[ Docs](https://github.com/laravel/optimize-mcp)[ RSS](/packages/skylence-laravel-optimize-mcp/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (20)Versions (30)Used By (1)

Laravel Optimize MCP
====================

[](#laravel-optimize-mcp)

Optimize your Laravel project with AI assistance through the Model Context Protocol (MCP).

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

[](#installation)

Install via Composer:

```
composer require skylence/laravel-optimize-mcp
```

Run the installation command and follow the prompts:

```
php artisan optimize-mcp:install
```

The installer will:

- Automatically detect and configure your code editor (Cursor, Claude Code, VS Code, or PhpStorm)
- Ask if you want HTTP access for staging/production servers
- Generate a secure token and configuration instructions for remote access

Usage
-----

[](#usage)

Once installed, ask your AI assistant to optimize your Laravel project:

**"Analyze my Laravel project and help me optimize it"**

Your AI will use the installed MCP tools to:

- Analyze your configuration for performance and security issues
- Review your project structure and development workflow
- Recommend useful packages and improvements
- Provide actionable recommendations with code snippets

Remote Access for Staging/Production
------------------------------------

[](#remote-access-for-stagingproduction)

Want to analyze your staging or production environment? The installer can configure this for you automatically, or you can set it up manually by adding these to your `.env` file:

```
# Enable secure HTTP access
OPTIMIZE_MCP_AUTH_ENABLED=true

# Generate token: php artisan tinker --execute="echo bin2hex(random_bytes(32))"
OPTIMIZE_MCP_API_TOKEN=your-secure-token-here
```

Then ask your AI to connect to your remote server:

**"Connect to my production Laravel server at  and analyze the .env configuration"**

This allows you to check production environment variables, cache/session drivers, and security settings without SSH access.

Database Monitoring &amp; Alerts
--------------------------------

[](#database-monitoring--alerts)

Set up automatic database size monitoring with growth tracking and email alerts:

### Enable Monitoring

[](#enable-monitoring)

1. Add to your `.env`:

```
OPTIMIZE_MCP_DB_MONITORING=true
OPTIMIZE_MCP_DB_NOTIFICATION_EMAILS=dev@example.com,ops@example.com
OPTIMIZE_MCP_DB_WARNING_THRESHOLD=80
OPTIMIZE_MCP_DB_CRITICAL_THRESHOLD=90
```

2. Run migrations:

```
php artisan migrate
```

3. Schedule the monitoring command:

**Laravel 11+ / 12** (in `bootstrap/app.php`):

```
->withSchedule(function (Schedule $schedule): void {
    $schedule->command('optimize-mcp:monitor-database')
        ->daily()
        ->onOneServer()
        ->when(fn () => config('app.schedule_enabled', true));
})
```

**Laravel 10 and earlier** (in `app/Console/Kernel.php`):

```
protected function schedule(Schedule $schedule)
{
    // Run database monitoring daily (or hourly, weekly, etc.)
    $schedule->command('optimize-mcp:monitor-database')->daily();
}
```

**Make schedules configurable** (recommended):

Add to `config/app.php`:

```
'schedule_enabled' => (bool) env('APP_SCHEDULE_ENABLED', true),
```

Add to `.env`:

```
APP_SCHEDULE_ENABLED=true  # Set to false to disable all scheduled tasks
```

This allows you to easily enable/disable schedules per environment (local, staging, production).

### Available Commands

[](#available-commands)

```
# Check database size manually
php artisan optimize-mcp:database-size

# Run monitoring (logs size, calculates growth, sends alerts)
php artisan optimize-mcp:monitor-database

# Clean up old logs (keeps 90 days by default)
php artisan optimize-mcp:prune-database-logs
```

### Features

[](#features)

- **Automatic Tracking**: Logs database size, growth rate, and disk usage
- **Growth Prediction**: Estimates when your database will be full based on growth trends
- **Smart Alerts**: Email notifications at warning (80%) and critical (90%) thresholds
- **Historical Data**: Track size over time to identify growth patterns
- **Cross-Database**: Supports MySQL, PostgreSQL, and SQLite

What's Included
---------------

[](#whats-included)

- **Configuration Analyzer**: Checks your Laravel config for performance and security
- **Database Size Inspector**: Monitor database size, growth trends, and disk usage
- **Database Monitoring &amp; Alerts**: Automatic size tracking with email notifications
- **Log File Inspector**: Check log sizes and rotation configuration (HTTP MCP only)
- **Nginx Config Inspector**: Analyze nginx for security and performance (HTTP MCP only)
- **Nginx Config Generator**: Generate production-ready nginx configs (HTTP MCP only)
- **Project Structure Analyzer**: Reviews your composer scripts, CI/CD, testing setup, and more
- **Package Advisor**: Recommends useful packages for your project

LLM Guidelines for AI Assistants
--------------------------------

[](#llm-guidelines-for-ai-assistants)

Want your AI assistant to know how to use these MCP tools? Add the Laravel Optimize MCP guidelines to your project's LLM instruction files:

```
# From the root of your Laravel project
php vendor/skylence/laravel-optimize-mcp/bin/append-guidelines.php CLAUDE.md

# Or for other LLM instruction files
php vendor/skylence/laravel-optimize-mcp/bin/append-guidelines.php .cursorrules
php vendor/skylence/laravel-optimize-mcp/bin/append-guidelines.php .copilot-instructions.md
```

This appends comprehensive guidelines about:

- How to use each MCP tool
- When to use HTTP MCP vs stdio/PHP MCP tools
- Best practices for security and performance
- Configuration examples and common solutions

The script will:

- ✅ Append guidelines to existing files without overwriting
- ✅ Skip if guidelines are already present
- ✅ Create the file with guidelines if it doesn't exist

Advanced Configuration
----------------------

[](#advanced-configuration)

For remote access, HTTP endpoints, and custom tool configuration, see the [full documentation](https://github.com/skylence/laravel-optimize-mcp).

License
-------

[](#license)

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

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.6% 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 ~7 days

Recently: every ~48 days

Total

29

Last Release

50d ago

Major Versions

v0.13.2 → v1.0.02025-11-03

v0.13.3 → 1.0.12025-11-03

v0.1.7 → v1.0.32026-05-16

PHP version history (2 changes)v0.1.0PHP ^8.2

v0.8.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ad0eeb3e0f0183e243d7edf649313243750f8048918eb00c9c041c5dc379149?d=identicon)[skylence](/maintainers/skylence)

---

Top Contributors

[![jonasvanderhaegen-xve](https://avatars.githubusercontent.com/u/216873699?v=4)](https://github.com/jonasvanderhaegen-xve "jonasvanderhaegen-xve (44 commits)")[![jonasvanderhaegen](https://avatars.githubusercontent.com/u/7755555?v=4)](https://github.com/jonasvanderhaegen "jonasvanderhaegen (3 commits)")

---

Tags

ailaravelmcpmcp-serverpackagelaravelmcpaioptimization

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/skylence-laravel-optimize-mcp/health.svg)

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M199](/packages/laravel-ai)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k21.5M599](/packages/laravel-boost)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)

PHPackages © 2026

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