laravel

MCP server for all of your Laravel projects - better AI pair programming

GitHub Stars

90

User Rating

Not Rated

Favorites

0

Views

20

Forks

2

Issues

6

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
PHP: 8.0以上
Composer: 最新版
+1 more

Installation

Installation

Prerequisites

PHP: 8.0 or higher
Composer: Latest version
Laravel: 8.x or higher

Installation Steps

1. Install the Package

bash
composer require usecroft/laravel --dev

2. Publish the Config File

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

3. Add to Your IDE

bash
php artisan croft:install

Troubleshooting

Common Issues

Issue: Package does not install correctly Solution: Check your Composer version and reinstall dependencies.

Configuration

Configuration

Basic Configuration

MCP Server Setup

Create an mcp.json file in your project and add the following content:
json
{
  "mcpServers": {
    "croft": {
      "command": "./artisan",
      "args": ["croft"]
    }
  }
}

Security Settings

Store API keys in environment variables or secure configuration files
Set appropriate file access permissions

Advanced Configuration

Make additional configurations as needed.

Examples

Examples

Basic Usage

Verify MCP Server Startup

bash
php artisan croft

Querying the Database

bash
php artisan croft:query "SELECT * FROM users"

Retrieving Current Date and Time

bash
php artisan croft:datetime

Advanced Examples

Fetching Log Entries

bash
php artisan croft:logs --last=10

Listing Routes

bash
php artisan croft:routes

Use Cases

Check the database structure to identify necessary tables and columns.
Retrieve the current date and time to verify timestamps in log entries.
Filter specific routes to quickly find API endpoints.
Get a list of artisan commands to check available commands.