mcp connect error #17284

Closed
opened 2026-02-21 19:33:33 -05:00 by yindo · 0 comments
Owner

Originally created by @xinkuang on GitHub (Sep 12, 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.8.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

mcp sse enpoint is ok,but fault

✔️ Expected Behavior

2025-09-12 09:06:44.710 INFO [Dummy-104] [_client.py:1038] - HTTP Request: GET https://mcp.api-inference.modelscope.net/XXXXX/sse⁠ "HTTP/1.1 200 OK"

2025-09-12 09:06:45.713 ERROR [Dummy-104] [sse_client.py:296] - Error connecting to SSE endpoint

Traceback (most recent call last):

File "/app/api/core/mcp/client/sse_client.py", line 209, in _wait_for_endpoint

status = status_queue.get(timeout=1)

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/queue.py", line 179, in get

raise Empty

_queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/app/api/core/mcp/client/sse_client.py", line 287, in sse_client

read_queue, write_queue = transport.connect(executor, client, event_source)

                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/app/api/core/mcp/client/sse_client.py", line 244, in connect

endpoint_url = self._wait_for_endpoint(status_queue)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/app/api/core/mcp/client/sse_client.py", line 211, in _wait_for_endpoint

raise ValueError("failed to get endpoint URL")

ValueError: failed to get endpoint URL

Actual Behavior

https://mcp.api-inference.modelscope.net/xxx is HTTP/1.1 200 OK, test sse is ok, but use dify mcp tools response: failed to get endpoint URL。

request:

fetch("http://localhost/console/api/workspaces/current/tool-provider/mcp", {
"headers": {
"accept": "/",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
"authorization": "Bearer ",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-ch-ua": ""Chromium";v="140", "Not=A?Brand";v="24", "Microsoft Edge";v="140"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": ""Windows"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
"referrer": "http://localhost/tools?category=mcp",
"body": "{"server_url":"https://mcp.api-inference.modelscope.net/XXXXXXXX/sse","name":"XXXX数据","icon_type":"emoji","icon":"chart","icon_background":"#EFF1F5","server_identifier":"XXXXX-mcp","timeout":30,"sse_read_timeout":300,"provider_id":"9593deb8-3a73-4e5e-b14a-ce9c3e5fd48c"}",
"method": "PUT",
"mode": "cors",
"credentials": "include"
});

response:
{"code":"invalid_param","message":"failed to get endpoint URL","status":400}

Originally created by @xinkuang on GitHub (Sep 12, 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.8.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce mcp sse enpoint is ok,but fault ### ✔️ Expected Behavior 2025-09-12 09:06:44.710 INFO [Dummy-104] [_client.py:1038] - HTTP Request: GET [https://mcp.api-inference.modelscope.net/XXXXX/sse⁠](https://mcp.api-inference.modelscope.netxxxx/sse) "HTTP/1.1 200 OK" 2025-09-12 09:06:45.713 ERROR [Dummy-104] [sse_client.py:296] - Error connecting to SSE endpoint Traceback (most recent call last): File "/app/api/core/mcp/client/sse_client.py", line 209, in _wait_for_endpoint status = status_queue.get(timeout=1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/queue.py", line 179, in get raise Empty _queue.Empty During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/core/mcp/client/sse_client.py", line 287, in sse_client read_queue, write_queue = transport.connect(executor, client, event_source) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/mcp/client/sse_client.py", line 244, in connect endpoint_url = self._wait_for_endpoint(status_queue) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/core/mcp/client/sse_client.py", line 211, in _wait_for_endpoint raise ValueError("failed to get endpoint URL") ValueError: failed to get endpoint URL ### ❌ Actual Behavior https://mcp.api-inference.modelscope.net/xxx is HTTP/1.1 200 OK, test sse is ok, but use dify mcp tools response: failed to get endpoint URL。 request: fetch("http://localhost/console/api/workspaces/current/tool-provider/mcp", { "headers": { "accept": "*/*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", "authorization": "Bearer ", "cache-control": "no-cache", "content-type": "application/json", "pragma": "no-cache", "sec-ch-ua": "\"Chromium\";v=\"140\", \"Not=A?Brand\";v=\"24\", \"Microsoft Edge\";v=\"140\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin" }, "referrer": "http://localhost/tools?category=mcp", "body": "{\"server_url\":\"https://mcp.api-inference.modelscope.net/XXXXXXXX/sse\",\"name\":\"XXXX数据\",\"icon_type\":\"emoji\",\"icon\":\"chart\",\"icon_background\":\"#EFF1F5\",\"server_identifier\":\"XXXXX-mcp\",\"timeout\":30,\"sse_read_timeout\":300,\"provider_id\":\"9593deb8-3a73-4e5e-b14a-ce9c3e5fd48c\"}", "method": "PUT", "mode": "cors", "credentials": "include" }); response: {"code":"invalid_param","message":"failed to get endpoint URL","status":400}
yindo added the 🌊 feat:workflow label 2026-02-21 19:33:33 -05:00
yindo closed this issue 2026-02-21 19:33:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#17284