Croft

Croft stats

Downloads
74
Stars
31
Open Issues
0
Forks
1

View on GitHub →

MCP server for all of your Laravel projects - better AI pair programming, coming soon..

MCP server specifically for local Laravel development

Artisan command provides tools to your MCP client to help your AI pair programmer work better. This is specifically designed to offer tools that are useful locally. Add more functionality with croft.fyi » hosted servers

Installation

Install the package via composer:

composer require ashleyhindle/croft --dev

Publish the config file with:

php artisan vendor:publish --tag="croft-config"

Add more functionality with croft.fyi » hosted servers (coming soon)

Usage

To make use of Croft you need to add it as an MCP server in your favourite tool.

The command the MCP client needs to run is ./artisan croft

Cursor (Docs)

We recommend you ship an mcp.json file with your project in .cursor/mcp.json

{
"mcpServers": {
"croft": {
"command": "./artisan",
"args": ["croft"]
}
}
}

Current functionality

  • Screenshot URLs
  • InertiaJS docs
  • Query database (read only, or read write)
  • Get absolute URL from relative path
  • Get current date and time
  • Read last X log entries
  • Read & filter database structure - tables, columns, indexes, foreign keys
  • List/filter routes
  • List artisan commands
  • List available config() keys (and optionally values) in dot notation
  • List available env() keys (without leaking secrets of course)

Extra functionality

Add more functionality with croft.fyi » remote MCP servers (coming soon).

Add your own tools

It's trivial to add your own tools.

Just create a class that extends our Croft\Feature\Tool\AbstractTool class, then make sure it's in your croft.php config file.

Example:

<?php
 
declare(strict_types=1);
 
namespace Croft\Tools;
 
use Croft\Feature\Tool\AbstractTool;
use Croft\Feature\Tool\ToolResponse;
 
class {{CLASSNAME}} extends AbstractTool
{
public function __construct()
{
// Setup annotations according to MCP specification
$this->setTitle('{{NAME}}')
->setReadOnly(true) // Just listing commands, no modifications
->setDestructive(false) // No destructive operations
->setIdempotent(true); // Safe to retry
}
 
public function getName(): string
{
return '{{NAME}}';
}
 
public function getDescription(): string
{
return 'Must explain well what the tool can do so the MCP client can decide when to use it.';
}
 
/**
* What params does the MCP client need to provide to use this tool?
**/
public function getInputSchema(): array
{
return [
'type' => 'object',
'properties' => (object) [
],
'required' => [],
];
}
 
public function handle(array $arguments): ToolResponse
{
return ToolResponse::text("Howdy, this is the start of something great.");
}
}

After adding a tool you'll need to restart the server, or ask the MCP client to relist the tools.

Support & Credits

This was developed by Ashley Hindle. If you like it, please star it, share it, and let me know!

ashleyhindle photo

Working on @WhispPHP and Croft

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Ashleyhindle Croft Related Articles

Whisp, a Pure PHP SSH server, with Ashley Hindle image

Whisp, a Pure PHP SSH server, with Ashley Hindle

Read article
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Honeybadger logo

Honeybadger

Simple developer-focused application monitoring for Laravel. Error tracking, log management, uptime monitoring, status pages, and more!

Honeybadger
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum