Skip to content

Commit 0fdfcd8

Browse files
committed
chore: update mcp, dify_plugin and clean requirement.txt
1 parent ba7d131 commit 0fdfcd8

File tree

3 files changed

+39
-88
lines changed

3 files changed

+39
-88
lines changed

README.md

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ Each `MCP client` (ReAct Agent) node can connect `MCP servers`.
2525
- `__init__()` for initializing `AsyncExitStack` and `event loop`
2626
- Some codes in `_handle_invoke_action()` for MCP
2727
- MCP setup and cleanup in `_invoke()`
28-
- Add SSE MCP client (v0.0.2)
29-
- Support multi SSE servers (v0.0.3)
28+
3029
> [!IMPORTANT]
3130
> ReAct while loop is as they are
3231
33-
34-
32+
## 🔄 Update history
33+
- Add SSE MCP client (v0.0.2)
34+
- Support multi SSE servers (v0.0.3)
35+
- Update python module and simplify its dependency (v0.0.4)
36+
- mcp(v1.1.2→v1.6.0+)
37+
- dify_plugin(0.0.1b72→v0.1.0)
3538

3639
## ⚠️ Caution and Limitation
3740
> [!CAUTION]
@@ -64,7 +67,7 @@ https://github.com/3dify-project/dify-mcp-client/
6467
## How to handle errors when installing plugins?
6568

6669
**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? <br>
67-
**Solution**: Add the following line to the end of your `/docker/.env` configuration file:
70+
**Solution**: Open `/docker/.env` and change from `true` to `false`:
6871
```
6972
FORCE_VERIFYING_SIGNATURE=false
7073
```
@@ -78,10 +81,6 @@ Once this field is added, the Dify platform will allow the installation of all p
7881
> [!TIP]
7982
> Marketplace need Approval. If stars⭐ reach 100, I'll consider to make PR for them.
8083
81-
## Source code plugin deploy
82-
steps are as follows.
83-
[how-to-develop-and-deploy-plugin](https://github.com/3dify-project/dify-mcp-client?tab=readme-ov-file#how-to-develop-and-deploy-plugin)
84-
8584
## Where does this plugin show up?
8685
- It takes few minutes to install
8786
- Once installed, you can use it any workflows as Agent node
@@ -104,10 +103,13 @@ MCP Agent Plugin node require config_json like this to command or URL to connect
104103
```
105104
> [!WARNING]
106105
> - Each server's port number should be different, like 8080, 8008, ...
106+
> - If you want to use stdio mcp server
107+
> - Convert it to SSE mcp server
108+
> - or deploy with source code (**NOT** by .difypkg or GitHub reposity name install)
107109
108110
## Chatflow Example
109111
![showcase2](./_assets/everything_mcp_server_test_resource.png)
110-
#### I provide this Dify ChatFlow for testing dify mcp plugin as .yml.
112+
#### I provide this Dify ChatFlow `.yml` for testing this plugin.
111113
https://github.com/3dify-project/dify-mcp-client/tree/main/test/chatflow
112114
#### After download DSL(yml) file, import it in Dify and you can test MCP using "Everything MCP server"
113115
https://github.com/modelcontextprotocol/servers/tree/main/src/everything
@@ -136,7 +138,7 @@ which npx
136138
```
137139
where npx
138140
```
139-
141+
result
140142
```
141143
C:\Program Files\nodejs\npx
142144
C:\Program Files\nodejs\npx.cmd
@@ -170,12 +172,6 @@ pip install mcp-simple-arxiv
170172
mcp-proxy --sse-port=8008 --pass-environment -- C:\Users\USER_NAME\AppData\Local\Programs\Python\Python310\python.exe -m -mcp_simple_arxiv
171173
```
172174

173-
> [!Warning]
174-
> Additional argument for mcp-proxy. Be careful when you use it. There may be security risk such as XSS, CSRF. (default: no CORS allowed)
175-
> ```
176-
> --allow-origin='*'
177-
> ```
178-
179175
Following is a mcp-proxy setup log.
180176
```
181177
(mcp_proxy) C:\User\USER_NAME\mcp-proxy>mcp-proxy --sse-port=8080 --pass-environment -- C:\Program Files\nodejs\npx.cmd --arg1 -y --arg2 @modelcontextprotocol/server-everything
@@ -191,14 +187,19 @@ INFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
191187

192188
# 🔨 How to develop and deploy plugin
193189

194-
### General plugin dev guide
190+
### Official plugin dev guide
195191
https://github.com/3dify-project/dify-mcp-client/blob/main/GUIDE.md
196192

197193
### Dify plugin SDK daemon
198-
In my case (Windows 11) ,need to download dify-plugin-windows-amd64.exe (v0.0.3)<br>
199-
Choose your OS-compatible verson at here:<br>
194+
If your OS is Windows and CPU is Intel or AMD, you need to download `dify-plugin-windows-amd64.exe` (v0.0.7)<br>
195+
Choose your OS-compatible verson here:<br>
200196
https://github.com/langgenius/dify-plugin-daemon/releases <br>
201-
Rename it as dify.exe
197+
1. Rename it as dify.exe for convinence
198+
2. mkdir "C\User\user\\.local\bin" (Windows) and register it as system path.
199+
3. Copy `dify.exe` to under dify-mcp-client/
200+
> [!TIP]
201+
> Following guide is helpful.
202+
> https://docs.dify.ai/plugins/quick-start/develop-plugins/initialize-development-tools
202203
203204
### Reference
204205
https://docs.dify.ai/plugins/quick-start/develop-plugins/initialize-development-tools
@@ -211,33 +212,26 @@ https://docs.dify.ai/plugins/quick-start/develop-plugins/initialize-development-
211212
> Initial settings are as follow
212213
> ![InitialDifyPluginSetting](./_assets/initial_mcp_plugin_settings.png)
213214
215+
### Change directory
216+
```
217+
cd dify-mcp-client
218+
```
219+
214220
### Install python module
215-
Python3.12+ is compatible. Dify plugin official installation guide use pip, but I used uv.
221+
Python3.12+ is compatible. The `venv` and `uv` are not necessary, but recommended.
216222
```
217-
uv init --python=python3.12
223+
uv venv -p 3.12
218224
.venv\Scripts\activate
219225
```
220226
Install python modules for plugin development
221227
```
222-
uv add werkzeug==3.0.3
223-
uv add flask
224-
uv add dify_plugin
228+
uv pip install -r requirements.txt
225229
```
226230
227-
### Copy and rename env.example to .env
231+
### Duplicate `env.example` and rename one to `.env`
228232
I changed `REMOTE_INSTALL_HOST` from `debug.dify.ai` to `localhost`
229233
(Docker Compose environment)
230-
click bug icon button to see these information
231-
232-
### Change directory
233-
```
234-
cd mcp_client
235-
```
236-
237-
### Do Once
238-
```
239-
pip install -r requirements.txt
240-
```
234+
click 🪲bug icon button to see these information
241235
242236
### Activate Dify plugin
243237
```
@@ -249,7 +243,7 @@ python -m main
249243
> If you encounter error messages like `handshake failed, invalid key`, renew it.
250244
251245
### Package into .difypkg
252-
`./mcp_client` is my default root name
246+
`./dify-mcp-client` is my default root name
253247
```
254248
dify plugin package ./ROOT_OF_YOUR_PROJECT
255249
```
@@ -264,9 +258,9 @@ https://github.com/modelcontextprotocol/python-sdk
264258
<br>
265259
266260
> [!TIP]
267-
> Especially useful following MCP client example<br>
261+
> MCP client example<br>
268262
> https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/clients/simple-chatbot/mcp_simple_chatbot/main.py<br>
269263
270264
> [!NOTE]
271265
> Dify plugin has `requirements.txt` which automatically installs python modules.<br>
272-
> I include `mcp` in it, so you don't need to download the MCP SDK separately.
266+
> I include latest `mcp` in it, so you don't need to download the MCP SDK separately.

manifest.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.0.3
1+
version: 0.0.4
22
type: plugin
33
author: 3dify-project
44
name: mcp_client
@@ -37,7 +37,7 @@ plugins:
3737
agent_strategies:
3838
- provider/agent.yaml
3939
meta:
40-
version: 0.0.3
40+
version: 0.0.4
4141
arch:
4242
- amd64
4343
- arm64

requirements.txt

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,2 @@
1-
annotated-types==0.7.0
2-
anyio==4.8.0
3-
blinker==1.9.0
4-
certifi==2025.1.31
5-
cffi==1.17.1
6-
charset-normalizer==3.4.1
7-
click==8.1.8
8-
colorama==0.4.6
9-
dify-plugin==0.0.1b72
10-
dpkt==1.9.8
11-
flask==3.0.3
12-
gevent==24.11.1
13-
greenlet==3.1.1
14-
h11==0.14.0
15-
httpcore==1.0.7
16-
httpx==0.27.2
17-
httpx-sse==0.4.0
18-
idna==3.10
19-
itsdangerous==2.2.0
20-
jinja2==3.1.6
21-
markupsafe==3.0.2
22-
mcp==1.1.3
23-
multidict==6.1.0
24-
pycparser==2.22
25-
pydantic==2.8.2
26-
pydantic-core==2.20.1
27-
pydantic-settings==2.3.4
28-
pydub==0.25.1
29-
python-dotenv==1.0.1
30-
pyyaml==6.0.2
31-
regex==2024.11.6
32-
requests==2.32.3
33-
setuptools==75.8.2
34-
sniffio==1.3.1
35-
socksio==1.0.0
36-
sse-starlette==2.2.1
37-
starlette==0.46.0
38-
tiktoken==0.8.0
39-
typing-extensions==4.12.2
40-
urllib3==2.3.0
41-
uvicorn==0.34.0
42-
werkzeug==3.0.3
43-
yarl==1.9.11
44-
zope-event==5.0
45-
zope-interface==7.2
1+
dify_plugin==0.1.0
2+
mcp>=1.6.0

0 commit comments

Comments
 (0)