PHP Classes

How Can PHP Prompt User for Input and Use Artificial Intelligence Services to Retrieve the Responses to the User Requests Using the Package Laravel MCP SDK: Create tools to process user requests with prompts

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2025-08-27 (Yesterday) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
laravel-mcp-sdk 1.0MIT/X Consortium ...7Libraries, Web services, Artificial i..., P...
Description 

Author

This package can be used to create tools to process user requests with prompts.

It provides a Laravel service provider class that can call APIs of remote services to provide responses to requests from users entered in a prompt.

The package sends the request to the remote services using HTTP requests and returns the responses to the client.

It can also be used to implement tools that provide responses to the user requests using callback functions.

Laravel Based Implementation for Model Context Protocol

Picture of Mohamed Ahmed
  Performance   Level  
Name: Mohamed Ahmed <contact>
Classes: 4 packages by
Country: Egypt Egypt
Innovation award
Innovation award
Nominee: 4x

Instructions

Documentation

Laravel MCP

A Laravel package for implementing the Model Context Protocol (MCP) in Laravel applications. This protocol facilitates communication between AI models and Laravel applications through standardized interfaces.

:star: We are now Featured on mcphub

? View Full Documentation

Requirements

System Requirements

  • PHP 8.1 or higher
  • Laravel 10.x
  • Composer 2.x
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • XML PHP Extension
  • Ctype PHP Extension
  • JSON PHP Extension
  • ReactPHP (for HTTP/WebSocket transport)
  • ext-json (for JSON handling)

Optional Requirements

  • Redis (for WebSocket scaling)
  • Supervisor (for process management)
  • ext-pcntl (for signal handling)
  • ext-posix (for process management)

Features

  • Multiple Transport Options - HTTP Transport (RESTful API) - WebSocket Transport (Real-time) - Stdio Transport (Command-line) - Configurable host and port settings
  • Server Capabilities - Tool registration and execution - Resource management - Prompt handling - Progress tracking - Logging system - Model preferences configuration
  • Tool System - Register custom tools with parameters - Handle tool calls with arguments - Return structured responses - Error handling and validation
  • Resource Management - URI-based resource access - Resource templates - Dynamic resource handling - Content type support
  • Prompt System - Template-based prompts - Dynamic argument handling - Context management - Message history support
  • Progress Tracking - Real-time progress updates - Token-based tracking - Total progress support - Client notification system
  • Logging System - Multiple log levels - Logger identification - Structured logging - Transport-agnostic logging

Documentation

The project includes comprehensive PHPDoc documentation for all classes and methods. The documentation is available directly in the source code and covers:

Core Components

  • Server Capabilities (`src/Capabilities/ServerCapabilities.php`) - Server feature management - Experimental features configuration - Logging configuration - Component capabilities (prompts, resources, tools)
  • Client Capabilities (`src/Capabilities/ClientCapabilities.php`) - Feature flag management - Root directory configuration - State serialization/deserialization

Component Capabilities

  • Tools Capability (`src/Capabilities/ToolsCapability.php`) - Tool list change tracking - State management - Change notification support
  • Resources Capability (`src/Capabilities/ResourcesCapability.php`) - Resource subscription management - Change tracking - State serialization
  • Prompts Capability (`src/Capabilities/PromptsCapability.php`) - Prompt list change tracking - State management - Change notifications
  • Roots Capability (`src/Capabilities/RootsCapability.php`) - Root directory management - Directory configuration - Access control settings

Server Management

  • MCP Server Command (`src/Commands/MCPServerCommand.php`) - Server startup configuration - Transport selection - Signal handling - Graceful shutdown

Each component includes: - Detailed class descriptions - Feature lists and capabilities - Configuration examples - Usage examples - Method documentation - Parameter descriptions - Return value documentation

To explore the documentation: 1. Browse the source files in the src/ directory 2. Use your IDE's PHPDoc integration 3. Generate HTML documentation using phpDocumentor (optional)

To generate HTML documentation:

composer require --dev phpdocumentor/phpdocumentor
vendor/bin/phpdoc -d src/ -t docs/

Installation

Install via Composer:

composer require laravelmcp/mcp

The package will automatically register its service provider and facade.

Configuration

  1. Publish the configuration:
    php artisan vendor:publish --provider="LaravelMCP\MCP\MCPServiceProvider" --tag="config"
    
  2. Configure environment variables:
    MCP_SERVER_HOST=127.0.0.1
    MCP_SERVER_PORT=8080
    MCP_SERVER_TRANSPORT=http
    

Basic Usage

Starting the Server

# Start the server with default HTTP transport
php artisan mcp:serve

# Start with specific transport and options
php artisan mcp:serve --transport=websocket --host=0.0.0.0 --port=8081

# Start with stdio transport (useful for CLI applications)
php artisan mcp:serve --transport=stdio

Server Setup

use LaravelMCP\MCP\Server\MCPServer;
use LaravelMCP\MCP\Transport\HttpTransport;

// Create and configure server
$server = new MCPServer();

// Configure transport
$transport = new HttpTransport($server, [
    'host' => '127.0.0.1',
    'port' => 8080
]);

$server->setTransport($transport);
$server->initialize();

// Start the server
$server->start();

Using Different Transports

use LaravelMCP\MCP\Transport\WebSocketTransport;
use LaravelMCP\MCP\Transport\StdioTransport;
use LaravelMCP\MCP\Transport\TransportFactory;

// Using WebSocket transport
$wsTransport = new WebSocketTransport($server, [
    'host' => '0.0.0.0',
    'port' => 8081
]);

// Using Stdio transport (for CLI applications)
$stdioTransport = new StdioTransport($server);

// Using transport factory
$factory = new TransportFactory();
$transport = $factory->create('http', $server, [
    'host' => '127.0.0.1',
    'port' => 8080
]);

Registering Tools

use LaravelMCP\MCP\Server\FastMCP;
use LaravelMCP\MCP\Facades\MCP;

// Using FastMCP (recommended)
$mcp = new FastMCP();

// Register a simple calculation tool
$mcp->tool('calculate', [
    'num1' => ['type' => 'number', 'required' => true],
    'num2' => ['type' => 'number', 'required' => true],
    'operation' => ['type' => 'string', 'required' => true]
])(function ($args) {
    $num1 = $args['num1'];
    $num2 = $args['num2'];
    $operation = $args['operation'];
    
    return match ($operation) {
        '+' => ['result' => $num1 + $num2],
        '-' => ['result' => $num1 - $num2],
        '' => ['result' => $num1 $num2],
        '/' => $num2 != 0 ? ['result' => $num1 / $num2] : ['error' => 'Division by zero'],
        default => ['error' => 'Invalid operation']
    };
});

// Register a tool with error handling
$mcp->tool('process-data', [
    'items' => ['type' => 'array', 'required' => true],
    'token' => ['type' => 'string', 'required' => false]
])(function ($args) use ($mcp) {
    try {
        $items = $args['items'];
        $token = $args['token'] ?? uniqid();
        
        foreach ($items as $index => $item) {
            // Process item
            $progress = ($index + 1) / count($items);
            MCP::sendProgress($progress, $token, count($items));
            MCP::sendLog("Processing item {$index + 1}", 'info', 'processor');
        }
        
        return ['processed' => count($items)];
    } catch (\Exception $e) {
        MCP::sendLog($e->getMessage(), 'error', 'processor');
        return ['error' => $e->getMessage()];
    }
});

Managing Resources

// Register a file resource
$mcp->resource('file://{path}')(function ($matches) {
    $path = $matches['path'] ?? null;
    if (!$path || !file_exists($path)) {
        return ['error' => 'File not found'];
    }
    
    return [
        'content' => file_get_contents($path),
        'metadata' => [
            'size' => filesize($path),
            'modified' => filemtime($path),
            'mime' => mime_content_type($path)
        ]
    ];
});

// Register a database resource
$mcp->resource('db://{table}/{id}')(function ($matches) {
    $table = $matches['table'] ?? null;
    $id = $matches['id'] ?? null;
    
    if (!$table || !$id) {
        return ['error' => 'Invalid parameters'];
    }
    
    try {
        $record = DB::table($table)->find($id);
        return $record ? ['data' => $record] : ['error' => 'Record not found'];
    } catch (\Exception $e) {
        return ['error' => $e->getMessage()];
    }
});

// Register a health check resource
$mcp->resource('/health')(function () {
    return ['status' => 'ok'];
});

Handling Prompts

// Basic prompt template
$mcp->prompt('code-review', [
    'language' => ['type' => 'string', 'required' => true],
    'code' => ['type' => 'string', 'required' => true]
])(function ($args) {
    return [
        ['role' => 'system', 'content' => 'You are a code review assistant.'],
        ['role' => 'user', 'content' => "Please review this {$args['language']} code:\n\n{$args['code']}"]
    ];
});

// Prompt with context
$mcp->prompt('chat', [
    'message' => ['type' => 'string', 'required' => true],
    'context' => ['type' => 'array', 'required' => false]
])(function ($args) {
    $messages = $args['context'] ?? [];
    $messages[] = [
        'role' => 'user',
        'content' => $args['message']
    ];
    return $messages;
});

Progress and Logging

use LaravelMCP\MCP\Facades\MCP;

// Send progress updates
MCP::sendProgress(0.5, 'task_123', 1.0);

// Send logs with different levels
MCP::sendLog('Processing started', 'info', 'processor');
MCP::sendLog('Warning: Rate limit approaching', 'warning', 'rate-limiter');
MCP::sendLog('Error occurred: Invalid input', 'error', 'validator');
MCP::sendLog('Debug: Request payload', 'debug', 'http');

Model Preferences

use LaravelMCP\MCP\Sampling\ModelPreferences;

// Basic model preferences
$preferences = new ModelPreferences(
    costPriority: 0.5,
    intelligencePriority: 0.8,
    speedPriority: 0.3
);
MCP::setModelPreferences($preferences);

// Model preferences with hints
$preferences = new ModelPreferences(
    costPriority: 0.7,
    intelligencePriority: 0.9,
    speedPriority: 0.4,
    hints: ['creative', 'concise']
);
MCP::setModelPreferences($preferences);

// Create from array
$preferences = ModelPreferences::create([
    'costPriority' => 0.6,
    'intelligencePriority' => 0.8,
    'speedPriority' => 0.5,
    'hints' => ['detailed', 'technical']
]);
MCP::setModelPreferences($preferences);

Error Handling

use LaravelMCP\MCP\Facades\MCP;

try {
    // Initialize server
    $server = new MCPServer();
    
    if (!$server->getTransport()) {
        throw new RuntimeException('Transport not initialized');
    }
    
    // Handle tool call
    $result = $server->handleToolCall('test_tool', [
        'param1' => 'value1',
        'param2' => 'value2'
    ]);
    
    // Handle resource request
    $resource = $server->handleResourceRequest('test://resource');
    
    // Handle prompt request
    $prompt = $server->handlePromptRequest('test_prompt', [
        'arg1' => 'value1'
    ]);
    
} catch (RuntimeException $e) {
    MCP::sendLog("Runtime error: {$e->getMessage()}", 'error', 'server');
} catch (\Exception $e) {
    MCP::sendLog("Unexpected error: {$e->getMessage()}", 'error', 'server');
}

Fun with LLMs: Building a Code Review Assistant

Here's a complete example of building a code review assistant that can analyze code, suggest improvements, and even fix bugs:

use LaravelMCP\MCP\Server\FastMCP;
use LaravelMCP\MCP\Facades\MCP;
use Illuminate\Support\Facades\Storage;

$mcp = new FastMCP();

// Register a tool for analyzing code complexity
$mcp->tool('analyze-complexity', [
    'code' => ['type' => 'string', 'required' => true],
    'language' => ['type' => 'string', 'required' => true]
])(function ($args) {
    // Simulate complexity analysis
    $metrics = [
        'cyclomatic' => random_int(1, 10),
        'cognitive' => random_int(1, 15),
        'lines' => count(explode("\n", $args['code']))
    ];
    
    return [
        'metrics' => $metrics,
        'suggestion' => $metrics['cyclomatic'] > 5 ? 'Consider breaking down this function' : 'Complexity is acceptable'
    ];
});

// Register a code improvement prompt
$mcp->prompt('suggest-improvements', [
    'code' => ['type' => 'string', 'required' => true],
    'language' => ['type' => 'string', 'required' => true],
    'context' => ['type' => 'string', 'required' => false]
])(function ($args) {
    $messages = [
        [
            'role' => 'system',
            'content' => "You are an expert {$args['language']} developer. Analyze the code and suggest improvements for:
                         1. Performance
                         2. Readability
                         3. Best practices
                         4. Potential bugs
                         Be specific and provide examples."
        ],
        [
            'role' => 'user',
            'content' => "Here's the code to review:\n\n```{$args['language']}\n{$args['code']}\n```"
        ]
    ];
    
    if (isset($args['context'])) {
        $messages[] = [
            'role' => 'user',
            'content' => "Additional context: {$args['context']}"
        ];
    }
    
    return $messages;
});

// Register a resource for storing review history
$mcp->resource('reviews://{file_hash}')(function ($matches) {
    $hash = $matches['file_hash'] ?? null;
    if (!$hash) return ['error' => 'Invalid file hash'];
    
    $reviewPath = "reviews/{$hash}.json";
    if (!Storage::exists($reviewPath)) {
        return ['error' => 'No review history found'];
    }
    
    return ['history' => json_decode(Storage::get($reviewPath), true)];
});

// Create a fun code review workflow
$mcp->tool('review-code', [
    'code' => ['type' => 'string', 'required' => true],
    'language' => ['type' => 'string', 'required' => true],
    'style' => ['type' => 'string', 'enum' => ['serious', 'fun', 'sarcastic'], 'default' => 'serious']
])(function ($args) use ($mcp) {
    $fileHash = md5($args['code']);
    $reviewToken = uniqid('review_');
    
    try {
        // Step 1: Analyze complexity
        MCP::sendProgress(0.2, $reviewToken, "Analyzing code complexity...");
        $complexity = $mcp->call('analyze-complexity', [
            'code' => $args['code'],
            'language' => $args['language']
        ]);
        
        // Step 2: Get improvement suggestions
        MCP::sendProgress(0.5, $reviewToken, "Getting expert suggestions...");
        $personality = match($args['style']) {
            'fun' => "Be playful and use coding puns, but maintain professionalism.",
            'sarcastic' => "Use witty, sarcastic humor (but stay constructive and kind).",
            default => "Be direct and professional."
        };
        
        $suggestions = $mcp->prompt('suggest-improvements', [
            'code' => $args['code'],
            'language' => $args['language'],
            'context' => "Please {$personality}\nComplexity metrics: " . json_encode($complexity['metrics'])
        ]);
        
        // Step 3: Store review history
        MCP::sendProgress(0.8, $reviewToken, "Saving review history...");
        Storage::put("reviews/{$fileHash}.json", json_encode([
            'timestamp' => now(),
            'complexity' => $complexity,
            'suggestions' => $suggestions,
            'style' => $args['style']
        ]));
        
        // Step 4: Format response
        MCP::sendProgress(1.0, $reviewToken, "Done!");
        
        $funnyComments = [
            'fun' => [
                "? Game Over! Your code review is ready!",
                "? Hit the target! Here's your review!",
                "? Step right up to see your code review!"
            ],
            'sarcastic' => [
                "? Oh look, another masterpiece to review...",
                "? Ladies and gentlemen, behold this code!",
                "? Well, well, well... what do we have here?"
            ],
            'serious' => [
                "? Code review completed",
                "? Analysis complete",
                "? Review finished"
            ]
        ];
        
        return [
            'message' => $funnyComments[$args['style']][array_rand($funnyComments[$args['style']])],
            'complexity' => $complexity,
            'suggestions' => $suggestions,
            'history_uri' => "reviews://{$fileHash}"
        ];
        
    } catch (\Exception $e) {
        MCP::sendLog("Review error: {$e->getMessage()}", 'error', 'reviewer');
        return ['error' => "Oops! The code reviewer needs coffee! ({$e->getMessage()})"];
    }
});

// Example usage:
$result = $mcp->call('review-code', [
    'code' => '
        function fibonacci($n) {
            if ($n <= 1) return $n;
            return fibonacci($n - 1) + fibonacci($n - 2);
        }
    ',
    'language' => 'php',
    'style' => 'fun'
]);

// Output might include fun messages like:
// "? Game Over! Your code review is ready!"
// With suggestions about using memoization for better performance
// and adding parameter validation! 

This example demonstrates: 1. Tool registration with complexity analysis 2. Custom prompt templates with personality 3. Resource management for review history 4. Progress tracking with fun messages 5. Error handling with humor 6. Integration of multiple MCP features 7. Real-world code improvement workflow

Testing

Run the test suite:

composer test

Contributing

Please see CONTRIBUTING.md for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


  Files folder image Files (129)  
File Role Description
Files folder image.github (1 directory)
Files folder imageconfig (1 file)
Files folder imagedocs (2 files, 1 directory)
Files folder imageexamples (6 files)
Files folder imagescripts (1 file)
Files folder imagesrc (4 files, 11 directories)
Files folder imagetests (1 file, 5 directories)
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file .php-cs-fixer.php Example Example script
Accessible without login Plain text file check.bat Data Auxiliary data
Accessible without login Plain text file codecov.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file coverage.xml Data Auxiliary data
Accessible without login Plain text file FILE_INDEX.md Data Auxiliary data
Accessible without login HTML file index.html Doc. Documentation
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpcs.xml Data Auxiliary data
Accessible without login Plain text file phpdoc.dist.xml Data Auxiliary data
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (129)  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files (129)  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file tests.yml Data Auxiliary data

  Files folder image Files (129)  /  config  
File Role Description
  Accessible without login Plain text file mcp.php Conf. Configuration script

  Files folder image Files (129)  /  docs  
File Role Description
Files folder imageapi (32 files)
  Accessible without login Plain text file index.md Data Auxiliary data
  Accessible without login Plain text file index.rst Data Auxiliary data

  Files folder image Files (129)  /  docs  /  api  
File Role Description
  Accessible without login Plain text file _ .md Data Auxiliary data
  Accessible without login Plain text file _ClientCapabilities.md Data Auxiliary data
  Accessible without login Plain text file _CompletionRequest.md Data Auxiliary data
  Accessible without login Plain text file _FastMCP.md Data Auxiliary data
  Accessible without login Plain text file _HttpClientTransport.md Data Auxiliary data
  Accessible without login Plain text file _HttpTransport.md Data Auxiliary data
  Accessible without login Plain text file _Implementation.md Data Auxiliary data
  Accessible without login Plain text file _LoggingMessageNotification.md Data Auxiliary data
  Accessible without login Plain text file _MCP.md Data Auxiliary data
  Accessible without login Plain text file _MCPClient.md Data Auxiliary data
  Accessible without login Plain text file _MCPServer.md Data Auxiliary data
  Accessible without login Plain text file _MCPServerCommand.md Data Auxiliary data
  Accessible without login Plain text file _MCPServiceProvider.md Data Auxiliary data
  Accessible without login Plain text file _ModelPreferences.md Data Auxiliary data
  Accessible without login Plain text file _PaginatedRequest.md Data Auxiliary data
  Accessible without login Plain text file _PaginatedResult.md Data Auxiliary data
  Accessible without login Plain text file _ProgressNotification.md Data Auxiliary data
  Accessible without login Plain text file _Prompt.md Data Auxiliary data
  Accessible without login Plain text file _PromptsCapability.md Data Auxiliary data
  Accessible without login Plain text file _Resource.md Data Auxiliary data
  Accessible without login Plain text file _ResourcesCapability.md Data Auxiliary data
  Accessible without login Plain text file _ResourceTemplate.md Data Auxiliary data
  Accessible without login Plain text file _Root.md Data Auxiliary data
  Accessible without login Plain text file _RootsCapability.md Data Auxiliary data
  Accessible without login Plain text file _ServerCapabilities.md Data Auxiliary data
  Accessible without login Plain text file _StdioTransport.md Data Auxiliary data
  Accessible without login Plain text file _Tool.md Data Auxiliary data
  Accessible without login Plain text file _ToolsCapability.md Data Auxiliary data
  Accessible without login Plain text file _TransportFactory.md Data Auxiliary data
  Accessible without login Plain text file _WebSocketTransport.md Data Auxiliary data
  Accessible without login Plain text file __.md Data Auxiliary data
  Accessible without login Plain text file ______________.md Data Auxiliary data

  Files folder image Files (129)  /  examples  
File Role Description
  Plain text file cli_tool.php Class Class source
  Accessible without login Plain text file http_client.php Example Example script
  Plain text file http_server.php Class Class source
  Accessible without login Plain text file README.md Doc. Documentation
  Accessible without login Plain text file websocket_client.php Example Example script
  Plain text file websocket_server.php Class Class source

  Files folder image Files (129)  /  scripts  
File Role Description
  Accessible without login Plain text file generate-docs.php Example Example script

  Files folder image Files (129)  /  src  
File Role Description
Files folder imageCapabilities (6 files, 1 directory)
Files folder imageCommands (1 file)
Files folder imageContracts (8 files)
Files folder imageFacades (1 file)
Files folder imageLogging (1 file)
Files folder imageNotifications (2 files)
Files folder imagePagination (2 files)
Files folder imageRequests (1 file)
Files folder imageSampling (1 file)
Files folder imageServer (6 files)
Files folder imageTransport (5 files)
  Plain text file Implementation.php Class Class source
  Plain text file MCPClient.php Class Class source
  Plain text file MCPServiceProvider.php Class Class source
  Plain text file Root.php Class Class source

  Files folder image Files (129)  /  src  /  Capabilities  
File Role Description
Files folder imageServerCapabilities (2 files)
  Plain text file ClientCapabilities.php Class Class source
  Plain text file PromptsCapability.php Class Class source
  Plain text file ResourcesCapability.php Class Class source
  Plain text file RootsCapability.php Class Class source
  Plain text file ServerCapabilities.php Class Class source
  Plain text file ToolsCapability.php Class Class source

  Files folder image Files (129)  /  src  /  Capabilities  /  ServerCapabilities  
File Role Description
  Plain text file PromptsCapability.php Class Class source
  Plain text file ResourcesCapability.php Class Class source

  Files folder image Files (129)  /  src  /  Commands  
File Role Description
  Plain text file MCPServerCommand.php Class Class source

  Files folder image Files (129)  /  src  /  Contracts  
File Role Description
  Plain text file MCPServerInterface.php Class Class source
  Plain text file NotificationInterface.php Class Class source
  Plain text file PromptInterface.php Class Class source
  Plain text file RequestInterface.php Class Class source
  Plain text file ResourceInterface.php Class Class source
  Plain text file ResourceTemplateInterface.php Class Class source
  Plain text file ToolInterface.php Class Class source
  Plain text file TransportInterface.php Class Class source

  Files folder image Files (129)  /  src  /  Facades  
File Role Description
  Plain text file MCP.php Class Class source

  Files folder image Files (129)  /  src  /  Logging  
File Role Description
  Accessible without login Plain text file LoggingLevel.php Example Example script

  Files folder image Files (129)  /  src  /  Notifications  
File Role Description
  Plain text file LoggingMessageNotification.php Class Class source
  Plain text file ProgressNotification.php Class Class source

  Files folder image Files (129)  /  src  /  Pagination  
File Role Description
  Plain text file PaginatedRequest.php Class Class source
  Plain text file PaginatedResult.php Class Class source

  Files folder image Files (129)  /  src  /  Requests  
File Role Description
  Plain text file CompletionRequest.php Class Class source

  Files folder image Files (129)  /  src  /  Sampling  
File Role Description
  Plain text file ModelPreferences.php Class Class source

  Files folder image Files (129)  /  src  /  Server  
File Role Description
  Plain text file FastMCP.php Class Class source
  Plain text file MCPServer.php Class Class source
  Plain text file Prompt.php Class Class source
  Plain text file Resource.php Class Class source
  Plain text file ResourceTemplate.php Class Class source
  Plain text file Tool.php Class Class source

  Files folder image Files (129)  /  src  /  Transport  
File Role Description
  Plain text file HttpClientTransport.php Class Class source
  Plain text file HttpTransport.php Class Class source
  Plain text file StdioTransport.php Class Class source
  Plain text file TransportFactory.php Class Class source
  Plain text file WebSocketTransport.php Class Class source

  Files folder image Files (129)  /  tests  
File Role Description
Files folder imageFacades (1 file)
Files folder imageFeature (3 files)
Files folder imageServer (1 file)
Files folder imageTransport (4 files)
Files folder imageUnit (5 files, 8 directories)
  Plain text file TestCase.php Class Class source

  Files folder image Files (129)  /  tests  /  Facades  
File Role Description
  Plain text file MCPTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Feature  
File Role Description
  Plain text file ExampleTest.php Class Class source
  Plain text file MCPServerTest.php Class Class source
  Plain text file ServerRunner.php Class Class source

  Files folder image Files (129)  /  tests  /  Server  
File Role Description
  Plain text file MCPServerTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Transport  
File Role Description
  Plain text file HttpTransportTest.php Class Class source
  Plain text file StdioTransportTest.php Class Class source
  Plain text file TransportTest.php Class Class source
  Plain text file WebSocketTransportTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  
File Role Description
Files folder imageCapabilities (5 files, 1 directory)
Files folder imageCommands (1 file)
Files folder imageLogging (1 file)
Files folder imageNotifications (1 file)
Files folder imagePagination (2 files)
Files folder imageRequests (1 file)
Files folder imageSampling (1 file)
Files folder imageServer (2 files)
  Plain text file ExampleTest.php Class Class source
  Plain text file ImplementationTest.php Class Class source
  Plain text file MCPClientTest.php Class Class source
  Plain text file MCPServiceProviderTest.php Class Class source
  Plain text file RootTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Capabilities  
File Role Description
Files folder imageServerCapabilities (2 files)
  Plain text file CapabilitiesTest.php Class Class source
  Plain text file PromptsCapabilityTest.php Class Class source
  Plain text file ResourcesCapabilityTest.php Class Class source
  Plain text file RootsCapabilityTest.php Class Class source
  Plain text file ToolsCapabilityTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Capabilities  /  ServerCapabilities  
File Role Description
  Plain text file PromptsCapabilityTest.php Class Class source
  Plain text file ResourcesCapabilityTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Commands  
File Role Description
  Plain text file MCPServerCommandTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Logging  
File Role Description
  Plain text file LoggingLevelTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Notifications  
File Role Description
  Plain text file ProgressNotificationTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Pagination  
File Role Description
  Plain text file PaginatedResultTest.php Class Class source
  Plain text file PaginationTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Requests  
File Role Description
  Plain text file CompletionRequestTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Sampling  
File Role Description
  Plain text file ModelPreferencesTest.php Class Class source

  Files folder image Files (129)  /  tests  /  Unit  /  Server  
File Role Description
  Plain text file FastMCPTest.php Class Class source
  Plain text file MCPServerTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0