Skip to content
docsv0.1.0

McpServerException

Exception thrown when MCP server returns an error response.

McpServerException::__construct()

public function __construct(string $message, int $errorCode, ?array $errorData = null, ?string $serverName = null):

Parameters

Parameters of __construct()
NameTypeDescription
$messagestringError message
$errorCodeintMCP error code
$errorData(array<string, mixed> | null)Additional error data from the server
$serverName(string | null)Name of the MCP server