Title: feat: Support separate registration and published paths in WebMvcSseS… by minguncle · Pull Request #80 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: feat: Support separate registration and published paths in WebMvcSseS… by minguncle · Pull Request #80 · modelcontextprotocol/java-sdk
X Title: feat: Support separate registration and published paths in WebMvcSseS… by minguncle · Pull Request #80 · modelcontextprotocol/java-sdk
Description: Resolves #79 Support separate registration and published paths in WebMvcSseServerTransportProvider Adds a new constructor to WebMvcSseServerTransportProvider that accepts separate parameters for server registration paths and client-facing published paths. This enhancement allows the provider to work correctly in environments with servlet context paths or global URL prefixes (like Spring Boot's spring.mvc.servlet.path) by: Using messageEndpoint for server-side router registration Using publishedMessageEndpoint when communicating with clients The implementation maintains backward compatibility with existing code while addressing the needs of deployments behind proxies or with context paths. Motivation and Context When using WebMvcSseServerTransportProvider in environments with servlet context paths or global URL prefixes, there's a mismatch between the path where handlers are registered with Spring's RouterFunction and the full path that needs to be communicated to clients. This enhancement solves that problem by allowing these paths to be configured separately. For example, in Spring Boot applications with spring.mvc.servlet.path=/api/v1, the server needs to register handlers at bare paths like /message, but clients need to use the full path /api/v1/message. How Has This Been Tested? Tested in a Spring Boot application with servlet context paths configured. Verified both the registration of handlers at the correct paths and the communication of full paths to clients through the SSE connection. Breaking Changes No breaking changes. Existing code using the current constructors will continue to work as before. Types of changes New feature (non-breaking change which adds functionality) Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context This implementation adds a new field publishedMessageEndpoint and modifies the handleSseConnection method to use this published endpoint when communicating with clients. All existing constructors are preserved, maintaining backward compatibility.
Open Graph Description: Resolves #79 Support separate registration and published paths in WebMvcSseServerTransportProvider Adds a new constructor to WebMvcSseServerTransportProvider that accepts separate parameters for se...
X Description: Resolves #79 Support separate registration and published paths in WebMvcSseServerTransportProvider Adds a new constructor to WebMvcSseServerTransportProvider that accepts separate parameters for se...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/pull/80
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cb92a4f7-245a-4ca8-87cd-477ee572c435 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A106:2E1F49:190F02D:2070EA2:6A5C6433 |
| html-safe-nonce | 40c5586444d23173a7097830dd40e4aed5acd67397263fb2faac0998593edd00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTA2OjJFMUY0OToxOTBGMDJEOjIwNzBFQTI6NkE1QzY0MzMiLCJ2aXNpdG9yX2lkIjoiNzc4MjE1MzcyNzYyMTQ4OTcxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 563e93f20ceb55f26c01b803be563446f1f3f8c41418b15a900b6f181f648aa4 |
| hovercard-subject-tag | pull_request:2421582803 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/java-sdk/pull/80/files |
| twitter:image | https://avatars.githubusercontent.com/u/57527858?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/57527858?s=400&v=4 |
| og:image:alt | Resolves #79 Support separate registration and published paths in WebMvcSseServerTransportProvider Adds a new constructor to WebMvcSseServerTransportProvider that accepts separate parameters for se... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width