You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7105cab
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,8 @@ All notable changes to `mcp/sdk` will be documented in this file.
26
26
* Tool, prompt and resource results and `TextContent` encode arrays and objects as compact JSON instead of pretty-printed JSON.
27
27
* Fix the result of a retried `resources/read` leaving out the required `ttlMs` and `cacheScope`, which the TypeScript SDK's client rejects, or keeping the hints its handler set: it now always carries `ttlMs: 0` and `cacheScope: private`.
28
28
* Fix tool name validation not following the spec's rule (1 to 128 characters of `A-Z`, `a-z`, `0-9`, `_`, `-` and `.`): names of 65 to 128 characters no longer log a warning, while names with a `/` or a trailing newline now do.
29
+
*[BC Break]`Builder::setLazyLoading(true)` now also defers loading into a registry passed to `setRegistry()`, which any `RegistryInterface` supports. A registry you read directly stays empty until the server first reads it; without the call it is still loaded at build.
30
+
* Add `DeferredRegistryInterface`, so the builder loads a custom registry without announcing the load as list changes, and no longer depends on the concrete `Registry`.
29
31
* Split `RegistryInterface` by role into `ElementCatalogInterface`, `ElementResolverInterface` and `ElementWriterInterface`, which it extends. Request handlers depend on the role they use, so a handler can run against a catalog or resolver alone.
30
32
* Add `Psr6SessionStore` and `Psr6NotificationBus`, which work like `Psr16SessionStore` and `Psr16NotificationBus` over a PSR-6 cache pool. `Builder::setDiscovery()` also accepts a PSR-6 pool as `$cache`.
31
33
* Fix a nullable tool parameter with a default (e.g. `?string $category = 'books'`) receiving the default when the client explicitly sends `null`: `ReferenceHandler` now passes the `null` through.
Copy file name to clipboardExpand all lines: docs/run/server-builder.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -430,8 +430,8 @@ $server = Server::builder()
430
430
|`setSchemaGenerator()`| schemaGenerator | Replace the generator that builds input schemas from PHP types, see [Schema generation](../servers/schemas.md)|
431
431
|`setSchemaValidator()`| schemaValidator | Replace the validator for tool arguments and structured output, see [Schema generation](../servers/schemas.md)|
432
432
|`setReferenceHandler()`| referenceHandler | Replace the class that calls the handlers of tools, resources and prompts |
433
-
|`setRegistry()`| registry | Use your own registry. It is loaded when the server is built |
434
-
|`setLazyLoading()`| lazyLoading? | Load elements on the first registry read (default) or, with `false`, when the server is built |
433
+
|`setRegistry()`| registry | Use your own registry. It is loaded when the server is built, unless you call `setLazyLoading()`|
434
+
|`setLazyLoading()`| lazyLoading? | Load elements on the first registry read (default without `setRegistry()`) or, with `false`, when the server is built. Your own registry stays empty until the server first reads it|
435
435
|`addLoader()`| loader | Add a custom loader that registers elements |
436
436
|`addLoaders()`| loaders | Add several custom loaders |
437
437
|`addRequestHandler()`| handler | Prepend a single custom request handler |
0 commit comments