René's URL Explorer Experiment


Title: feat: Support separate endpoint path router in WebFluxStreamableServerTransportProvider · Issue #621 · modelcontextprotocol/java-sdk · GitHub

Open Graph Title: feat: Support separate endpoint path router in WebFluxStreamableServerTransportProvider · Issue #621 · modelcontextprotocol/java-sdk

X Title: feat: Support separate endpoint path router in WebFluxStreamableServerTransportProvider · Issue #621 · modelcontextprotocol/java-sdk

Description: Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested. #79 #80 #425 #432 Expected Behavior The user can customize the endpoint routing functions. We hope to wrap HTTP-APIs...

Open Graph Description: Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested. #79 #80 #425 #432 Expected Behavior The user can customize the endpoint rout...

X Description: Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested. #79 #80 #425 #432 Expected Behavior The user can customize the endpoint rout...

Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/621

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: Support separate endpoint path router in WebFluxStreamableServerTransportProvider","articleBody":"Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.\n#79  \n#80  \n#425  \n#432  \n\n**Expected Behavior**\n\nThe user can customize the endpoint routing functions.\nWe hope to wrap HTTP-APIs to MCP-Server-Tools.\n\n- Uses Spring WebFlux's RouterFunction for endpoint handling (GET, POST, DELETE)\n\nWe hope to support the follow MCP-Servers in one application process:\n- `/mcp`\n- `/mcp/mcp-server-app-name-A` -\u003e some MCP-Tools\n- `/mcp/mcp-server-app-name-B` -\u003e some MCP-Tools\n- `/mcp/mcp-server-app-name-C` -\u003e some MCP-Tools\n\n\u003c!--- Tell us how it should work. Add a code example to explain what you think the feature should look like. This is optional, but it would help up understand your expectations. --\u003e\n\n**Current Behavior**\n\nThe `RouterFunction` is private initialization in `WebFluxStreamableServerTransportProvider`, and its constructor is private.\n\n```java\npublic class WebFluxStreamableServerTransportProvider implements McpStreamableServerTransportProvider {\n\n\tprivate final String mcpEndpoint;\n\n\tprivate final RouterFunction\u003c?\u003e routerFunction;\n\n\tprivate WebFluxStreamableServerTransportProvider(ObjectMapper objectMapper, String mcpEndpoint,\n\t\t\tMcpTransportContextExtractor\u003cServerRequest\u003e contextExtractor, boolean disallowDelete,\n\t\t\tDuration keepAliveInterval) {\n\t\t\n\t\tthis.mcpEndpoint = mcpEndpoint;\n\t\t\n\t\tthis.routerFunction = RouterFunctions.route()\n\t\t\t.GET(this.mcpEndpoint, this::handleGet)\n\t\t\t.POST(this.mcpEndpoint, this::handlePost)\n\t\t\t.DELETE(this.mcpEndpoint, this::handleDelete)\n\t\t\t.build();\n\t}\n\n\tpublic RouterFunction\u003c?\u003e getRouterFunction() {\n\t\treturn this.routerFunction;\n\t}\n\n}\n```\n\n```java\npublic abstract class RouterFunctions {\n\n\tpublic static Builder route() {\n\t\treturn new RouterFunctionBuilder();\n\t}\n\n}\n```\n\n```java\nclass RouterFunctionBuilder implements RouterFunctions.Builder {\n\n\tprivate final List\u003cRouterFunction\u003cServerResponse\u003e\u003e routerFunctions = new ArrayList\u003c\u003e();\n\n\n\t@Override\n\tpublic RouterFunctions.Builder add(RouterFunction\u003cServerResponse\u003e routerFunction) {\n\t\tAssert.notNull(routerFunction, \"RouterFunction must not be null\");\n\t\tthis.routerFunctions.add(routerFunction);\n\t\treturn this;\n\t}\n\n\t@Override\n\tpublic RouterFunction\u003cServerResponse\u003e build() {\n\t\tif (this.routerFunctions.isEmpty()) {\n\t\t\tthrow new IllegalStateException(\"No routes registered. Register a route with GET(), POST(), etc.\");\n\t\t}\n\t\tRouterFunction\u003cServerResponse\u003e result = new BuiltRouterFunction(this.routerFunctions);\n\n\t\tif (this.filterFunctions.isEmpty() \u0026\u0026 this.errorHandlers.isEmpty()) {\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tHandlerFilterFunction\u003cServerResponse, ServerResponse\u003e filter =\n\t\t\t\t\tStream.concat(this.filterFunctions.stream(), this.errorHandlers.stream())\n\t\t\t\t\t\t\t.reduce(HandlerFilterFunction::andThen)\n\t\t\t\t\t\t\t.orElseThrow(IllegalStateException::new);\n\n\t\t\treturn result.filter(filter);\n\t\t}\n\t}\n\n\n\t/**\n\t * Router function returned by {@link #build()} that simply iterates over the registered routes.\n\t */\n\tprivate static class BuiltRouterFunction extends RouterFunctions.AbstractRouterFunction\u003cServerResponse\u003e {\n\n\t\tprivate final List\u003cRouterFunction\u003cServerResponse\u003e\u003e routerFunctions;\n\n\t\tpublic BuiltRouterFunction(List\u003cRouterFunction\u003cServerResponse\u003e\u003e routerFunctions) {\n\t\t\tAssert.notEmpty(routerFunctions, \"RouterFunctions must not be empty\");\n\t\t\tthis.routerFunctions = new ArrayList\u003c\u003e(routerFunctions);\n\t\t}\n\n\t\t@Override\n\t\tpublic Mono\u003cHandlerFunction\u003cServerResponse\u003e\u003e route(ServerRequest request) {\n\t\t\treturn Flux.fromIterable(this.routerFunctions)\n\t\t\t\t\t.concatMap(routerFunction -\u003e routerFunction.route(request))\n\t\t\t\t\t.next();\n\t\t}\n\n\t\t@Override\n\t\tpublic void accept(RouterFunctions.Visitor visitor) {\n\t\t\tthis.routerFunctions.forEach(routerFunction -\u003e routerFunction.accept(visitor));\n\t\t}\n\t}\n\n}\n```\n\n\u003c!--- Explain the difference from current behavior and why do you need this feature (aka why it is not possible to implement the desired functionality with the current version) --\u003e\n\n**Context**\n\nAPI is MCP, allowing AI to connect to the real world with lower cost, speed, and security. The existing APIs can be instantly converted into a Remote MCP Server, laying out the shortest connection path between AI and the real world.\n\nWe need to start multiple `WebFluxStreamableServerTransportProvider`, `McpAsyncServer` instances in one application process. Please to see the follow code in `McpServerConfiguration`, that is reference to `McpServerStreamableHttpWebFluxAutoConfiguration`.\n\nIt can support the follow MCP-Servers:\n- `/mcp`\n- `/mcp/mcp-server-app-name-A` -\u003e some MCP-Tools\n- `/mcp/mcp-server-app-name-B` -\u003e some MCP-Tools\n\nBut the `RouterFunction` can not dynamic update when the database update for some new app-name MCP-Server.\n\n- `/mcp/mcp-server-app-name-C`\n\n```java\n@Slf4j\n@EnableConfigurationProperties({ McpServerStreamableHttpProperties.class })\n@Configuration(proxyBeanMethods = false)\npublic class McpServerConfiguration {\n\n    public McpServerConfiguration() {\n        log.info(\"create McpServerConfiguration\");\n    }\n\n    @Bean\n    public Map\u003cString, List\u003cMcpTool\u003e\u003e mcpToolListMap() {\n        List\u003cString\u003e yamlFiles = List.of(\n                \"mcp-server-user-apis.yml\",\n                \"mcp-server-travel-apis.yml\"\n        );\n\n        return yamlFiles.stream()\n                .map(YamlUtil::load)\n                .collect(Collectors.toMap(\n                        mcpServerRule -\u003e mcpServerRule.getServer().getName(),\n                        McpServerRule::getTools\n                ));\n    }\n\n    @Bean\n    @ConditionalOnProperty(prefix = McpServerProperties.CONFIG_PREFIX, name = \"type\", havingValue = \"ASYNC\")\n    @Conditional({ McpServerAutoConfiguration.EnabledStreamableServerCondition.class })\n    public Map\u003cString, WebFluxStreamableServerTransportProvider\u003e transportProviderMap(\n            Map\u003cString, List\u003cMcpTool\u003e\u003e mcpToolListMap) {\n        log.info(\"init transportProviderMap\");\n\n        Map\u003cString, WebFluxStreamableServerTransportProvider\u003e transportProviderMap =\n                new ConcurrentHashMap\u003c\u003e(mcpToolListMap.size());\n        transportProviderMap.putAll(McpServerTransportManager.transportProviderMap(mcpToolListMap.keySet()));\n        return transportProviderMap;\n    }\n\n    /**\n     * @see McpServerAutoConfiguration#capabilitiesBuilder()\n     */\n    @Bean\n    public McpSchema.ServerCapabilities.Builder capabilitiesBuilder() {\n        log.info(\"init capabilitiesBuilder\");\n\n        return McpSchema.ServerCapabilities.builder()\n                .tools(true);\n    }\n\n    @Bean\n    @ConditionalOnProperty(prefix = McpServerProperties.CONFIG_PREFIX, name = \"type\", havingValue = \"ASYNC\")\n    public Map\u003cString, McpAsyncServer\u003e mcpAsyncServerMap(\n            Map\u003cString, List\u003cMcpTool\u003e\u003e mcpToolListMap,\n            Map\u003cString, WebFluxStreamableServerTransportProvider\u003e transportProviderMap,\n            McpSchema.ServerCapabilities.Builder capabilitiesBuilder) {\n        log.info(\"init mcpAsyncServerMap\");\n\n        return McpServerManager.mcpAsyncServerMap(mcpToolListMap, transportProviderMap, capabilitiesBuilder);\n    }\n\n    /**\n     * @see McpServerStreamableHttpWebFluxAutoConfiguration#webFluxStreamableServerTransportProvider\n     */\n    @Bean\n    @ConditionalOnProperty(prefix = McpServerProperties.CONFIG_PREFIX, name = \"type\", havingValue = \"ASYNC\")\n    @Conditional({ McpServerAutoConfiguration.EnabledStreamableServerCondition.class })\n    public WebFluxStreamableServerTransportProvider webFluxStreamableServerTransportProvider(\n            ObjectProvider\u003cObjectMapper\u003e objectMapperProvider, McpServerStreamableHttpProperties serverProperties) {\n        log.info(\"init webFluxStreamableServerTransportProvider\");\n\n        ObjectMapper objectMapper = objectMapperProvider.getIfAvailable(ObjectMapper::new);\n\n        return WebFluxStreamableServerTransportProvider.builder()\n                .objectMapper(objectMapper)\n                .messageEndpoint(serverProperties.getMcpEndpoint())\n                .keepAliveInterval(serverProperties.getKeepAliveInterval())\n                .disallowDelete(serverProperties.isDisallowDelete())\n                .build();\n    }\n\n    /**\n     * @see McpServerStreamableHttpWebFluxAutoConfiguration#webFluxStreamableServerRouterFunction\n     */\n    // Router function for streamable http transport used by Spring WebFlux to start an\n    // HTTP server.\n    @Bean\n    @ConditionalOnProperty(prefix = McpServerProperties.CONFIG_PREFIX, name = \"type\", havingValue = \"ASYNC\")\n    @Conditional({ McpServerAutoConfiguration.EnabledStreamableServerCondition.class })\n    public RouterFunction\u003c?\u003e webFluxStreamableServerRouterFunction(\n            WebFluxStreamableServerTransportProvider webFluxProvider,\n            Map\u003cString, WebFluxStreamableServerTransportProvider\u003e transportProviderMap) {\n        log.info(\"init webFluxStreamableServerRouterFunction\");\n\n        RouterFunctions.Builder routerFunctionBuilder = RouterFunctions.route();\n        routerFunctionBuilder.add((RouterFunction\u003cServerResponse\u003e) webFluxProvider.getRouterFunction());\n\n        for (WebFluxStreamableServerTransportProvider transportProvider : transportProviderMap.values()) {\n            routerFunctionBuilder.add((RouterFunction\u003cServerResponse\u003e) transportProvider.getRouterFunction());\n        }\n\n        return routerFunctionBuilder.build();\n    }\n\n}\n```\n\n\u003c!--- \nHow has this issue affected you?\nWhat are you trying to accomplish?\nWhat other alternatives have you considered?\nAre you aware of any workarounds?\n--\u003e\n","author":{"url":"https://github.com/lihuagang03","@type":"Person","name":"lihuagang03"},"datePublished":"2025-10-14T03:08:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/621/java-sdk/issues/621"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f1248d26-4273-cbba-5232-c003ea75f5fa
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE59C:1C1025:1B9D661:2518283:6A5BB177
html-safe-noncee8e35a1890a514b95de82fc736a7fa0d9de6c3635a037e7d46800172dd0d4c14
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTlDOjFDMTAyNToxQjlENjYxOjI1MTgyODM6NkE1QkIxNzciLCJ2aXNpdG9yX2lkIjoiODE0MjAxNTY4NDI5OTk2MDY5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0d7f85a02281b5587db50f4c6065f045b7fe1e1d4f04a70f4a265892a31a219a
hovercard-subject-tagissue:3512182926
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/java-sdk/621/issue_layout
twitter:imagehttps://opengraph.githubassets.com/54dfa4d3948c70da12bd78ccdfbaff8cd617cd5a21d2eebdbfff93438186bc75/modelcontextprotocol/java-sdk/issues/621
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/54dfa4d3948c70da12bd78ccdfbaff8cd617cd5a21d2eebdbfff93438186bc75/modelcontextprotocol/java-sdk/issues/621
og:image:altPlease do a quick search on GitHub issues first, the feature you are about to request might have already been requested. #79 #80 #425 #432 Expected Behavior The user can customize the endpoint rout...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelihuagang03
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id919609219
octolytics-dimension-repository_nwomodelcontextprotocol/java-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id919609219
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/java-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/java-sdk/issues/621#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fjava-sdk%2Fissues%2F621
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fjava-sdk%2Fissues%2F621
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fjava-sdk
Reloadhttps://github.com/modelcontextprotocol/java-sdk/issues/621
Reloadhttps://github.com/modelcontextprotocol/java-sdk/issues/621
Reloadhttps://github.com/modelcontextprotocol/java-sdk/issues/621
Please reload this pagehttps://github.com/modelcontextprotocol/java-sdk/issues/621
modelcontextprotocol https://github.com/modelcontextprotocol
java-sdkhttps://github.com/modelcontextprotocol/java-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Fork 979 https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Star 3.6k https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Code https://github.com/modelcontextprotocol/java-sdk
Issues 133 https://github.com/modelcontextprotocol/java-sdk/issues
Pull requests 147 https://github.com/modelcontextprotocol/java-sdk/pulls
Discussions https://github.com/modelcontextprotocol/java-sdk/discussions
Actions https://github.com/modelcontextprotocol/java-sdk/actions
Projects https://github.com/modelcontextprotocol/java-sdk/projects
Models https://github.com/modelcontextprotocol/java-sdk/models
Security and quality 2 https://github.com/modelcontextprotocol/java-sdk/security
Insights https://github.com/modelcontextprotocol/java-sdk/pulse
Code https://github.com/modelcontextprotocol/java-sdk
Issues https://github.com/modelcontextprotocol/java-sdk/issues
Pull requests https://github.com/modelcontextprotocol/java-sdk/pulls
Discussions https://github.com/modelcontextprotocol/java-sdk/discussions
Actions https://github.com/modelcontextprotocol/java-sdk/actions
Projects https://github.com/modelcontextprotocol/java-sdk/projects
Models https://github.com/modelcontextprotocol/java-sdk/models
Security and quality https://github.com/modelcontextprotocol/java-sdk/security
Insights https://github.com/modelcontextprotocol/java-sdk/pulse
feat: Support separate endpoint path router in WebFluxStreamableServerTransportProviderhttps://github.com/modelcontextprotocol/java-sdk/issues/621#top
https://github.com/lihuagang03
lihuagang03https://github.com/lihuagang03
on Oct 14, 2025https://github.com/modelcontextprotocol/java-sdk/issues/621#issue-3512182926
#79https://github.com/modelcontextprotocol/java-sdk/issues/79
#80https://github.com/modelcontextprotocol/java-sdk/pull/80
#425https://github.com/modelcontextprotocol/java-sdk/pull/425
#432https://github.com/modelcontextprotocol/java-sdk/pull/432
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.