1. Go to this page and download the library: Download redberry/mcp-client-laravel 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/ */
use Redberry\MCPClient\Facades\MCPClient;
$github = MCPClient::connect('github');
use Redberry\MCPClient\Contracts\MCPClient;
class GithubToolService
{
public function __construct(private MCPClient $client) {}
public function tools()
{
return $this->client->connect('github')->tools();
}
}
$tools = $github->tools();
$tools->all(); // raw array
$tools->only('search', 'create_issue'); // by name
$tools->except('delete_repository'); // by name
$tools->map(fn ($tool) => $tool['name']);