Back to MCP directory
publicPublicdnsLocal runtime

mcp-difyworkflow-server

一个支持查询和调用Dify工作流的MCP服务工具

article

README

🚀 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 命令
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".

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client