Skip to main content
Glama

Dify Server

Model Context Protocol (MCP) Server for dify workflows

A simple implementation of an MCP server for using dify. It achieves the invocation of the Dify workflow by calling the tools of MCP.

📰 News

  • [2025/4/15] zNow supports directly using environment variables to pass base_url and app_sks, making it more convenient to use with cloud-hosted platforms.

🔨Installation

The server can be installed via Smithery or manually.

Step1: prepare config.yaml or enviroments

You can configure the server using either environment variables or a config.yaml file.

Set the following environment variables:

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: The base URL for your Dify API.
  • DIFY_APP_SKS: A comma-separated list of your Dify App Secret Keys (SKs). Each SK typically corresponds to a different Dify workflow you want to make available via MCP.
Method 2: Using config.yaml

Create a config.yaml file to store your Dify base URL and App SKs.

Example 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: The base URL for your Dify API.
  • dify_app_sks: A list of your Dify App Secret Keys (SKs). Each SK typically corresponds to a different Dify workflow.

You can create this file quickly using the following command (adjust the path and values as needed):

# 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"

When running the server (as shown in Step 2), you will need to provide the path to this config.yaml file via the CONFIG_PATH environment variable if you choose this method.

Step2: Installation on your client

❓ If you haven't installed uv or uvx yet, you can do it quickly with the following command:

curl -Ls https://astral.sh/uv/install.sh | sh
{ "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", } } } }

or

{ "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" } } } }
✅ Method 2: Use uv (local clone + uv start)

You can also run the dify mcp server manually in your clients. The config of client should like the following format:

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

or

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

Example config:

{ "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", } } } }

Enjoy it

At last, you can use dify tools in any client who supports mcp.

-
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 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 -
      170
    • -
      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 -
      35
    • -
      security
      F
      license
      -
      quality
      A server implementation that enables integration of Dify workflows with Model Context Protocol (MCP), allowing users to access Dify's capabilities through MCP-compatible clients.
      Last updated -
      2
    • A
      security
      A
      license
      A
      quality
      A TypeScript-based server that connects MCP Clients to Dify applications, dynamically exposing Dify applications as tools that can be used directly within the MCP Client.
      Last updated -
      4
      MIT License

    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