| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .. | ||
| http_client_communication.php | ||
| http_discovery_calculator.php | ||
| README.md | ||
| stdio_client_communication.php | ||
| stdio_discovery_calculator.php | ||
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.