Skip to content

Commit 5a001b8

Browse files
committed
make the spring.ai.mcp.client.toolcallback.enabled true by default
Signed-off-by: Christian Tzolov <[email protected]>
1 parent 5320640 commit 5a001b8

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

auto-configurations/spring-ai-mcp-client/src/main/java/org/springframework/ai/autoconfigure/mcp/client/McpToolCallbackAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static class McpAutoConfigEnabled {
5353
}
5454

5555
@ConditionalOnProperty(prefix = McpClientCommonProperties.CONFIG_PREFIX + ".toolcallback", name = "enabled",
56-
havingValue = "true", matchIfMissing = false)
56+
havingValue = "true", matchIfMissing = true)
5757
static class ToolCallbackProviderEnabled {
5858

5959
}

auto-configurations/spring-ai-mcp-client/src/test/java/org/springframework/ai/autoconfigure/mcp/client/McpToolCallbackAutoConfigurationTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ public class McpToolCallbackAutoConfigurationTests {
2929
.withConfiguration(AutoConfigurations.of(McpToolCallbackAutoConfiguration.class));
3030

3131
@Test
32-
void disabledByDeafault() {
32+
void byDeafault() {
3333

3434
this.applicationContext.run((context) -> {
35-
assertThat(context).doesNotHaveBean("mcpToolCallbacks");
35+
assertThat(context).hasBean("mcpToolCallbacks");
3636
assertThat(context).doesNotHaveBean("mcpAsyncToolCallbacks");
3737
});
3838

3939
this.applicationContext
4040
.withPropertyValues("spring.ai.mcp.client.enabled=true", "spring.ai.mcp.client.type=SYNC")
4141
.run((context) -> {
42-
assertThat(context).doesNotHaveBean("mcpToolCallbacks");
42+
assertThat(context).hasBean("mcpToolCallbacks");
4343
assertThat(context).doesNotHaveBean("mcpAsyncToolCallbacks");
4444
});
4545

4646
this.applicationContext
4747
.withPropertyValues("spring.ai.mcp.client.enabled=true", "spring.ai.mcp.client.type=ASYNC")
4848
.run((context) -> {
4949
assertThat(context).doesNotHaveBean("mcpToolCallbacks");
50-
assertThat(context).doesNotHaveBean("mcpAsyncToolCallbacks");
50+
assertThat(context).hasBean("mcpAsyncToolCallbacks");
5151
});
5252
}
5353

auto-configurations/spring-ai-mcp-client/src/test/java/org/springframework/ai/autoconfigure/mcp/client/McpToolCallbackAutoconfiguraitonConditionTests.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,17 @@ void doesNotMatchWhenBothPropertiesAreDisabled() {
7272

7373
@Test
7474
void doesNotMatchWhenToolCallbackPropertyIsMissing() {
75-
// McpClientEnabled is true by default if missing, but ToolCallbackEnabled is
76-
// false by default if missing
75+
// McpClientEnabled and ToolCallbackEnabled are true by default if missing
7776
this.contextRunner.withPropertyValues("spring.ai.mcp.client.enabled=true").run(context -> {
78-
assertThat(context).doesNotHaveBean("testBean");
77+
assertThat(context).hasBean("testBean");
7978
});
8079
}
8180

8281
@Test
8382
void doesNotMatchWhenBothPropertiesAreMissing() {
84-
// McpClientEnabled is true by default if missing, but ToolCallbackEnabled is
85-
// false by default if missing
83+
// McpClientEnabled and ToolCallbackEnabled are true by default if missing
8684
this.contextRunner.run(context -> {
87-
assertThat(context).doesNotHaveBean("testBean");
85+
assertThat(context).hasBean("testBean");
8886
});
8987
}
9088

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/mcp/mcp-client-boot-starter-docs.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ The Spring AI MCP (Model Context Protocol) Client Boot Starter provides auto-con
55
The MCP Client Boot Starter provides:
66

77
* Management of multiple client instances
8-
* Automatic client initialization (if enabled)
8+
* Automatic client initialization (if enabled, `spring.ai.mcp.client.initialized=true`)
99
* Support for multiple named transports
10-
* Integration with Spring AI's tool execution framework
10+
* Integration with Spring AI's tool execution framework (if enabled `spring.ai.mcp.client.toolcallback.enabled=true`)
1111
* Proper lifecycle management with automatic cleanup of resources when the application context is closed
1212
* Customizable client creation through customizers
1313
@@ -81,7 +81,7 @@ The common properties are prefixed with `spring.ai.mcp.client`:
8181

8282
|`toolcallback.enabled`
8383
|Enable/disable the MCP tool callback integration with Spring AI's tool execution framework
84-
|`false`
84+
|`true`
8585
|===
8686

8787
=== Stdio Transport Properties

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/mcp/mcp-overview.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ a| The MCP Client is a key component in the Model Context Protocol (MCP) archite
3838
* Protocol version negotiation to ensure compatibility with servers
3939
* Capability negotiation to determine available features
4040
* Message transport and JSON-RPC communication
41-
* Tool discovery and execution
41+
* Tool discovery and execution (if enabled)
4242
* Resource access and management
4343
* Prompt system interactions
4444
* Optional features:
@@ -59,7 +59,7 @@ a| The MCP Client is a key component in the Model Context Protocol (MCP) archite
5959
a| The MCP Server is a foundational component in the Model Context Protocol (MCP) architecture that provides tools, resources, and capabilities to clients. It implements the server-side of the protocol, responsible for:
6060

6161
* Server-side protocol operations implementation
62-
** Tool exposure and discovery
62+
** Tool exposure and discovery (if enabled)
6363
** Resource management with URI-based access
6464
** Prompt template provision and handling
6565
** Capability negotiation with clients

0 commit comments

Comments
 (0)