Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/Conformance/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Mcp\Client\Transport\HttpTransport;
use Mcp\Schema\ClientCapabilities;
use Mcp\Schema\Enum\ElicitAction;
use Mcp\Schema\Enum\ProtocolVersion;
use Mcp\Schema\JsonRpc\Request;
use Mcp\Schema\JsonRpc\Response;
use Mcp\Schema\Request\ElicitRequest;
Expand All @@ -36,6 +37,7 @@

$builder = Client::builder()
->setClientInfo('mcp-conformance-test-client', '1.0.0')
->setProtocolVersion(ProtocolVersion::V2025_11_25)
->setInitTimeout(30)
->setRequestTimeout(60)
->setLogger($logger);
Expand Down
25 changes: 25 additions & 0 deletions tests/Conformance/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Mcp\Schema\Content\EmbeddedResource;
use Mcp\Schema\Content\ImageContent;
use Mcp\Schema\Content\TextContent;
use Mcp\Schema\Enum\ProtocolVersion;
use Mcp\Schema\Result\CallToolResult;
use Mcp\Server;
use Mcp\Server\Session\FileSessionStore;
Expand All @@ -37,6 +38,7 @@

$server = Server::builder()
->setServerInfo('mcp-conformance-test-server', '1.0.0')
->setProtocolVersion(ProtocolVersion::V2025_11_25)
->setSession(new FileSessionStore(__DIR__.'/sessions'))
->setLogger($logger)
// Tools
Expand All @@ -52,6 +54,29 @@
->addTool([Elements::class, 'toolWithElicitation'], name: 'test_elicitation', description: 'Tests server-initiated elicitation')
->addTool([Elements::class, 'toolWithElicitationDefaults'], name: 'test_elicitation_sep1034_defaults', description: 'Tests elicitation with default values')
->addTool([Elements::class, 'toolWithElicitationEnums'], name: 'test_elicitation_sep1330_enums', description: 'Tests elicitation with enum schemas')
->addTool(
static fn () => 'ok',
name: 'json_schema_2020_12_tool',
description: 'Tool with JSON Schema 2020-12 features',
inputSchema: [
'$schema' => 'https://json-schema.org/draft/2020-12/schema',
'type' => 'object',
'$defs' => [
'address' => [
'type' => 'object',
'properties' => [
'street' => ['type' => 'string'],
'city' => ['type' => 'string'],
],
],
],
'properties' => [
'name' => ['type' => 'string'],
'address' => ['$ref' => '#/$defs/address'],
],
'additionalProperties' => false,
],
)
// Resources
->addResource(static fn () => 'This is the content of the static text resource.', 'test://static-text', 'static-text', 'A static text resource for testing')
->addResource(static fn () => fopen('data://image/png;base64,'.Elements::TEST_IMAGE_BASE64, 'r'), 'test://static-binary', 'static-binary', 'A static binary resource (image) for testing')
Expand Down