P

dify-mcp-server

...
Created 12/25/2024byYanxingLiu

Language:

Python

Stars:

182

Forks:

23

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.

đŸ”¨Installation

The server can be installed via Smithery or manually. Config.yaml is required for both methods. Thus, we need to prepare it before installation.

Prepare config.yaml

Before using the mcp server, you should prepare a config.yaml to save your dify_base_url and dify_sks. The example config like this:

dify_base_url: "https://cloud.dify.ai/v1"
dify_app_sks:
  - "app-sk1"
  - "app-sk2"

Different SKs correspond to different dify workflows.

Installing via Smithery

smithery is a tool to install the dify mcp server automatically. To install Dify MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install dify-mcp-server --client claude

Manual Installation

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

Example config:

"mcpServers": {
  "dify-mcp-server": {
    "command": "uv",
      "args": [
        "--directory", "/Users/lyx/Downloads/dify-mcp-server",
        "run", "dify_mcp_server"
      ],
    "env": {
       "CONFIG_PATH": "/Users/lyx/Downloads/config.yaml"
    }
  }
}

or using uvx:

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

Enjoy it

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

Last updated: 3/28/2025

Publisher info

YanxingLiu's avatar

YanxingLiu

A PhD student at UCAS

University of Chinese Academy of Sciences
Beijing
45
followers
143
following
63
repos

More MCP servers built with Python

apollo-io-mcp-server

MCP server that exposes the Apollo.io API functionalities as tools

By Edward Choh
mcp-openvision

MCP Server using OpenRouter models to get descriptions for images

By Nazruden2
DeepView MCP

Enables IDEs like Cursor and Windsurf to analyze large codebases using Gemini's extensive context window.

By ai-1st