| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
MCP Client as Agent Strategy Plugin.
Important
Dify is not MCP Server but MCP Host.
Currently, each MCP client (ReAct Agent) node can connect a stdio MCP server.
Note
Most of the code in this repository contains the following files.
https://github.com/langgenius/dify-official-plugins/tree/main/agent-strategies/cot_agent
Important
ReAct while loop is as they are
Caution
This plugin does not implement a human-in-the-loop mechanism by default, so connect reliable mcp server only.
To avoid it, decrease max itereations(default:3) to 1, and use this Agent node repeatedly in Chatflow.
However, agent memory is reset by the end of Workflow.
Use Conversaton Variable to save history and pass it to QUERY.
Don't forget to add a phrase such as
"ask for user's permission when calling tools" in INSTRUCTION.
Warning
Warning
steps are as follows. how-to-develop-and-deploy-plugin
https://github.com/3dify-project/dify-mcp-client/

Issue: If you encounter the error message: plugin verification has been enabled, and the plugin you want to install has a bad signature, how to handle the issue?
Solution: Add the following line to the end of your /docker/.env configuration file:
FORCE_VERIFYING_SIGNATURE=false
Run the following commands to restart the Dify service:
cd docker
docker compose down
docker compose up -dOnce this field is added, the Dify platform will allow the installation of all plugins that are not listed (and thus not verified) in the Dify Marketplace.
Tip
Marketplace need Approval. If stars☆ reach 100, I'll consider to make PR for them.

MCP Agent Plugin node require config_json like this to command to awake an MCP server
{
"mcpservers":{
"name_of_mcpserver":{
"command": "npx",
"args": ["arg1", "arg2"]
},
}
}
Warning
https://github.com/3dify-project/dify-mcp-client/tree/main/test/chatflow
https://github.com/modelcontextprotocol/servers/tree/main/src/everything
https://github.com/3dify-project/dify-mcp-client/blob/main/GUIDE.md
In my case (Windows 11) ,need to download dify-plugin-windows-amd64.exe (v0.0.3)
Choose your OS-compatible verson at here:
https://github.com/langgenius/dify-plugin-daemon/releases
Rename it as dify.exe
https://docs.dify.ai/plugins/quick-start/develop-plugins/initialize-development-tools
Note
You can skip this stage if you pull or download codes of this repo
dify plugin init
Python3.12+ is compatible. Dify plugin official installation guide use pip, but I used uv.
uv init --python=python3.12 .venv\Scripts\activate
Install python modules for plugin development
uv add werkzeug==3.0.3 uv add flask uv add dify_plugin
I changed REMOTE_INSTALL_HOST from debug.dify.ai to localhost (Docker Compose environment) click bug icon button to see these information
cd mcp_client
pip install -r requirements.txt
python -m main
(ctrl+C to stop)
Tip
REMOTE_INSTALL_KEY of .env often changes. If you encounter error messages like handshake failed, invalid key, renew it.
https://github.com/langgenius/dify-plugin-sdks
https://github.com/modelcontextprotocol/python-sdk
Tip
Especially useful following MCP client example
https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/clients/simple-chatbot/mcp_simple_chatbot/main.py
Note
Dify plugin has requirements.txt which automatically installs python modules.
I include mcp in it, so you don't need to download the MCP SDK separately.
| Back | FazBrowse Home | New Git URL |