1. Go to this page and download the library: Download nixphp/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/ */
use function NixPHP\MCP\tokens;
$created = tokens()->create('Local AI client', ['*']);
echo $created->plainToken; // shown once, only the hash is stored
use NixPHP\MCP\Tools\ScopedToolInterface;
use NixPHP\MCP\Tools\ToolInterface;
final class ArticleSearchTool implements ToolInterface, ScopedToolInterface
{
public function
use NixPHP\MCP\Support\Schema;
use NixPHP\MCP\Tools\ToolInterface;
final class GetFolderSize implements ToolInterface
{
public function name(): string
{
return 'get_folder_size';
}
public function description(): string
{
return 'Returns the size of a folder.';
}
public function inputSchema(): array
{
return Schema::object()
->description($this->description())
->additionalProperties(false)
->prop('path', Schema::string()->description('Relative folder path'))
->