Skip to main content
Glama

Dify Server

用于 dify 工作流的模型上下文协议 (MCP) 服务器

一个使用dify 的MCP 服务器的简单实现,通过调用 MCP 的工具来实现对 Dify 工作流的调用。

📰 新闻

  • [2025/4/15] zNow 支持直接使用环境变量传递base_urlapp_sks ,更加方便与云托管平台一起使用。

🔨安装

该服务器可以通过Smithery或手动安装。

步骤1:准备config.yaml或环境

您可以使用环境变量或config.yaml文件配置服务器。

方法一:使用环境变量(云平台推荐)

设置以下环境变量:

export DIFY_BASE_URL="https://cloud.dify.ai/v1" export DIFY_APP_SKS="app-sk1,app-sk2" # Comma-separated list of your Dify App SKs
  • DIFY_BASE_URL :您的 Dify API 的基本 URL。
  • DIFY_APP_SKS :以逗号分隔的 Dify 应用密钥 (SK) 列表。每个 SK 通常对应一个您希望通过 MCP 提供的 Dify 工作流程。
方法二:使用config.yaml

创建一个config.yaml文件来存储您的 Dify 基本 URL 和 App SK。

示例config.yaml

dify_base_url: "https://cloud.dify.ai/v1" dify_app_sks: - "app-sk1" # SK for workflow 1 - "app-sk2" # SK for workflow 2 # Add more SKs as needed
  • dify_base_url :Dify API 的基本 URL。
  • dify_app_sks :您的 Dify 应用密钥 (SK) 列表。每个 SK 通常对应不同的 Dify 工作流程。

您可以使用以下命令快速创建此文件(根据需要调整路径和值):

# Create a directory if it doesn't exist mkdir -p ~/.config/dify-mcp-server # Create the config file cat > ~/.config/dify-mcp-server/config.yaml <<EOF dify_base_url: "https://cloud.dify.ai/v1" dify_app_sks: - "app-your-sk-1" - "app-your-sk-2" EOF echo "Configuration file created at ~/.config/dify-mcp-server/config.yaml"

运行服务器时(如步骤 2 所示),如果选择此方法,则需要通过CONFIG_PATH环境变量提供此config.yaml文件的路径。

步骤2:在客户端上安装

❓ 如果您尚未安装 uv 或 uvx,则可以使用以下命令快速安装:

curl -Ls https://astral.sh/uv/install.sh | sh
✅ 方法一:使用 uvx(无需 clone 代码,推荐)
{ "mcpServers": { "dify-mcp-server": { "command": "uvx", "args": [ "--from","git+https://github.com/YanxingLiu/dify-mcp-server","dify_mcp_server" ], "env": { "DIFY_BASE_URL": "https://cloud.dify.ai/v1", "DIFY_APP_SKS": "app-sk1,app-sk2", } } } }

或者

{ "mcpServers": { "dify-mcp-server": { "command": "uvx", "args": [ "--from","git+https://github.com/YanxingLiu/dify-mcp-server","dify_mcp_server" ], "env": { "CONFIG_PATH": "/Users/lyx/Downloads/config.yaml" } } } }
✅ 方法二:使用 uv(本地克隆+uv 启动)

您也可以在客户端手动运行 dify mcp 服务器。客户端的配置格式如下:

{ "mcpServers": { "mcp-server-rag-web-browser": { "command": "uv", "args": [ "--directory", "${DIFY_MCP_SERVER_PATH}", "run", "dify_mcp_server" ], "env": { "CONFIG_PATH": "$CONFIG_PATH" } } } }

或者

{ "mcpServers": { "mcp-server-rag-web-browser": { "command": "uv", "args": [ "--directory", "${DIFY_MCP_SERVER_PATH}", "run", "dify_mcp_server" ], "env": { "CONFIG_PATH": "$CONFIG_PATH" } } } }

示例配置:

{ "mcpServers": { "dify-mcp-server": { "command": "uv", "args": [ "--directory", "/Users/lyx/Downloads/dify-mcp-server", "run", "dify_mcp_server" ], "env": { "DIFY_BASE_URL": "https://cloud.dify.ai/v1", "DIFY_APP_SKS": "app-sk1,app-sk2", } } } }

好好享受

最后,您可以在任何支持 mcp 的客户端上使用 dify 工具。

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Dify使用服务器,通过调用 MCP 的工具实现 Dify 工作流的调用。

  1. 📰 新闻
    1. 🔨安装
      1. 步骤1:准备config.yaml或环境
      2. 步骤2:在客户端上安装
      3. 好好享受

    Related MCP Servers

    • -
      security
      F
      license
      -
      quality
      A TypeScript implementation of a Model Context Protocol (MCP) server that exposes Dify workflows as tools for AI systems to interact with.
      Last updated -
      16
      TypeScript
    • -
      security
      F
      license
      -
      quality
      A plugin that allows Dify to connect to multiple MCP (Model Control Protocol) servers using HTTP with Server-Sent Events transport, supporting custom configurations for URLs, headers, and timeouts.
      Last updated -
      124
      Python
    • -
      security
      F
      license
      -
      quality
      Exposes Dify applications (both Chatflow and Workflow) as MCP (Model Context Protocol) servers, allowing Claude and other MCP clients to directly interact with Dify apps through a standardized protocol.
      Last updated -
      18
      Python
    • -
      security
      F
      license
      -
      quality
      A Dify endpoint plugin that transforms a Dify application into a Model Control Protocol server, allowing tools like Cursor to connect to and utilize your custom Dify workflows.
      Last updated -
      38
      Python

    View all related MCP servers

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/YanxingLiu/dify-mcp-server'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server