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(api): accept MCP protocol version 2025-11-25 (#44066)

leilei3167905f6b778290
diff --git a/api/core/mcp/entities.py b/api/core/mcp/entities.py
index 21edc86a57f..aef8881145f 100644
--- a/api/core/mcp/entities.py
+++ b/api/core/mcp/entities.py
@@ -7,7 +7,8 @@ from pydantic import BaseModel
from core.mcp.session.base_session import BaseSession
from core.mcp.types import LATEST_PROTOCOL_VERSION, OAuthClientInformation, OAuthMetadata, RequestId, RequestParams
-SUPPORTED_PROTOCOL_VERSIONS: list[str] = ["2024-11-05", "2025-03-26", LATEST_PROTOCOL_VERSION]
+# 2025-06-18 stays explicit: it is no longer LATEST_PROTOCOL_VERSION, but servers still negotiate down to it.
+SUPPORTED_PROTOCOL_VERSIONS: list[str] = ["2024-11-05", "2025-03-26", "2025-06-18", LATEST_PROTOCOL_VERSION]
@dataclass
diff --git a/api/core/mcp/types.py b/api/core/mcp/types.py
index 8d1e6587c5f..4a1f789f1ae 100644
--- a/api/core/mcp/types.py
+++ b/api/core/mcp/types.py
@@ -23,7 +23,7 @@ for reference.
not separate types in the schema.
"""
# Latest protocol version the Dify MCP client negotiates with upstream MCP servers.
-LATEST_PROTOCOL_VERSION = "2025-06-18"
+LATEST_PROTOCOL_VERSION = "2025-11-25"
# Latest protocol version the Dify MCP server advertises to connecting clients.
SERVER_LATEST_PROTOCOL_VERSION = "2025-06-18"
# Protocol versions the Dify MCP server can negotiate down to (e.g. Claude on 2024-11-05).
diff --git a/api/tests/unit_tests/core/mcp/test_types.py b/api/tests/unit_tests/core/mcp/test_types.py
index 996fa1ccbbd..70ccf2fa0ce 100644
--- a/api/tests/unit_tests/core/mcp/test_types.py
+++ b/api/tests/unit_tests/core/mcp/test_types.py
@@ -3,6 +3,7 @@
import pytest
from pydantic import ValidationError
+from core.mcp.entities import SUPPORTED_PROTOCOL_VERSIONS
from core.mcp.types import (
DEFAULT_NEGOTIATED_VERSION,
INTERNAL_ERROR,
@@ -60,7 +61,11 @@ class TestConstants:
def test_protocol_versions(self) -> None:
"""Test protocol version constants."""
- assert LATEST_PROTOCOL_VERSION == "2025-06-18"
+ assert LATEST_PROTOCOL_VERSION == "2025-11-25"
+ assert "2025-11-25" in SUPPORTED_PROTOCOL_VERSIONS
+ assert "2025-06-18" in SUPPORTED_PROTOCOL_VERSIONS
+ assert "2025-03-26" in SUPPORTED_PROTOCOL_VERSIONS
+ assert "2024-11-05" in SUPPORTED_PROTOCOL_VERSIONS
assert SERVER_LATEST_PROTOCOL_VERSION == "2025-06-18"
assert DEFAULT_NEGOTIATED_VERSION == "2025-03-26"
assert sorted(SERVER_SUPPORTED_PROTOCOL_VERSIONS) == ["2024-11-05", "2025-03-26", "2025-06-18"]