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(mcp): current_user not being set in MCP requests (#25393)

Novicee180c19cca9a
diff --git a/api/extensions/ext_login.py b/api/extensions/ext_login.py
index cd01a310683..5571c0d9ba2 100644
--- a/api/extensions/ext_login.py
+++ b/api/extensions/ext_login.py
@@ -86,9 +86,7 @@ def load_user_from_request(request_from_flask_login):
if not app_mcp_server:
raise NotFound("App MCP server not found.")
end_user = (
- db.session.query(EndUser)
- .where(EndUser.external_user_id == app_mcp_server.id, EndUser.type == "mcp")
- .first()
+ db.session.query(EndUser).where(EndUser.session_id == app_mcp_server.id, EndUser.type == "mcp").first()
)
if not end_user:
raise NotFound("End user not found.")