Conversation
|
I found some time to dig deeper into it and pushed changes which fix the behaviour for the Webflux and WebMvc transport providers. One of the main issues is that the sse connection returns the message endpoint to the client. This endpoints needs to be the full path with the context under which the server is running. Unfortunately this can't be part of the However, I tested running a server with Spring-AI with configurations like: spring.ai.mcp.server:
type: ASYNC
base-url: /mcp
sse-endpoint: /connect
spring:
webflux:
base-path: /v1/apiand instead of servlet:
context-path: /v1/apiWith this solution I can connect succesfully to such routes after applying small changes in the Spring - AI code. A big clean up of the code is still needed, though. Edit: Cleanup done and PR marked as ready for review. |
Motivation and Context
Currently, the URL resolving is broken under different circumstances when adding a base URL to the path.
There are quite a few issues regarding this in this repo, but also in the Spring AI repos. Example: #261
Basically, the main issue is that the
resolveUrimethod works for the message endpoint, but not for the SSE endpoint. So an URL resolver for the SSE endpoint is added.How Has This Been Tested?
See
WebMvcSseCustomPathIntegrationTestsTypes of changes
Checklist
Open questions
This PR is currently WIP, because for now it is a little bit unclear for how to handle the context path.
I guess this is not the same as the
baseUrl, but the main path of the servlet to reach? As an example, for SSE we would get:If this is correct, then some additional changes need to be made to support this.