Refactor: Decouple Server Core, Enhance API & Introduce v2.0 Architecture #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a comprehensive architectural refactoring of the package, establishing the foundation for
v2.0.0. The primary goals achieved are:Serverlogic from network/IO viaServerTransportInterface.ServerBuilder, explicit$server->listen(Transport),$server->getProtocol(), and on-demand$server->discover(...).ConfigurationRepositoryInterfacewithConfigurationandModel\CapabilitiesVOs. Simplified component dependencies and improved defaultBasicContainer.ClientStateManager(wasTransportState) now defaults toArrayCache.Registrycaching now applies only to discovered elements, prioritizing manual registrations.StdioServerTransport(custom streams, Windows STDIN/STDOUT fix) andHttpServerTransport(constructor for server params).formatinference fromSchemaGeneratorfor more predictable default schemas.Key Changes:
ServerBuilder,Configuration,Model\Capabilities,ServerTransportInterface,Protocol.Server,Registry,ClientStateManager,Processor, transport implementations.$server->discover().McpServerExceptionas base.SchemaGeneratorno longer infers stringformats.tools/callerror messages for schema validation failures.README.mdand all examples.Breaking Changes:
Yes, this is a significant refactoring with breaking changes to the public API, particularly around server instantiation (
ServerBuilder), running the server (listen), discovery (discover), and transport usage. These changes are necessary for thev2.0.0release and will be detailed in the release notes.Related Issues: