Skip to content

Commit 59e7ef8

Browse files
tzolovWillam2004
authored andcommitted
minor MCP ref docs improvements
Signed-off-by: Christian Tzolov <[email protected]> Signed-off-by: 家娃 <[email protected]>
1 parent ab0771a commit 59e7ef8

File tree

3 files changed

+29
-63
lines changed

3 files changed

+29
-63
lines changed

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,6 @@ public void handleLoggingWithParams(LoggingLevel level, String logger, String da
3737
}
3838
----
3939

40-
==== Client-Specific Handlers
41-
42-
[source,java]
43-
----
44-
@McpLogging(clients = "server1")
45-
public void handleServer1Logs(LoggingMessageNotification notification) {
46-
// Handle logs from specific server
47-
logToFile("server1.log", notification);
48-
}
49-
50-
@McpLogging(clients = "server2")
51-
public void handleServer2Logs(LoggingMessageNotification notification) {
52-
// Handle logs from another server
53-
logToDatabase("server2", notification);
54-
}
55-
----
56-
5740
=== @McpSampling
5841

5942
The `@McpSampling` annotation handles sampling requests from MCP servers for LLM completions.
@@ -101,23 +84,6 @@ public class AsyncSamplingHandler {
10184
}
10285
----
10386

104-
==== Client-Specific Sampling
105-
106-
[source,java]
107-
----
108-
@McpSampling(clients = "specialized-server")
109-
public CreateMessageResult handleSpecializedSampling(CreateMessageRequest request) {
110-
// Use specialized model for this server
111-
String response = generateSpecializedResponse(request);
112-
113-
return CreateMessageResult.builder()
114-
.role(Role.ASSISTANT)
115-
.content(new TextContent(response))
116-
.model("specialized-model")
117-
.build();
118-
}
119-
----
120-
12187
=== @McpElicitation
12288

12389
The `@McpElicitation` annotation handles elicitation requests to gather additional information from users.

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

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ The MCP Client Boot Starter provides:
2424
</dependency>
2525
----
2626

27-
The standard starter connects simultaneously to one or more MCP servers over `STDIO` (in-process), `SSE` and `Streamable Http` transports.
27+
The standard starter connects simultaneously to one or more MCP servers over `STDIO` (in-process), `SSE`, `Streamable Http` and `Stateless Streamable Http` transports.
2828
The SSE and Streamable-Http transports use the JDK HttpClient-based transport implementation.
2929
Each connection to an MCP server creates a new MCP client instance.
3030
You can choose either `SYNC` or `ASYNC` MCP clients (note: you cannot mix sync and async clients).
3131
For production deployment, we recommend using the WebFlux-based SSE & StreamableHttp connection with the `spring-ai-starter-mcp-client-webflux`.
3232

3333
=== WebFlux Client
3434

35-
The WebFlux starter provides similar functionality to the standard starter but uses a WebFlux-based SSE and Streamable-Http transport implementation.
35+
The WebFlux starter provides similar functionality to the standard starter but uses a WebFlux-based Streamable-Http, Stateless Streamable-Http and SSE transport implementation.
3636

3737
[source,xml]
3838
----
@@ -179,27 +179,27 @@ The Claude Desktop format looks like this:
179179
}
180180
----
181181

182-
Currently, the Claude Desktop format supports only STDIO connection types.
182+
=== Streamable Http Transport Properties
183183

184-
=== SSE Transport Properties
184+
Used for connecting to Streamable-HTTP and Stateless Streamable-HTTP MCP servers.
185185

186-
Properties for Server-Sent Events (SSE) transport are prefixed with `spring.ai.mcp.client.sse`:
186+
Properties for Streamable Http transport are prefixed with `spring.ai.mcp.client.streamable-http`:
187187

188188
[cols="3,4,3"]
189189
|===
190190
|Property |Description | Default Value
191191

192192
|`connections`
193-
|Map of named SSE connection configurations
193+
|Map of named Streamable Http connection configurations
194194
|-
195195

196196
|`connections.[name].url`
197-
|Base URL endpoint for SSE communication with the MCP server
197+
|Base URL endpoint for Streamable-Http communication with the MCP server
198198
|-
199199

200-
|`connections.[name].sse-endpoint`
201-
|the sse endpoint (as url suffix) to use for the connection
202-
|`/sse`
200+
|`connections.[name].endpoint`
201+
|the streamable-http endpoint (as url suffix) to use for the connection
202+
|`/mcp`
203203
|===
204204

205205
Example configuration:
@@ -209,34 +209,34 @@ spring:
209209
ai:
210210
mcp:
211211
client:
212-
sse:
212+
streamable-http:
213213
connections:
214214
server1:
215215
url: http://localhost:8080
216216
server2:
217217
url: http://otherserver:8081
218-
sse-endpoint: /custom-sse
218+
endpoint: /custom-sse
219219
----
220220

221-
=== Streamable Http Transport Properties
221+
=== SSE Transport Properties
222222

223-
Properties for Streamable Http transport are prefixed with `spring.ai.mcp.client.streamable-http`:
223+
Properties for Server-Sent Events (SSE) transport are prefixed with `spring.ai.mcp.client.sse`:
224224

225225
[cols="3,4,3"]
226226
|===
227227
|Property |Description | Default Value
228228

229229
|`connections`
230-
|Map of named Streamable Http connection configurations
230+
|Map of named SSE connection configurations
231231
|-
232232

233233
|`connections.[name].url`
234-
|Base URL endpoint for Streamable-Http communication with the MCP server
234+
|Base URL endpoint for SSE communication with the MCP server
235235
|-
236236

237-
|`connections.[name].endpoint`
238-
|the streamable-http endpoint (as url suffix) to use for the connection
239-
|`/mcp`
237+
|`connections.[name].sse-endpoint`
238+
|the sse endpoint (as url suffix) to use for the connection
239+
|`/sse`
240240
|===
241241

242242
Example configuration:
@@ -246,13 +246,13 @@ spring:
246246
ai:
247247
mcp:
248248
client:
249-
streamable-http:
249+
sse:
250250
connections:
251251
server1:
252252
url: http://localhost:8080
253253
server2:
254254
url: http://otherserver:8081
255-
endpoint: /custom-sse
255+
sse-endpoint: /custom-sse
256256
----
257257

258258

@@ -284,10 +284,13 @@ Servers can request the list of roots from supporting clients and receive notifi
284284
- Resources change notifications - when the list of available server resources changes.
285285
- Prompts change notifications - when the list of available server prompts changes.
286286
- link:https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/logging[*Logging Handlers*] - standardized way for servers to send structured log messages to clients.
287-
287+
- link:https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/progress[*Progress Handlers*] - standardized way for servers to send structured progress messages to clients.
288+
288289
Clients can control logging verbosity by setting minimum log levels
289290

290291

292+
==== Client Customization Example
293+
291294
You can implement either `McpSyncClientCustomizer` for synchronous clients or `McpAsyncClientCustomizer` for asynchronous clients, depending on your application's needs.
292295

293296
[tabs]

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Bootstrap your AI applications with MCP support using link:https://start.spring.
1010

1111
== MCP Java SDK Architecture
1212

13-
TIP: This section provides an overview for the link:https://modelcontextprotocol.io/sdk/java[MCP Java SDK architecture].
13+
TIP: This section provides an overview for the link:https://modelcontextprotocol.io/sdk/java/mcp-overview[MCP Java SDK architecture].
1414
For the Spring AI MCP integration, refer to the xref:#_spring_ai_mcp_integration[Spring AI MCP Boot Starters] documentation.
1515

1616
The Java MCP implementation follows a three-layer architecture:
@@ -60,10 +60,7 @@ a| The MCP Server is a foundational component in the Model Context Protocol (MCP
6060
* Concurrent client connection management
6161
* Synchronous and Asynchronous API support
6262
* Transport implementations:
63-
** Stdio-based transport for process-based communication
64-
** Servlet-based SSE and Streamable-HTTP server transports
65-
** WebFlux SSE and Streamable-HTTP server transports for reactive HTTP streaming
66-
** WebMVC SSE and Streamable-HTTP server transports for servlet-based HTTP streaming
63+
** Stdio, Streamable-HTTP, Stateless Streamable-HTTP, SSE
6764

6865
^a| image::mcp/java-mcp-server-architecture.jpg[Java MCP Server Architecture, width=600]
6966
|===
@@ -77,8 +74,8 @@ Spring AI provides MCP integration through the following Spring Boot starters:
7774

7875
=== link:mcp-client-boot-starter-docs.html[Client Starters]
7976

80-
* `spring-ai-starter-mcp-client` - Core starter providing `STDIO` and HTTP-based `SSE` and `Streamable-HTTP` support
81-
* `spring-ai-starter-mcp-client-webflux` - WebFlux-based `SSE` and `Streamable-HTTP` transport implementation
77+
* `spring-ai-starter-mcp-client` - Core starter providing `STDIO`, Servlet-based `Streamable-HTTP`, `Stateless Streamable-HTTP` and `SSE` support
78+
* `spring-ai-starter-mcp-client-webflux` - WebFlux-based `Streamable-HTTP`, `Stateless Streamable-HTTP` and `SSE` transport implementation
8279

8380
=== link:mcp-server-boot-starter-docs.html[Server Starters]
8481

0 commit comments

Comments
 (0)