Title: SSE Server drops client connection at 5 min. · Issue #414 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: SSE Server drops client connection at 5 min. · Issue #414 · modelcontextprotocol/java-sdk
X Title: SSE Server drops client connection at 5 min. · Issue #414 · modelcontextprotocol/java-sdk
Description: Bug description I developed a MCP server with webmvc SSE endpoint but when a client connects via /sse endpoint, after appx 5 min later server drops connection. This is happen because Client-side needs from server-side to ping itself. Cur...
Open Graph Description: Bug description I developed a MCP server with webmvc SSE endpoint but when a client connects via /sse endpoint, after appx 5 min later server drops connection. This is happen because Client-side ne...
X Description: Bug description I developed a MCP server with webmvc SSE endpoint but when a client connects via /sse endpoint, after appx 5 min later server drops connection. This is happen because Client-side ne...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/414
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SSE Server drops client connection at 5 min.","articleBody":"**Bug description**\nI developed a MCP server with webmvc SSE endpoint but when a client connects via /sse endpoint, after appx 5 min later server drops connection. This is happen because Client-side needs from server-side to ping itself. Current release doesnt support this and \n\n**Environment**\nJDK:17\nSpring Boot: 3.5.3\nSpring AI: 1.0.0\n\n**Steps to reproduce**\nYou can reproduce this bug on any setup. I try with Spring example with webmvc [https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/weather/starter-webmvc-server](url) You can start this app and just connect it with cursor or vscode and then 5min later client will got an error.\n\nClient-side servername: LOCAL-SERVER,\n \"LOCAL-SERVER\": {\n \"url\": \"http://localhost:8080/sse\"\n }\n\n2025-07-18 21:18:05.422 [info] user-LOCAL-SERVER: Handling CreateClient action\n2025-07-18 21:18:05.422 [info] user-LOCAL-SERVER: Creating streamableHttp transport\n2025-07-18 21:18:05.422 [info] user-LOCAL-SERVER: Connecting to streamableHttp server\n2025-07-18 21:18:05.432 [error] user-LOCAL-SERVER: Client error for command Error POSTing to endpoint (HTTP 404): {\"timestamp\":\"2025-07-18T18:18:05.431+00:00\",\"status\":404,\"error\":\"Not Found\",\"path\":\"/sse\"}\n2025-07-18 21:18:05.433 [info] user-LOCAL-SERVER: Client closed for command\n2025-07-18 21:18:05.433 [error] user-LOCAL-SERVER: Error connecting to streamableHttp server, falling back to SSE: Error POSTing to endpoint (HTTP 404): {\"timestamp\":\"2025-07-18T18:18:05.431+00:00\",\"status\":404,\"error\":\"Not Found\",\"path\":\"/sse\"}\n2025-07-18 21:18:05.433 [error] user-LOCAL-SERVER: Error connecting to streamableHttp server, falling back to SSE: Error POSTing to endpoint (HTTP 404): {\"timestamp\":\"2025-07-18T18:18:05.431+00:00\",\"status\":404,\"error\":\"Not Found\",\"path\":\"/sse\"}\n2025-07-18 21:18:05.433 [info] user-LOCAL-SERVER: Connecting to SSE server\n2025-07-18 21:18:05.448 [info] user-LOCAL-SERVER: Successfully connected to streamableHttp server\n2025-07-18 21:18:05.448 [info] user-LOCAL-SERVER: Storing streamableHttp client\n2025-07-18 21:18:05.449 [info] user-LOCAL-SERVER: Handling ListOfferings action\n2025-07-18 21:18:05.449 [info] user-LOCAL-SERVER: Listing offerings\n2025-07-18 21:18:05.449 [info] user-LOCAL-SERVER: Connected to streamableHttp server, fetching offerings\n2025-07-18 21:18:05.452 [info] listOfferings: Found 3 tools\n2025-07-18 21:18:05.452 [info] user-LOCAL-SERVER: Found 3 tools\n2025-07-18 21:23:09.107 [error] user-LOCAL-SERVER: Client error for command SSE error: TypeError: terminated: Body Timeout Error\n\n**Expected behavior**\nYou can add periodic ping option to keep alive for each client connection. (time)\n\n\nSame issue: [https://github.com/modelcontextprotocol/typescript-sdk/issues/270](url)\n","author":{"url":"https://github.com/albayrakonur","@type":"Person","name":"albayrakonur"},"datePublished":"2025-07-18T18:26:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/414/java-sdk/issues/414"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:761461e8-a212-0f09-3c39-b2906908d769 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C53A:3948C3:124D99D:19FCEA8:6A607290 |
| html-safe-nonce | 101e6354620f33cee8bb2504cf79dd33528d70ddbe0e7d7e86b054b0f3ed4979 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTNBOjM5NDhDMzoxMjREOTlEOjE5RkNFQTg6NkE2MDcyOTAiLCJ2aXNpdG9yX2lkIjoiOTA3OTc2NjAzMTgyMTQ2ODMwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d7b8ed3b58636b6ee30119d7792edecf531bf1d7f2dc0772d30b1128a2c3b177 |
| hovercard-subject-tag | issue:3244023365 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/modelcontextprotocol/java-sdk/414/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e684eb73dcd4ab5fb634130be6f1e9a11b09ad1337e316579633684575849fe2/modelcontextprotocol/java-sdk/issues/414 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e684eb73dcd4ab5fb634130be6f1e9a11b09ad1337e316579633684575849fe2/modelcontextprotocol/java-sdk/issues/414 |
| og:image:alt | Bug description I developed a MCP server with webmvc SSE endpoint but when a client connects via /sse endpoint, after appx 5 min later server drops connection. This is happen because Client-side ne... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | albayrakonur |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60da8c2a42fa2bbf5f7567474990ec467836a84444262a58e200fa91b7f3d2d0 |
| turbo-cache-control | no-preview |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9824515e740d83d5eb82168a089b806ab0fe04a1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width