Skip to content

Commit b79fa38

Browse files
author
lambochen
committed
mcp server support baseUrl
1 parent 261554b commit b79fa38

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mcp-spring/mcp-spring-webflux/src/main/java/io/modelcontextprotocol/server/transport/WebFluxSseServerTransportProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ public WebFluxSseServerTransportProvider(ObjectMapper objectMapper, String baseU
159159
this.messageEndpoint = messageEndpoint;
160160
this.sseEndpoint = sseEndpoint;
161161
this.routerFunction = RouterFunctions.route()
162-
.GET(this.sseEndpoint, this::handleSseConnection)
163-
.POST(this.messageEndpoint, this::handleMessage)
162+
.GET(this.baseUrl + this.sseEndpoint, this::handleSseConnection)
163+
.POST(this.baseUrl + this.messageEndpoint, this::handleMessage)
164164
.build();
165165
}
166166

mcp-spring/mcp-spring-webmvc/src/main/java/io/modelcontextprotocol/server/transport/WebMvcSseServerTransportProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ public WebMvcSseServerTransportProvider(ObjectMapper objectMapper, String baseUr
159159
this.messageEndpoint = messageEndpoint;
160160
this.sseEndpoint = sseEndpoint;
161161
this.routerFunction = RouterFunctions.route()
162-
.GET(this.sseEndpoint, this::handleSseConnection)
163-
.POST(this.messageEndpoint, this::handleMessage)
162+
.GET(this.baseUrl + this.sseEndpoint, this::handleSseConnection)
163+
.POST(this.baseUrl + this.messageEndpoint, this::handleMessage)
164164
.build();
165165
}
166166

0 commit comments

Comments
 (0)