php-sdk/examples/client
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-26 12:39:27 +02:00
..
http_client_communication.php CS update after release of v3.95 (#282) 2026-04-26 12:39:27 +02:00
http_discovery_calculator.php CS update after release of v3.95 (#282) 2026-04-26 12:39:27 +02:00
README.md [Client] Feat: Implement MCP client component (#192) 2026-03-10 17:22:40 +01:00
stdio_client_communication.php CS update after release of v3.95 (#282) 2026-04-26 12:39:27 +02:00
stdio_discovery_calculator.php CS update after release of v3.95 (#282) 2026-04-26 12:39:27 +02:00

Client Examples

These examples demonstrate how to use the MCP PHP Client SDK.

STDIO Client

Connects to an MCP server running as a child process:

php examples/client/stdio_discovery_calculator.php

HTTP Client

Connects to an MCP server over HTTP:

# First, start an HTTP server
php -S localhost:8000 examples/server/discovery-calculator/server.php

# Then run the client
php examples/client/http_discovery_calculator.php

Requirements

All examples require the server examples to be available. The STDIO examples spawn the server process, while the HTTP examples connect to a running HTTP server.