This repository provides an MCP Client plugin for Dify, enabling ReAct Agent strategies to connect to MCP servers, convert tools, and utilize LLMs within a ReAct loop. This repository provides
MCP Client
as Agent Strategy Plugin. Dify acts as the MCP Host
, not the MCP Server
.
Each MCP client
(ReAct Agent) connects to MCP servers
, converting Tool
, Resource
, and Prompt
lists into Dify Tools. The selected LLM uses these tools based on the ReAct loop. This plugin modifies the ReAct agent strategy to integrate with MCP servers. It includes new functions for MCP, initializes AsyncExitStack
and the event loop, handles action invocation, and sets up/cleans up MCP. It supports multi SSE servers.
This plugin lacks a human-in-the-loop mechanism by default, so use reliable MCP servers. Decrease max iterations
to 1
and use the Agent node repeatedly in Chatflow. Select Dify tools like "current time" to avoid blank Tools fields.
Install the plugin from GitHub or a .difypkg
file. Configure the config_json
with server URLs. A Chatflow example is provided for testing. Convert stdio MCP servers into SSE MCP servers via code edits or mcp-proxy
.
3dify-project/dify-mcp-client
March 10, 2025
March 28, 2025
Python