Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix incorrect mcp method_name (#22736)

Will29f0a9ab94a7
diff --git a/api/core/mcp/mcp_client.py b/api/core/mcp/mcp_client.py
index f7aa7bbd7b7..5fe52c008ac 100644
--- a/api/core/mcp/mcp_client.py
+++ b/api/core/mcp/mcp_client.py
@@ -69,7 +69,7 @@ class MCPClient:
parsed_url = urlparse(self.server_url)
path = parsed_url.path or ""
- method_name = path.removesuffix("/").lower()
+ method_name = path.rstrip("/").split("/")[-1] if path else ""
if method_name in connection_methods:
client_factory = connection_methods[method_name]
self.connect_server(client_factory, method_name)