PHP code example of anilcancakir / laravel-agent-mcp

1. Go to this page and download the library: Download anilcancakir/laravel-agent-mcp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anilcancakir / laravel-agent-mcp example snippets


'readonly' => [
    'driver'   => 'sqlite',
    'database' => database_path('your.sqlite'),
    'options'  => [\PDO::SQLITE_ATTR_OPEN_FLAGS => \PDO::SQLITE_OPEN_READONLY],
],
bash
php -r "echo bin2hex(random_bytes(32));"   # generate a strong key
bash
php artisan agent-mcp:call db_schema '{"table":"users"}'
echo '{"sql":"select count(*) as c from failed_jobs"}' | php artisan agent-mcp:call db_raw_select
bash
php artisan agent-mcp:install --mode=mcp   # default
php artisan agent-mcp:install --mode=cli
bash
php artisan boost:install
# or, if boost is already installed:
php artisan boost:update --discover
sql
CREATE ROLE agent_readonly LOGIN PASSWORD 'strong-password-here';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO agent_readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO agent_readonly;