MCP error:Unknown Server-Sent Event: ping #16286

Closed
opened 2026-02-21 19:25:28 -05:00 by yindo · 2 comments
Owner

Originally created by @HZJprince on GitHub (Aug 20, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.7.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I use dify's official MCP policy tool in my workflow, when I call the MCP service launched by dify's own application, "Failed to transform agent message: req_id: dbc1246564 PluginInvokeError: {"args":{},"error_type":"Exception","message": "server_name2 - Unknown Server-Sent Event: ping"}"
1、Dify's MCP function

Image

2、MCP configuration of the agent

Image

3、error

Image

✔️ Expected Behavior

If I use an external mcp link, it returns the result normally

Image

Actual Behavior

No response

Originally created by @HZJprince on GitHub (Aug 20, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.7.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When I use dify's official MCP policy tool in my workflow, when I call the MCP service launched by dify's own application, "Failed to transform agent message: req_id: dbc1246564 PluginInvokeError: {"args":{},"error_type":"Exception","message": "server_name2 - Unknown Server-Sent Event: ping"}" 1、Dify's MCP function <img width="684" height="271" alt="Image" src="https://github.com/user-attachments/assets/f49fbeec-fe87-453d-b90a-9cd51160c2d2" /> 2、MCP configuration of the agent <img width="600" height="928" alt="Image" src="https://github.com/user-attachments/assets/37fb9814-ffa8-4f51-bd68-be086dd0ffad" /> 3、error <img width="592" height="457" alt="Image" src="https://github.com/user-attachments/assets/cf4cec5a-89fa-4da7-bb75-87751e5acf4d" /> ### ✔️ Expected Behavior If I use an external mcp link, it returns the result normally <img width="580" height="747" alt="Image" src="https://github.com/user-attachments/assets/b24ef3dc-b982-4a15-b384-cf489efe9751" /> ### ❌ Actual Behavior _No response_
yindo added the 🌊 feat:workflowwont-fix labels 2026-02-21 19:25:28 -05:00
yindo closed this issue 2026-02-21 19:25:28 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 20, 2025):

The error happens because the MCP server emits SSE events named ping, but the Dify agent's SSE client only recognizes endpoint and message events. When it receives a ping, it logs this warning and blocks communication between workflows via MCP. To fix this, make sure your MCP connections use the streamable-http transport, not the SSE client—the streamable client treats ping events as no-ops and won't error out. Double-check your MCP server URL: it should end with /mcp or /mcp/ to use the streamable HTTP client; URLs ending with /sse will trigger the SSE client, which does not handle ping events properly. If you must use SSE, you could patch the SSE client to ignore ping events, but using streamable HTTP transport is the recommended fix. Also, in Docker setups, avoid using localhost or private IPs for MCP endpoints—use host.docker.internal or run the MCP server as a service in the same Docker network. Make sure your reverse proxy config (like Nginx) passes the correct headers and paths for MCP endpoints. Reference

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 20, 2025): <!-- Answer --> The error happens because the MCP server emits SSE events named `ping`, but the Dify agent's SSE client only recognizes `endpoint` and `message` events. When it receives a `ping`, it logs this warning and blocks communication between workflows via MCP. To fix this, make sure your MCP connections use the `streamable-http` transport, not the SSE client—the streamable client treats `ping` events as no-ops and won't error out. Double-check your MCP server URL: it should end with `/mcp` or `/mcp/` to use the streamable HTTP client; URLs ending with `/sse` will trigger the SSE client, which does not handle `ping` events properly. If you must use SSE, you could patch the SSE client to ignore `ping` events, but using streamable HTTP transport is the recommended fix. Also, in Docker setups, avoid using `localhost` or private IPs for MCP endpoints—use `host.docker.internal` or run the MCP server as a service in the same Docker network. Make sure your reverse proxy config (like Nginx) passes the correct headers and paths for MCP endpoints. [Reference](https://github.com/langgenius/dify/discussions/23489#discussioncomment-14014823) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/11093db9-d208-40bd-aab0-7695568894e8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/11093db9-d208-40bd-aab0-7695568894e8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/11093db9-d208-40bd-aab0-7695568894e8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/11093db9-d208-40bd-aab0-7695568894e8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/11093db9-d208-40bd-aab0-7695568894e8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/11093db9-d208-40bd-aab0-7695568894e8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/11093db9-d208-40bd-aab0-7695568894e8?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/24216)
Author
Owner

@crazywoola commented on GitHub (Aug 20, 2025):

Please submit an issue to the author's repo instead.

@crazywoola commented on GitHub (Aug 20, 2025): Please submit an issue to the author's repo instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16286