Prepare package slicing by strict namespace refactoring into Client, Schema, and Server - #493
Prepare package slicing by strict namespace refactoring into Client, Schema, and Server#493chr-hertel wants to merge 1 commit into
Conversation
c8d14f9 to
d5c5cf5
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Numerous tests expect exceptions from the wrong slice, several examples reference invalid namespaces, and Deptrac is not enforced by CI.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Refactors the SDK into distinct Client, Schema, and Server namespaces in preparation for package slicing.
Changes:
- Moves facades, capabilities, events, exceptions, and shared protocol types into slice-specific namespaces.
- Updates tests, examples, documentation, and autoloading references.
- Adds Deptrac boundaries and inspector snapshots.
File summaries
| File group | Description |
|---|---|
src/Client/** |
Refactors client APIs and exceptions. |
src/Schema/** |
Consolidates shared protocol types and schema exceptions. |
src/Server/** |
Refactors server APIs, capabilities, events, and exceptions. |
tests/Unit/** |
Migrates unit tests and fixtures. |
tests/Integration/** |
Updates integration imports and fixtures. |
tests/Conformance/** |
Updates conformance entry points. |
tests/Inspector/** |
Adds structured-result snapshots. |
examples/** |
Migrates client and server examples. |
docs/**, README.md |
Updates public namespace guidance. |
composer.json, deptrac.yaml, phpstan.dist.neon, .gitignore |
Configures architecture tooling and relocated paths. |
Review details
Suppressed comments (1)
docs/client/errors.md:24
- Client requests throw
Mcp\Client\Exception\RequestException. Catching the server-slice sibling will not handle$client->callTool()failures.
- Files reviewed: 299/423 changed files
- Comments generated: 43
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
780db8a to
fc18fd4
Compare
…Schema, and Server
fc18fd4 to
42859cd
Compare
|
For splitsh this is how we did on API Platform: https://github.com/api-platform/core/blob/main/.github/workflows/release.yml#L21-L50 Pretty straightforward, not sure how it works on Symfony but AFAIR it was a bit more complex :p. Note that testing may also be a bit of a headache if we allow wider version constraint on one of these packages... +1 to keep tests global to this repo (sometimes its interesting to have component specific tests especially that tests also get published along the source code though it makes things more complicated). |
Proposal to rework namespaces in favor of slicing
mcp/sdkpackage, see #489Mcp\Client,Mcp\Schema, orMcp\ServerMcp\Exceptioninto component specific namespacesNext steps would be: