Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,9 @@ public Mono<Object> ping() {
* Adds a new root to the client's root list.
* @param root The root to add.
* @return A Mono that completes when the root is added and notifications are sent.
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public Mono<Void> addRoot(Root root) {

if (root == null) {
Expand Down Expand Up @@ -524,7 +526,9 @@ public Mono<Void> addRoot(Root root) {
* Removes a root from the client's root list.
* @param rootUri The URI of the root to remove.
* @return A Mono that completes when the root is removed and notifications are sent.
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public Mono<Void> removeRoot(String rootUri) {

if (rootUri == null) {
Expand Down Expand Up @@ -555,7 +559,9 @@ public Mono<Void> removeRoot(String rootUri) {
* methods automatically send the roots/list_changed notification if the client is in
* an initialized state.
* @return A Mono that completes when the notification is sent.
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public Mono<Void> rootsListChangedNotification() {
return this.initializer.withInitialization("sending roots list changed notification",
init -> init.mcpSession().sendNotification(McpSchema.METHOD_NOTIFICATION_ROOTS_LIST_CHANGED));
Expand Down Expand Up @@ -1110,7 +1116,9 @@ private NotificationHandler asyncLoggingNotificationHandler(
* @param loggingLevel The minimum logging level to receive.
* @return A Mono that completes when the logging level is set.
* @see McpSchema.LoggingLevel
* @deprecated Logging is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public Mono<Void> setLoggingLevel(LoggingLevel loggingLevel) {
if (loggingLevel == null) {
return Mono.error(new IllegalArgumentException("Logging level must not be null"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ public SyncSpec clientInfo(Implementation clientInfo) {
* @param roots A list of root definitions. Must not be null.
* @return This builder instance for method chaining
* @throws IllegalArgumentException if roots is null
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public SyncSpec roots(List<Root> roots) {
Assert.notNull(roots, "Roots must not be null");
for (Root root : roots) {
Expand All @@ -286,7 +288,9 @@ public SyncSpec roots(List<Root> roots) {
* @return This builder instance for method chaining
* @throws IllegalArgumentException if roots is null
* @see #roots(List)
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public SyncSpec roots(Root... roots) {
Assert.notNull(roots, "Roots must not be null");
for (Root root : roots) {
Expand All @@ -303,7 +307,9 @@ public SyncSpec roots(Root... roots) {
* results. Must not be null.
* @return This builder instance for method chaining
* @throws IllegalArgumentException if samplingHandler is null
* @deprecated Sampling is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public SyncSpec sampling(Function<CreateMessageRequest, CreateMessageResult> samplingHandler) {
Assert.notNull(samplingHandler, "Sampling handler must not be null");
this.samplingHandler = samplingHandler;
Expand Down Expand Up @@ -408,7 +414,9 @@ public SyncSpec promptsChangeConsumer(Consumer<List<McpSchema.Prompt>> promptsCh
* @param loggingConsumer A consumer that receives logging messages. Must not be
* null.
* @return This builder instance for method chaining
* @deprecated Logging is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public SyncSpec loggingConsumer(Consumer<McpSchema.LoggingMessageNotification> loggingConsumer) {
Assert.notNull(loggingConsumer, "Logging consumer must not be null");
this.loggingConsumers.add(loggingConsumer);
Expand All @@ -422,7 +430,9 @@ public SyncSpec loggingConsumer(Consumer<McpSchema.LoggingMessageNotification> l
* @param loggingConsumers A list of consumers that receive logging messages. Must
* not be null.
* @return This builder instance for method chaining
* @deprecated Logging is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public SyncSpec loggingConsumers(List<Consumer<McpSchema.LoggingMessageNotification>> loggingConsumers) {
Assert.notNull(loggingConsumers, "Logging consumers must not be null");
this.loggingConsumers.addAll(loggingConsumers);
Expand Down Expand Up @@ -689,7 +699,9 @@ public AsyncSpec clientInfo(Implementation clientInfo) {
* @param roots A list of root definitions. Must not be null.
* @return This builder instance for method chaining
* @throws IllegalArgumentException if roots is null
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public AsyncSpec roots(List<Root> roots) {
Assert.notNull(roots, "Roots must not be null");
for (Root root : roots) {
Expand All @@ -705,7 +717,9 @@ public AsyncSpec roots(List<Root> roots) {
* @return This builder instance for method chaining
* @throws IllegalArgumentException if roots is null
* @see #roots(List)
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public AsyncSpec roots(Root... roots) {
Assert.notNull(roots, "Roots must not be null");
for (Root root : roots) {
Expand All @@ -722,7 +736,9 @@ public AsyncSpec roots(Root... roots) {
* results. Must not be null.
* @return This builder instance for method chaining
* @throws IllegalArgumentException if samplingHandler is null
* @deprecated Sampling is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public AsyncSpec sampling(Function<CreateMessageRequest, Mono<CreateMessageResult>> samplingHandler) {
Assert.notNull(samplingHandler, "Sampling handler must not be null");
this.samplingHandler = samplingHandler;
Expand Down Expand Up @@ -829,7 +845,9 @@ public AsyncSpec promptsChangeConsumer(Function<List<McpSchema.Prompt>, Mono<Voi
* @param loggingConsumer A consumer that receives logging messages. Must not be
* null.
* @return This builder instance for method chaining
* @deprecated Logging is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public AsyncSpec loggingConsumer(Function<McpSchema.LoggingMessageNotification, Mono<Void>> loggingConsumer) {
Assert.notNull(loggingConsumer, "Logging consumer must not be null");
this.loggingConsumers.add(loggingConsumer);
Expand All @@ -843,7 +861,9 @@ public AsyncSpec loggingConsumer(Function<McpSchema.LoggingMessageNotification,
* @param loggingConsumers A list of consumers that receive logging messages. Must
* not be null.
* @return This builder instance for method chaining
* @deprecated Logging is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public AsyncSpec loggingConsumers(
List<Function<McpSchema.LoggingMessageNotification, Mono<Void>>> loggingConsumers) {
Assert.notNull(loggingConsumers, "Logging consumers must not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ class McpClientFeatures {
* in the {@code requestedSchema}.
*/
record Async(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities clientCapabilities,
Map<String, McpSchema.Root> roots, List<Function<List<McpSchema.Tool>, Mono<Void>>> toolsChangeConsumers,
@Deprecated Map<String, McpSchema.Root> roots,
List<Function<List<McpSchema.Tool>, Mono<Void>>> toolsChangeConsumers,
List<Function<List<McpSchema.Resource>, Mono<Void>>> resourcesChangeConsumers,
List<Function<List<McpSchema.ResourceContents>, Mono<Void>>> resourcesUpdateConsumers,
List<Function<List<McpSchema.Prompt>, Mono<Void>>> promptsChangeConsumers,
List<Function<McpSchema.LoggingMessageNotification, Mono<Void>>> loggingConsumers,
@Deprecated List<Function<McpSchema.LoggingMessageNotification, Mono<Void>>> loggingConsumers,
List<Function<McpSchema.ProgressNotification, Mono<Void>>> progressConsumers,
List<Function<McpSchema.ElicitationCompleteNotification, Mono<Void>>> elicitationCompleteConsumers,
Function<McpSchema.CreateMessageRequest, Mono<McpSchema.CreateMessageResult>> samplingHandler,
@Deprecated Function<McpSchema.CreateMessageRequest, Mono<McpSchema.CreateMessageResult>> samplingHandler,
Function<McpSchema.ElicitFormRequest, Mono<McpSchema.ElicitResult>> formElicitationHandler,
Function<McpSchema.ElicitUrlRequest, Mono<McpSchema.ElicitResult>> urlElicitationHandler,
boolean enableCallToolSchemaCaching, boolean applyElicitationDefaults) {
Expand All @@ -95,7 +96,10 @@ record Async(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities c
* @param applyElicitationDefaults whether the client should fill in missing
* fields of an accepted {@code ElicitResult.content} with the {@code default}
* values declared in the {@code requestedSchema}.
* @deprecated Roots, sampling, and logging are deprecated in the 2026-07-28 MCP
* specification.
*/
@Deprecated
public Async(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities clientCapabilities,
Map<String, McpSchema.Root> roots,
List<Function<List<McpSchema.Tool>, Mono<Void>>> toolsChangeConsumers,
Expand Down Expand Up @@ -137,6 +141,7 @@ public Async(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities c
/**
* @deprecated Only exists for backwards-compatibility purposes.
*/
@Deprecated
public Async(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities clientCapabilities,
Map<String, McpSchema.Root> roots,
List<Function<List<McpSchema.Tool>, Mono<Void>>> toolsChangeConsumers,
Expand Down Expand Up @@ -248,14 +253,14 @@ public static Async fromSync(Sync syncSpec) {
* in the {@code requestedSchema}.
*/
public record Sync(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities clientCapabilities,
Map<String, McpSchema.Root> roots, List<Consumer<List<McpSchema.Tool>>> toolsChangeConsumers,
@Deprecated Map<String, McpSchema.Root> roots, List<Consumer<List<McpSchema.Tool>>> toolsChangeConsumers,
List<Consumer<List<McpSchema.Resource>>> resourcesChangeConsumers,
List<Consumer<List<McpSchema.ResourceContents>>> resourcesUpdateConsumers,
List<Consumer<List<McpSchema.Prompt>>> promptsChangeConsumers,
List<Consumer<McpSchema.LoggingMessageNotification>> loggingConsumers,
@Deprecated List<Consumer<McpSchema.LoggingMessageNotification>> loggingConsumers,
List<Consumer<McpSchema.ProgressNotification>> progressConsumers,
List<Consumer<McpSchema.ElicitationCompleteNotification>> elicitationCompleteConsumers,
Function<McpSchema.CreateMessageRequest, McpSchema.CreateMessageResult> samplingHandler,
@Deprecated Function<McpSchema.CreateMessageRequest, McpSchema.CreateMessageResult> samplingHandler,
Function<McpSchema.ElicitFormRequest, McpSchema.ElicitResult> formElicitationHandler,
Function<McpSchema.ElicitUrlRequest, McpSchema.ElicitResult> urlElicitationHandler,
boolean enableCallToolSchemaCaching, boolean applyElicitationDefaults) {
Expand All @@ -277,7 +282,10 @@ public record Sync(McpSchema.Implementation clientInfo, McpSchema.ClientCapabili
* @param applyElicitationDefaults whether the client should fill in missing
* fields of an accepted {@code ElicitResult.content} with the {@code default}
* values declared in the {@code requestedSchema}.
* @deprecated Roots, sampling, and logging are deprecated in the 2026-07-28 MCP
* specification.
*/
@Deprecated
public Sync(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities clientCapabilities,
Map<String, McpSchema.Root> roots, List<Consumer<List<McpSchema.Tool>>> toolsChangeConsumers,
List<Consumer<List<McpSchema.Resource>>> resourcesChangeConsumers,
Expand Down Expand Up @@ -318,6 +326,7 @@ public Sync(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities cl
/**
* @deprecated Only exists for backwards-compatibility purposes.
*/
@Deprecated
public Sync(McpSchema.Implementation clientInfo, McpSchema.ClientCapabilities clientCapabilities,
Map<String, McpSchema.Root> roots, List<Consumer<List<McpSchema.Tool>>> toolsChangeConsumers,
List<Consumer<List<McpSchema.Resource>>> resourcesChangeConsumers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,27 @@ public McpSchema.InitializeResult initialize() {

/**
* Send a roots/list_changed notification.
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public void rootsListChangedNotification() {
withProvidedContext(this.delegate.rootsListChangedNotification()).block();
}

/**
* Add a roots dynamically.
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public void addRoot(McpSchema.Root root) {
this.delegate.addRoot(root).block();
}

/**
* Remove a root dynamically.
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public void removeRoot(String rootUri) {
this.delegate.removeRoot(rootUri).block();
}
Expand Down Expand Up @@ -426,7 +432,9 @@ public GetPromptResult getPrompt(GetPromptRequest getPromptRequest) {
/**
* Client can set the minimum logging level it wants to receive from the server.
* @param loggingLevel the min logging level
* @deprecated Logging is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public void setLoggingLevel(McpSchema.LoggingLevel loggingLevel) {
withProvidedContext(this.delegate.setLoggingLevel(loggingLevel)).block();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ public Mono<McpSchema.ListRootsResult> listRoots(String cursor) {
* minimum logging level will be filtered out.
* @param loggingMessageNotification The logging message to send
* @return A Mono that completes when the notification has been sent
* @deprecated Logging is deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public Mono<Void> loggingNotification(LoggingMessageNotification loggingMessageNotification) {

if (loggingMessageNotification == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,9 @@ public AsyncSpecification<S> completions(McpServerFeatures.AsyncCompletionSpecif
* interact with the connected client. The second argument is the list of roots.
* @return This builder instance for method chaining
* @throws IllegalArgumentException if consumer is null
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public AsyncSpecification<S> rootsChangeHandler(
BiFunction<McpAsyncServerExchange, List<McpSchema.Root>, Mono<Void>> handler) {
Assert.notNull(handler, "Consumer must not be null");
Expand All @@ -761,7 +763,9 @@ public AsyncSpecification<S> rootsChangeHandler(
* @return This builder instance for method chaining
* @throws IllegalArgumentException if consumers is null
* @see #rootsChangeHandler(BiFunction)
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public AsyncSpecification<S> rootsChangeHandlers(
List<BiFunction<McpAsyncServerExchange, List<McpSchema.Root>, Mono<Void>>> handlers) {
Assert.notNull(handlers, "Handlers list must not be null");
Expand All @@ -777,7 +781,9 @@ public AsyncSpecification<S> rootsChangeHandlers(
* @return This builder instance for method chaining
* @throws IllegalArgumentException if consumers is null
* @see #rootsChangeHandlers(List)
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public AsyncSpecification<S> rootsChangeHandlers(
@SuppressWarnings("unchecked") BiFunction<McpAsyncServerExchange, List<McpSchema.Root>, Mono<Void>>... handlers) {
Assert.notNull(handlers, "Handlers list must not be null");
Expand Down Expand Up @@ -1347,7 +1353,9 @@ public SyncSpecification<S> completions(McpServerFeatures.SyncCompletionSpecific
* with the connected client. The second argument is the list of roots.
* @return This builder instance for method chaining
* @throws IllegalArgumentException if consumer is null
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public SyncSpecification<S> rootsChangeHandler(
BiConsumer<McpSyncServerExchange, List<McpSchema.Root>> handler) {
Assert.notNull(handler, "Consumer must not be null");
Expand All @@ -1363,7 +1371,9 @@ public SyncSpecification<S> rootsChangeHandler(
* @return This builder instance for method chaining
* @throws IllegalArgumentException if consumers is null
* @see #rootsChangeHandler(BiConsumer)
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public SyncSpecification<S> rootsChangeHandlers(
List<BiConsumer<McpSyncServerExchange, List<McpSchema.Root>>> handlers) {
Assert.notNull(handlers, "Handlers list must not be null");
Expand All @@ -1379,7 +1389,9 @@ public SyncSpecification<S> rootsChangeHandlers(
* @return This builder instance for method chaining
* @throws IllegalArgumentException if consumers is null
* @see #rootsChangeHandlers(List)
* @deprecated Roots are deprecated in the 2026-07-28 MCP specification.
*/
@Deprecated
public SyncSpecification<S> rootsChangeHandlers(
BiConsumer<McpSyncServerExchange, List<McpSchema.Root>>... handlers) {
Assert.notNull(handlers, "Handlers list must not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ record Async(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities s
Map<String, McpServerFeatures.AsyncResourceTemplateSpecification> resourceTemplates,
Map<String, McpServerFeatures.AsyncPromptSpecification> prompts,
Map<McpSchema.CompleteReference, McpServerFeatures.AsyncCompletionSpecification> completions,
List<BiFunction<McpAsyncServerExchange, List<McpSchema.Root>, Mono<Void>>> rootsChangeConsumers,
@Deprecated List<BiFunction<McpAsyncServerExchange, List<McpSchema.Root>, Mono<Void>>> rootsChangeConsumers,
String instructions) {

/**
Expand All @@ -58,7 +58,10 @@ record Async(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities s
* @param rootsChangeConsumers The list of consumers that will be notified when
* the roots list changes
* @param instructions The server instructions text
* @deprecated Roots and logging are deprecated in the 2026-07-28 MCP
* specification.
*/
@Deprecated
Async(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities serverCapabilities,
List<McpServerFeatures.AsyncToolSpecification> tools, Map<String, AsyncResourceSpecification> resources,
Map<String, McpServerFeatures.AsyncResourceTemplateSpecification> resourceTemplates,
Expand Down Expand Up @@ -161,7 +164,8 @@ record Sync(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities se
Map<String, McpServerFeatures.SyncResourceTemplateSpecification> resourceTemplates,
Map<String, McpServerFeatures.SyncPromptSpecification> prompts,
Map<McpSchema.CompleteReference, McpServerFeatures.SyncCompletionSpecification> completions,
List<BiConsumer<McpSyncServerExchange, List<McpSchema.Root>>> rootsChangeConsumers, String instructions) {
@Deprecated List<BiConsumer<McpSyncServerExchange, List<McpSchema.Root>>> rootsChangeConsumers,
String instructions) {

/**
* Create an instance and validate the arguments.
Expand All @@ -174,7 +178,10 @@ record Sync(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities se
* @param rootsChangeConsumers The list of consumers that will be notified when
* the roots list changes
* @param instructions The server instructions text
* @deprecated Roots and logging are deprecated in the 2026-07-28 MCP
* specification.
*/
@Deprecated
Sync(McpSchema.Implementation serverInfo, McpSchema.ServerCapabilities serverCapabilities,
List<McpServerFeatures.SyncToolSpecification> tools,
Map<String, McpServerFeatures.SyncResourceSpecification> resources,
Expand Down
Loading