Add redMCP Streamable HTTP server

This commit is contained in:
Jason Thistlethwaite
2026-04-25 02:23:48 +00:00
parent 3b6b4d6dba
commit 05c1a4bc97
11 changed files with 631 additions and 15 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
use RedMCP\McpDispatcher;
use RedMCP\McpEnvironment;
use RedMCP\McpHttpHandler;
use RedMCP\RedmineClient;
require __DIR__ . '/../vendor/autoload.php';
$env = McpEnvironment::load(__DIR__ . '/../.env');
$token = $env['mcp_server_token'];
if ($token === null) {
http_response_code(500);
header('Content-Type: application/json');
echo json_encode(['error' => 'MCP_SERVER_TOKEN is required']);
return;
}
$handler = new McpHttpHandler(
new McpDispatcher(RedmineClient::fromCredentials($env['redmine_url'], $env['redmine_api_key'])),
$token,
getenv('MCP_HTTP_PATH') ?: '/mcp'
);
$handler->handle();