Skip to content

Prepare package slicing by strict namespace refactoring into Client, Schema, and Server - #493

Open
chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:package-slicing
Open

Prepare package slicing by strict namespace refactoring into Client, Schema, and Server#493
chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:package-slicing

Conversation

@chr-hertel

@chr-hertel chr-hertel commented Sep 1, 2026

Copy link
Copy Markdown
Member

Proposal to rework namespaces in favor of slicing mcp/sdk package, see #489

  1. Moved everything below Mcp\Client, Mcp\Schema, or Mcp\Server
  2. Distributed Mcp\Exception into component specific namespaces

Next steps would be:

  • introduce composer setups per component
  • configure split.sh
  • ???

@chr-hertel
chr-hertel requested review from soyuka and a balanced review from Copilot September 1, 2026 20:49
@chr-hertel chr-hertel added the Server Issues & PRs related to the Server component label Sep 1, 2026
@chr-hertel chr-hertel added Client Issues & PRs related to the Client component Schema Issues & PRs related to the Schema component labels Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread tests/Unit/Client/BuilderTest.php Outdated
Comment thread tests/Unit/Client/ClientTest.php Outdated
Comment thread tests/Unit/Client/ConfigurationTest.php Outdated
Comment thread tests/Unit/Client/Stateless/InputRequestResolverTest.php Outdated
Comment thread tests/Unit/Client/Transport/HttpTransportTest.php Outdated
Comment thread docs/servers/resources.md
Comment thread README.md
Comment thread deptrac.yaml Outdated
Comment thread docs/handlers/index.md
Comment thread docs/handlers/logging.md
@chr-hertel
chr-hertel force-pushed the package-slicing branch 3 times, most recently from 780db8a to fc18fd4 Compare September 1, 2026 22:41
@chr-hertel chr-hertel added the breaking change Breaking the Backwards Compatibility Promise label Sep 1, 2026
@chr-hertel chr-hertel added this to the 1.0 milestone Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking the Backwards Compatibility Promise Client Issues & PRs related to the Client component Schema Issues & PRs related to the Schema component Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants