René's URL Explorer Experiment


Title: Streamable servlet transport does not close SSE response for unknown methods · Issue #1050 · modelcontextprotocol/java-sdk · GitHub

Open Graph Title: Streamable servlet transport does not close SSE response for unknown methods · Issue #1050 · modelcontextprotocol/java-sdk

X Title: Streamable servlet transport does not close SSE response for unknown methods · Issue #1050 · modelcontextprotocol/java-sdk

Description: DISCLAIMER: Codex-generated bug report Bug description With HttpServletStreamableServerTransportProvider in Java SDK 2.0.0, a request for an unknown or unsupported JSON-RPC method receives the correct -32601 Method not found response, bu...

Open Graph Description: DISCLAIMER: Codex-generated bug report Bug description With HttpServletStreamableServerTransportProvider in Java SDK 2.0.0, a request for an unknown or unsupported JSON-RPC method receives the corr...

X Description: DISCLAIMER: Codex-generated bug report Bug description With HttpServletStreamableServerTransportProvider in Java SDK 2.0.0, a request for an unknown or unsupported JSON-RPC method receives the corr...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Streamable servlet transport does not close SSE response for unknown methods","articleBody":"# DISCLAIMER: Codex-generated bug report\n\n  ## Bug description\n\n  With `HttpServletStreamableServerTransportProvider` in Java SDK 2.0.0, a request for an unknown or unsupported JSON-RPC method receives the correct `-32601 Method not found`\n  response, but the POST response's SSE stream remains open indefinitely.\n\n  Supported methods close their SSE streams normally after returning a response.\n\n  The MCP Streamable HTTP specification says that after the JSON-RPC response has been sent, the server should close the SSE stream:\n\n  https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#sending-messages-to-the-server\n\n  ## Environment\n\n  - MCP Java SDK: 2.0.0\n  - Transport: `HttpServletStreamableServerTransportProvider`\n  - Jetty: 12.1.10\n  - Jakarta Servlet API: 6.1\n  - Java: 25.0.3\n  - Negotiated MCP protocol: `2025-06-18`\n\n  The server advertises tools but not resources or prompts.\n\n  ## Steps to reproduce\n\n  Initialize a session:\n\n  ```sh\n  curl --max-time 5 -i -X POST http://127.0.0.1:8080/mcp \\\n    -H 'Content-Type: application/json' \\\n    -H 'Accept: application/json, text/event-stream' \\\n    --data-binary '{\n      \"jsonrpc\": \"2.0\",\n      \"id\": 1,\n      \"method\": \"initialize\",\n      \"params\": {\n        \"protocolVersion\": \"2025-06-18\",\n        \"capabilities\": {},\n        \"clientInfo\": {\n          \"name\": \"reproducer\",\n          \"version\": \"1.0\"\n        }\n      }\n    }'\n  ```\n\n  Copy the returned `Mcp-Session-Id`, send `notifications/initialized`, and then call an unsupported method:\n\n  ```sh\n  curl --max-time 3 -i -X POST http://127.0.0.1:8080/mcp \\\n    -H 'Content-Type: application/json' \\\n    -H 'Accept: application/json, text/event-stream' \\\n    -H 'MCP-Protocol-Version: 2025-06-18' \\\n    -H 'Mcp-Session-Id: SESSION_ID' \\\n    --data-binary '{\n      \"jsonrpc\": \"2.0\",\n      \"id\": 2,\n      \"method\": \"resources/list\",\n      \"params\": {}\n    }'\n  ```\n\n  The server sends an SSE event promptly:\n\n  ```text\n  event: message\n  data: {\"jsonrpc\":\"2.0\",\"id\":2,\"error\":{\"code\":-32601,\"message\":\"Method not found: resources/list\"}}\n  ```\n\n  However, the HTTP response does not reach end-of-stream. Curl eventually reports:\n\n  ```text\n  curl: (28) Operation timed out after 3002 milliseconds\n  ```\n\n  Calling a supported method such as `tools/list` returns its response and closes the stream immediately.\n\n  ## Expected behavior\n\n  After sending the `-32601` JSON-RPC response, the server should complete the asynchronous servlet context and close the POST response's SSE stream.\n\n  ## Actual behavior\n\n  The JSON-RPC error is delivered, but the SSE stream and HTTP request remain open.\n\n  ## Apparent cause\n\n  In `McpStreamableServerSession.responseStream`, the missing-handler branch returns only:\n\n  ```java\n  return transport.sendMessage(\n      McpSchema.JSONRPCResponse.error(...));\n  ```\n\n  The registered-handler branch ends with:\n\n  ```java\n  .flatMap(transport::sendMessage)\n  .then(transport.closeGracefully());\n  ```\n\n  The missing-handler branch appears to need the same transport closure:\n\n  ```java\n  return transport.sendMessage(\n      McpSchema.JSONRPCResponse.error(...))\n      .then(transport.closeGracefully());\n  ```\n\n  ## Impact\n\n  Clients that probe an unsupported method may wait indefinitely unless they impose a timeout. The server also retains the asynchronous servlet request until the client disconnects.\n","author":{"url":"https://github.com/AlanBurlison","@type":"Person","name":"AlanBurlison"},"datePublished":"2026-07-01T11:03:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1050/java-sdk/issues/1050"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5d1a8398-d6a0-978c-d666-74c786bed1ee
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC324:34684:7EED30F:AD82835:6A5E7508
html-safe-nonce30c394ddb379fafc78b30fb7cce3ef2103ae7e078916a4776b8cefe36088960c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzI0OjM0Njg0OjdFRUQzMEY6QUQ4MjgzNTo2QTVFNzUwOCIsInZpc2l0b3JfaWQiOiI2OTAxNjc4OTQyMjQ2MDQwODQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2e2480b7ec8a9031733d698242ccb5b8c65e1949d7bbfd69c6a1fe61325d7208
hovercard-subject-tagissue:4784911379
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/1050/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8ab10b6f0201ef007cc146f04bbe24d50a33f4f7377d0cbbce66eaa2873d270f/modelcontextprotocol/java-sdk/issues/1050
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8ab10b6f0201ef007cc146f04bbe24d50a33f4f7377d0cbbce66eaa2873d270f/modelcontextprotocol/java-sdk/issues/1050
og:image:altDISCLAIMER: Codex-generated bug report Bug description With HttpServletStreamableServerTransportProvider in Java SDK 2.0.0, a request for an unknown or unsupported JSON-RPC method receives the corr...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAlanBurlison
hostnamegithub.com
expected-hostnamegithub.com
None71950bbe6bf7e15662b868c102fed9d1682c29a05970d9b2daa2e4dd3522c52e
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
release7514606601325843bc1c464d2d8bf5fe9af2c154
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/modelcontextprotocol/java-sdk/issues/1050#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fjava-sdk%2Fissues%2F1050
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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%2F1050
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/1050
Reloadhttps://github.com/modelcontextprotocol/java-sdk/issues/1050
Reloadhttps://github.com/modelcontextprotocol/java-sdk/issues/1050
Please reload this pagehttps://github.com/modelcontextprotocol/java-sdk/issues/1050
modelcontextprotocol https://github.com/modelcontextprotocol
java-sdkhttps://github.com/modelcontextprotocol/java-sdk
Notifications https://github.com/login?return_to=%2Fmodelcontextprotocol%2Fjava-sdk
Fork 980 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 135 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
Streamable servlet transport does not close SSE response for unknown methodshttps://github.com/modelcontextprotocol/java-sdk/issues/1050#top
https://github.com/AlanBurlison
AlanBurlisonhttps://github.com/AlanBurlison
on Jul 1, 2026https://github.com/modelcontextprotocol/java-sdk/issues/1050#issue-4784911379
https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#sending-messages-to-the-serverhttps://modelcontextprotocol.io/specification/2025-06-18/basic/transports#sending-messages-to-the-server
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.