Skip to content

Allow mcp/sdk ^0.8.1 next to ^0.9 - #47

Merged
vitaliiivanovspryker merged 1 commit into
masterfrom
bugfix/mcp-sdk-0-8-compatibility
Nov 1, 2026
Merged

vitaliiivanovspryker merged 1 commit into
masterfrom
bugfix/mcp-sdk-0-8-compatibility

Conversation

@vitaliiivanovspryker

Copy link
Copy Markdown
Contributor

PR Description

Widen the mcp/sdk constraint from ^0.9 to ^0.8.1 || ^0.9.

Why

ai-dev 0.8.0 replaced php-mcp/server with mcp/sdk ^0.9 (#43). api-platform/mcp requires mcp/sdk ^0.8 in all its releases, dev-main included. So a project with spryker-sdk/ai-dev 0.8.0 cannot install api-platform/mcp, because Composer can install only one mcp/sdk version. This blocks the Storefront API MCP work (PMIP-670).

Why this is safe

McpServerConsole and ExamplePrompt use only API that is the same in mcp/sdk 0.8.1 and 0.9.0:

  • Server::builder(), Server::run()
  • Builder::setServerInfo(), setDiscovery(), addPrompt(), addTool(), build(): identical signatures
  • StdioTransport with the default constructor
  • #[McpPrompt]

How I tested it

  • composer update -W --with mcp/sdk:0.8.1, then composer test: OK (138 tests, 965 assertions).
  • Stdio smoke test with the builder calls of McpServerConsole on 0.8.1 and on 0.9.0: initialize, prompts/list (finds you_are_welcome by discovery), tools/list and tools/call give the expected results.
  • The prefer-lowest CI job now resolves mcp/sdk 0.8.1.

Notes

  • On 0.8.x, stdio serves only the handshake protocol (2025-11-25 and earlier). Stdio support for 2026-07-28 came in 0.9.0. Coding agents (Claude Code, Copilot) use the handshake over stdio, so this does not change them.
  • Not caused by this PR: with --prefer-lowest, Composer installs psr/container 1.0.0, and the server then fails with Declaration of Mcp\Capability\Registry\Container::get(string $id): mixed must be compatible with Psr\Container\ContainerInterface::get($id). This happens with mcp/sdk 0.9.0 too, because both versions allow psr/container ^1.0 || ^2.0. The tests do not reach that class, so CI stays green. A follow-up can require psr/container ^1.1 || ^2.0.

Checklist

  • I agree with the Code Contribution License Agreement in CONTRIBUTING.md

https://claude.ai/code/session_01FJNNwwvzPyUiqfifdYCy99

* Widen the mcp/sdk constraint to "^0.8.1 || ^0.9"
* The MCP server console uses only API that is the same in 0.8.1 and 0.9.0: Server::builder(), Builder::setServerInfo(), setDiscovery(), addPrompt(), addTool(), build(), Server::run() and StdioTransport
* Lets projects install packages that still require mcp/sdk ^0.8, for example api-platform/mcp

Claude-Session: https://claude.ai/code/session_01FJNNwwvzPyUiqfifdYCy99
@vitaliiivanovspryker
vitaliiivanovspryker merged commit da859a7 into master Nov 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants