Skip to content

fix: update default sse-message-endpoint from /mcp/message to /mcp/messages #3779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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 @@ -36,6 +36,7 @@
* All properties are prefixed with {@code spring.ai.mcp.server}.
*
* @author Christian Tzolov
* @author Jemin Huh
* @since 1.0.0
* @see McpServerAutoConfiguration
*/
Expand Down Expand Up @@ -120,7 +121,7 @@ public class McpServerProperties {
* <p>
* This property is only used when transport is set to WEBMVC or WEBFLUX.
*/
private String sseMessageEndpoint = "/mcp/message";
private String sseMessageEndpoint = "/mcp/messages";

/**
* The type of server to use for MCP server communication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void defaultConfiguration() {
assertThat(properties.getRequestTimeout().getSeconds()).isEqualTo(20);
assertThat(properties.getBaseUrl()).isEqualTo("");
assertThat(properties.getSseEndpoint()).isEqualTo("/sse");
assertThat(properties.getSseMessageEndpoint()).isEqualTo("/mcp/message");
assertThat(properties.getSseMessageEndpoint()).isEqualTo("/mcp/messages");

// Check capabilities
assertThat(properties.getCapabilities().isTool()).isTrue();
Expand Down Expand Up @@ -300,12 +300,12 @@ void endpointConfiguration() {
this.contextRunner
.withPropertyValues("spring.ai.mcp.server.base-url=http://localhost:8080",
"spring.ai.mcp.server.sse-endpoint=/events",
"spring.ai.mcp.server.sse-message-endpoint=/api/mcp/message")
"spring.ai.mcp.server.sse-message-endpoint=/api/mcp/messages")
.run(context -> {
McpServerProperties properties = context.getBean(McpServerProperties.class);
assertThat(properties.getBaseUrl()).isEqualTo("http://localhost:8080");
assertThat(properties.getSseEndpoint()).isEqualTo("/events");
assertThat(properties.getSseMessageEndpoint()).isEqualTo("/api/mcp/message");
assertThat(properties.getSseMessageEndpoint()).isEqualTo("/api/mcp/messages");

// Verify the server is configured with the endpoints
McpSyncServer server = context.getBean(McpSyncServer.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ All properties are prefixed with `spring.ai.mcp.server`:
|`prompt-change-notification` |Enable prompt change notifications |`true`
|`tool-change-notification` |Enable tool change notifications |`true`
|`tool-response-mime-type` |(optional) response MIME type per tool name. For example `spring.ai.mcp.server.tool-response-mime-type.generateImage=image/png` will associate the `image/png` mime type with the `generateImage()` tool name |`-`
|`sse-message-endpoint` | Custom SSE Message endpoint path for web transport to be used by the client to send messages|`/mcp/message`
|`sse-message-endpoint` | Custom SSE Message endpoint path for web transport to be used by the client to send messages|`/mcp/messages`
|`sse-endpoint` |Custom SSE endpoint path for web transport |`/sse`
|`base-url` | Optional URL prefix. For example `base-url=/api/v1` means that the client should access the sse endpoint at `/api/v1` + `sse-endpoint` and the message endpoint is `/api/v1` + `sse-message-endpoint` | -
|`request-timeout` | Duration to wait for server responses before timing out requests. Applies to all requests made through the client, including tool calls, resource access, and prompt operations. | `20` seconds
Expand Down
6 changes: 3 additions & 3 deletions spring-ai-docs/src/main/asciidoc/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The MCP server can be configured using the following properties under the `sprin
| `tool-change-notification` | `true` | Enable/disable tool change notifications |
| `prompt-change-notification` | `true` | Enable/disable prompt change notifications |
| `transport` | `STDIO` | Transport type (`STDIO`, `WEBMVC`, or `WEBFLUX`) |
| `sse-message-endpoint` | `"/mcp/message"` | Server-Sent Events (SSE) message endpoint for web transports |
| `sse-message-endpoint` | `"/mcp/messages"` | Server-Sent Events (SSE) message endpoint for web transports |

## Server Types

Expand Down Expand Up @@ -84,7 +84,7 @@ spring:
mcp:
server:
transport: WEBMVC
sse-message-endpoint: /mcp/message # Optional, defaults to /mcp/message
sse-message-endpoint: /mcp/messages # Optional, defaults to /mcp/messages
```

Required dependencies:
Expand All @@ -109,7 +109,7 @@ spring:
mcp:
server:
transport: WEBFLUX
sse-message-endpoint: /mcp/message # Optional, defaults to /mcp/message
sse-message-endpoint: /mcp/messages # Optional, defaults to /mcp/messages
```

Required dependencies:
Expand Down