Skip to content

Commit e776129

Browse files
committed
Minor MCP ref docs updates
Signed-off-by: Christian Tzolov <[email protected]>
1 parent 356fced commit e776129

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ public class McpClientApplication {
214214
public static void main(String[] args) {
215215
SpringApplication.run(McpClientApplication.class, args);
216216
}
217+
218+
217219
}
218220
219221
@Component
@@ -223,7 +225,7 @@ public class ClientHandlers {
223225
private final ProgressTracker progressTracker = new ProgressTracker();
224226
private final ChatModel chatModel;
225227
226-
public ClientHandlers(ChatModel chatModel) {
228+
public ClientHandlers(@Lazy ChatModel chatModel) {
227229
this.chatModel = chatModel;
228230
}
229231
@@ -661,7 +663,7 @@ public class McpClientHandlers {
661663

662664
=== Client Application Setup
663665

664-
The client application configures multiple ChatClient instances for different LLM providers:
666+
Regisster the MCP tools and handlers in the client application:
665667

666668
[source,java]
667669
----
@@ -674,10 +676,9 @@ public class McpClientApplication {
674676
675677
@Bean
676678
public CommandLineRunner predefinedQuestions(OpenAiChatModel openAiChatModel,
677-
List<McpSyncClient> mcpClients) {
679+
ToolCallbackProvider mcpToolProvider) {
678680
679-
return args -> {
680-
var mcpToolProvider = new SyncMcpToolCallbackProvider(mcpClients);
681+
return args -> {
681682
682683
ChatClient chatClient = ChatClient.builder(openAiChatModel)
683684
.defaultToolCallbacks(mcpToolProvider)
@@ -693,14 +694,6 @@ public class McpClientApplication {
693694
System.out.println("> ASSISTANT: " + chatClient.prompt(userQuestion).call().content());
694695
};
695696
}
696-
697-
@Bean
698-
public Map<String, ChatClient> chatClients(List<ChatModel> chatModels) {
699-
return chatModels.stream()
700-
.collect(Collectors.toMap(
701-
model -> model.getClass().getSimpleName().toLowerCase(),
702-
model -> ChatClient.builder(model).build()));
703-
}
704697
}
705698
----
706699

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,14 @@ spring:
264264

265265
The starter supports two types of clients:
266266

267-
* Synchronous - default client type, suitable for traditional request-response patterns with blocking operations
267+
* Synchronous - default client type (`spring.ai.mcp.client.type=SYNC`), suitable for traditional request-response patterns with blocking operations
268+
269+
**NOTE:** The SYNC client will register only synchronous MCP annotated methods. Asynchronous methods will be ignored.
270+
268271
* Asynchronous - suitable for reactive applications with non-blocking operations, configured using `spring.ai.mcp.client.type=ASYNC`
269272

273+
**NOTE:** The ASYNC client will register only asynchronous MCP annotated methods. Synchronous methods will be ignored.
274+
270275
=== Client Customization
271276

272277
The auto-configuration provides extensive client spec customization capabilities through callback interfaces. These customizers allow you to configure various aspects of the MCP client behavior, from request timeouts to event handling and message processing.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ It supports multiple transport mechanisms to provide flexibility across differen
55

66
The link:https://modelcontextprotocol.io/sdk/java/mcp-overview[MCP Java SDK] provides a Java implementation of the Model Context Protocol, enabling standardized interaction with AI models and tools through both synchronous and asynchronous communication patterns.
77

8-
`**Spring AI MCP**` extends the MCP Java SDK with Spring Boot integration, providing both xref:api/mcp/mcp-client-boot-starter-docs.adoc[client] and xref:api/mcp/mcp-server-boot-starter-docs.adoc[server] starters.
8+
Spring AI extends the MCP Java SDK with Spring Boot integration, providing both xref:api/mcp/mcp-client-boot-starter-docs.adoc[Client] and xref:api/mcp/mcp-server-boot-starter-docs.adoc[Server] starters and xref:api/mcp/mcp-annotations-overview.adoc[MCP Annotations] for simplified development.
99
Bootstrap your AI applications with MCP support using link:https://start.spring.io[Spring Initializer].
1010

1111
== MCP Java SDK Architecture
@@ -93,15 +93,15 @@ Spring AI provides MCP integration through the following Spring Boot starters:
9393
|Server Type | Dependency | Property
9494
| xref:api/mcp/mcp-stdio-sse-server-boot-starter-docs.adoc#_sse_webmvc_serve[SSE WebMVC] | `spring-ai-starter-mcp-server-webmvc` | `spring.ai.mcp.server.protocol=SSE` or empty
9595
| xref:api/mcp/mcp-streamable-http-server-boot-starter-docs.adoc#_streamable_http_webmvc_server[Streamable-HTTP WebMVC] | `spring-ai-starter-mcp-server-webmvc` | `spring.ai.mcp.server.protocol=STREAMABLE`
96-
| xref:api/mcp/mcp-stateless-server-boot-starter-docs.adoc#_stateless_webmvc_server[Stateless WebMVC] | `spring-ai-starter-mcp-server-webmvc` | `spring.ai.mcp.server.protocol=STATELESS`
96+
| xref:api/mcp/mcp-stateless-server-boot-starter-docs.adoc#_stateless_webmvc_server[Stateless Streamable-HTTP WebMVC] | `spring-ai-starter-mcp-server-webmvc` | `spring.ai.mcp.server.protocol=STATELESS`
9797
|===
9898

9999
==== WebMVC (Reactive)
100100
|===
101101
|Server Type | Dependency | Property
102102
| xref:api/mcp/mcp-stdio-sse-server-boot-starter-docs.adoc#_sse_webflux_serve[SSE WebFlux] | `spring-ai-starter-mcp-server-webflux` | `spring.ai.mcp.server.protocol=SSE` or empty
103103
| xref:api/mcp/mcp-streamable-http-server-boot-starter-docs.adoc#_streamable_http_webflux_server[Streamable-HTTP WebFlux] | `spring-ai-starter-mcp-server-webflux` | `spring.ai.mcp.server.protocol=STREAMABLE`
104-
| xref:api/mcp/mcp-stateless-server-boot-starter-docs.adoc#_stateless_webflux_server[Stateless WebFlux] | `spring-ai-starter-mcp-server-webflux` | `spring.ai.mcp.server.protocol=STATELESS`
104+
| xref:api/mcp/mcp-stateless-server-boot-starter-docs.adoc#_stateless_webflux_server[Stateless Streamable-HTTP WebFlux] | `spring-ai-starter-mcp-server-webflux` | `spring.ai.mcp.server.protocol=STATELESS`
105105
|===
106106

107107
== xref:api/mcp/mcp-annotations-overview.adoc[Spring AI MCP Annotations]

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,16 @@ It is designed for straightforward request-response patterns in your application
7979
To enable this server type, set `spring.ai.mcp.server.type=SYNC` in your configuration.
8080
When activated, it automatically handles the configuration of synchronous tool specifications.
8181

82+
**NOTE:** The SYNC server will register only synchronous MCP annotated methods. Asynchronous methods will be ignored.
83+
8284
* **Asynchronous Server** - The asynchronous server implementation uses `McpAsyncServer` and is optimized for non-blocking operations.
8385
To enable this server type, configure your application with `spring.ai.mcp.server.type=ASYNC`.
8486
This server type automatically sets up asynchronous tool specifications with built-in Project Reactor support.
8587

88+
**NOTE:** The ASYNC server will register only asynchronous MCP annotated methods. Synchronous methods will be ignored.
89+
90+
91+
8692
== MCP Server Annotations
8793

8894
The MCP Server Boot Starters provide comprehensive support for annotation-based server development, allowing you to create MCP servers using declarative Java annotations instead of manual configuration.

0 commit comments

Comments
 (0)