php-sdk/examples/08-schema-showcase-streamable/server.php
2025-08-29 11:19:51 +02:00

28 lines
747 B
PHP

#!/usr/bin/env php
<?php
/*
* This file is part of the official PHP MCP SDK.
*
* A collaboration between Symfony and the PHP Foundation.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once dirname(__DIR__).'/bootstrap.php';
chdir(__DIR__);
use Mcp\Server;
use Mcp\Server\Transports\StreamableHttpServerTransport;
logger()->info('Starting MCP Schema Showcase Server...');
Server::make()
->withServerInfo('Schema Showcase', '1.0.0')
->withLogger(logger())
->withDiscovery(__DIR__, ['.'])
->build()
->connect(new StreamableHttpServerTransport('127.0.0.1', 8080, 'mcp'));
logger()->info('Server listener stopped gracefully.');