mcp-difyworkflow-server
mcp-difyworkflow-server 是一个 MCP 服务器工具应用程序,实现了 Dify 工作流的查询和调用功能,支持多个自定义 Dify 工作流的按需运行。
安装
git clone https://github.com/gotoolkis/mcp-difyworkflow-server.git
# 使用 Go 编译构建
cd mcp-difyworkflow-server
go build .
#
make build
配置
{
"mcpServers": {
"mcp-difyworkflow-server": {
"command": "mcp-difyworkflow-server",
"args": ["-base-url", "http://localhost/v1"],
"env": {
"DIFY_WORKFLOW_NAME": "workflow-translator,workflow-genImag",
"DIFY_API_KEYS": "appkey-xxxxxxxxxxxxa,appkey-xxxxxxxxxxxxb"
}
}
}
}
-
"base-url":"http://localhost/v1"
Dify 平台 API 服务器的基础 URL。
-
"command":"mcp-difyworkflow-server"
可以指定编译好的二进制文件的绝对路径,或者通过以下命令创建符号链接:
"sudo ln -s <gitWorkPath>/mcp-difyworkflow-server /usr/local/bin/mcp-difyworkflow-server"
-
DIFY_WORKFLOW_NAME、DIFY_API_KEYS
需要一一对应,按顺序排列。
工作流名称可以由用户在提示中自定义定义,而工作流 API 密钥需要为在 Dify 平台上创建的相应工作流生成(参考相关的 Dify 文档以获取如何生成 API KEY 的方法)。
使用
- list_workflows
列出授权的工作流
- execute_workflow
执行指定的工作流,参数:workflow_name, input
注意:dify 工作流的输入变量名应默认定义为:"message"
示例
提示: 查看 mcp-difyworkflow-server 可使用的工具列表
提示: 给我执行名为 workflow-translator 的工作流,输入的消息为“这是一条测试消息”
提示: View the list of tools available for mcp-difyworkflow-server.
提示: Execute the workflow named 'workflow-translator' for me, the input message is "This is a test message".