MCP HubMCP Hub
gotoolkits

mcp-difyworkflow-server

by: gotoolkits

mcp-difyworkflow-server is an mcp server Tools application that implements the query and invocation of Dify workflows, supporting the on-demand operation of multiple custom Dify workflows.

40created 26/12/2024
Visit
Dify
workflow

📌Overview

Purpose: This framework serves as an MCP server application to efficiently manage and invoke Dify workflows on demand.

Overview: The mcp-difyworkflow-server application facilitates the querying and execution of multiple custom Dify workflows, enhancing user interaction with the Dify platform through a straightforward command interface.

Key Features:

  • Workflow Management: Provides functionality to list authorized workflows and execute specific ones, streamlining the workflow management process.

  • Customizability: Users can define their own workflow names and must provide corresponding API keys, allowing for flexible integration with Dify platform services.


mcp-difyworkflow-server

mcp-difyworkflow-server is an MCP server tool application that implements the query and invocation of Dify workflows, supporting on-demand operation of multiple custom Dify workflows.

INSTALL

git clone https://github.com/gotoolkis/mcp-difyworkflow-server.git

# build by go
cd mcp-difyworkflow-server
go build .

# or use make build
make build

Configuration

{
  "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-xxxxxxxxxxxa,appkey-xxxxxxxxxxxb"
      }
    }
  }
}
  • base-url: "http://localhost/v1"

    The base URL of the Dify platform API server.

  • command: "mcp-difyworkflow-server"

    You can specify the absolute path for the compiled binary or create a symbolic link with:
    sudo ln -s <gitWorkPath>/mcp-difyworkflow-server /usr/local/bin/mcp-difyworkflow-server

  • DIFY_WORKFLOW_NAME and DIFY_API_KEYS

    These values correspond one-to-one in order.
    Workflow names can be user-defined in the prompt, and the workflow API keys need to be generated for the corresponding workflows created on the Dify platform (refer to Dify documentation for generating API keys).

Usage

  • list_workflows
    List authorized workflows.

  • execute_workflow
    Execute a specified workflow. Arguments: workflow_name, input.
    Note: The input variable name for the Dify workflow should be defined as "message" by default.

Samples

Prompt examples:

  • 查看 mcp-difyworkflow-server 可使用的工具列表

  • 给我执行 dify 名为 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".