* feat(client): add complete MCP client SDK with STDIO and HTTP transports Add Client, Builder, ClientProtocol, ClientSession, and transport implementations for communicating with MCP servers. Supports tools, resources, prompts, and real-time progress/logging notifications. * refactor(examples): reorganize examples into server/ and client/ folders * feat: add SamplingRequestHandler for handling server sampling requests * feat: add setLoggingLevel method to control server logging verbosity * refactor: make progress token dependent on request ID * docs: Update server IP in usage instructions and add notes on sampling server requirements. * feat: add complete() method for completion/complete requests * refactor: properly parse and type initialize result * refactor: standardize method names * fix: revert changes to server related components * fix: revert changes to server related components * refactor: Restructure client transports and handlers into dedicated namespaces. * fix: cs and php-stan errors fixes(partial) * feat: Refactor request handlers to return `Response` or `Error` objects directly, adding a `SamplingException` and error logging for sampling requests. * feat: Replace `ClientTransportInterface` with `TransportInterface` and move response result deserialization to client methods. * refactor: remove redundant timeout check for intialize on transports The processFiber that executes per tick while fiber is suspended already handles timeouts while waiting * feat: broaden symfony/http-client dependency to support Symfony 5.4 to 8.0 * Update examples/client/README.md Co-authored-by: Christopher Hertel <mail@christopher-hertel.de> * Update examples/client/README.md Co-authored-by: Christopher Hertel <mail@christopher-hertel.de> * refactor: remove outgoing message queue from session and simplify transport send method to directly dispatch messages. * refactor: Replace ClientSession with ClientState for clearer intent on runtime state management * refactor: rename connectAndInitialize to connect for consistency * chore: cs fix * chore: use SamplingCallbackInterface instead of a closure for sampling request handler --------- Co-authored-by: Christopher Hertel <mail@christopher-hertel.de>
88 lines
No EOL
3.3 KiB
JSON
88 lines
No EOL
3.3 KiB
JSON
{
|
|
"name": "mcp/sdk",
|
|
"description": "Model Context Protocol SDK for Client and Server applications in PHP",
|
|
"license": "Apache-2.0",
|
|
"type": "library",
|
|
"authors": [
|
|
{
|
|
"name": "Christopher Hertel",
|
|
"email": "mail@christopher-hertel.de"
|
|
},
|
|
{
|
|
"name": "Kyrian Obikwelu",
|
|
"email": "koshnawaza@gmail.com"
|
|
},
|
|
{
|
|
"name": "Tobias Nyholm",
|
|
"email": "tobias.nyholm@gmail.com"
|
|
}
|
|
],
|
|
"require": {
|
|
"php": "^8.1",
|
|
"ext-fileinfo": "*",
|
|
"opis/json-schema": "^2.4",
|
|
"php-http/discovery": "^1.20",
|
|
"phpdocumentor/reflection-docblock": "^5.6",
|
|
"psr/clock": "^1.0",
|
|
"psr/container": "^1.0 || ^2.0",
|
|
"psr/event-dispatcher": "^1.0",
|
|
"psr/http-client": "^1.0",
|
|
"psr/http-factory": "^1.1",
|
|
"psr/http-message": "^1.1 || ^2.0",
|
|
"psr/http-server-handler": "^1.0",
|
|
"psr/http-server-middleware": "^1.0",
|
|
"psr/log": "^1.0 || ^2.0 || ^3.0",
|
|
"symfony/finder": "^5.4 || ^6.4 || ^7.3 || ^8.0",
|
|
"symfony/uid": "^5.4 || ^6.4 || ^7.3 || ^8.0"
|
|
},
|
|
"require-dev": {
|
|
"ext-openssl": "*",
|
|
"firebase/php-jwt": "^6.10 || ^7.0",
|
|
"laminas/laminas-httphandlerrunner": "^2.12",
|
|
"nyholm/psr7": "^1.8",
|
|
"nyholm/psr7-server": "^1.1",
|
|
"phar-io/composer-distributor": "^1.0.2",
|
|
"php-cs-fixer/shim": "^3.91",
|
|
"phpdocumentor/shim": "^3",
|
|
"phpstan/phpstan": "^2.1",
|
|
"phpunit/phpunit": "^10.5",
|
|
"psr/simple-cache": "^2.0 || ^3.0",
|
|
"symfony/cache": "^5.4 || ^6.4 || ^7.3 || ^8.0",
|
|
"symfony/console": "^5.4 || ^6.4 || ^7.3 || ^8.0",
|
|
"symfony/http-client": "^5.4 || ^6.4 || ^7.3 || ^8.0",
|
|
"symfony/process": "^5.4 || ^6.4 || ^7.3 || ^8.0"
|
|
},
|
|
"autoload": {
|
|
"psr-4": {
|
|
"Mcp\\": "src/"
|
|
}
|
|
},
|
|
"autoload-dev": {
|
|
"psr-4": {
|
|
"Mcp\\Example\\Server\\CachedDiscovery\\": "examples/server/cached-discovery/",
|
|
"Mcp\\Example\\Server\\ClientCommunication\\": "examples/server/client-communication/",
|
|
"Mcp\\Example\\Server\\ClientLogging\\": "examples/server/client-logging/",
|
|
"Mcp\\Example\\Server\\CombinedRegistration\\": "examples/server/combined-registration/",
|
|
"Mcp\\Example\\Server\\Elicitation\\": "examples/server/elicitation/",
|
|
"Mcp\\Example\\Server\\ComplexToolSchema\\": "examples/server/complex-tool-schema/",
|
|
"Mcp\\Example\\Server\\Conformance\\": "examples/server/conformance/",
|
|
"Mcp\\Example\\Server\\CustomDependencies\\": "examples/server/custom-dependencies/",
|
|
"Mcp\\Example\\Server\\CustomMethodHandlers\\": "examples/server/custom-method-handlers/",
|
|
"Mcp\\Example\\Server\\DiscoveryCalculator\\": "examples/server/discovery-calculator/",
|
|
"Mcp\\Example\\Server\\DiscoveryUserProfile\\": "examples/server/discovery-userprofile/",
|
|
"Mcp\\Example\\Server\\EnvVariables\\": "examples/server/env-variables/",
|
|
"Mcp\\Example\\Server\\ExplicitRegistration\\": "examples/server/explicit-registration/",
|
|
"Mcp\\Example\\Server\\OAuthKeycloak\\": "examples/server/oauth-keycloak/",
|
|
"Mcp\\Example\\Server\\OAuthMicrosoft\\": "examples/server/oauth-microsoft/",
|
|
"Mcp\\Example\\Server\\SchemaShowcase\\": "examples/server/schema-showcase/",
|
|
"Mcp\\Tests\\": "tests/"
|
|
}
|
|
},
|
|
"config": {
|
|
"allow-plugins": {
|
|
"php-http/discovery": false,
|
|
"phpdocumentor/shim": true
|
|
},
|
|
"sort-packages": true
|
|
}
|
|
} |