YD

yanxingliu/dify-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

279 stars 39 forks 质量 55 趋势 18

yanxingliu/dify-mcp-server 是从 https://github.com/yanxingliu/dify-mcp-server. 导入的 MCP 服务器候选

概览

yanxingliu/dify-mcp-server 是从 https://github.com/yanxingliu/dify-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

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

📰 新闻

  • [2025/4/15] zNow 支持直接使用环境变量传递 base_url 和 app_sks,使得在云托管平台上使用更加便捷。

🔨安装

服务器可以通过 Smithery 安装,也可以手动安装。

步骤1:prepare config.yaml 或环境

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

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

设置以下环境变量:

  • DIFY_BASE_URL:你的Dify API的基础URL。
  • DIFY_APP_SKS:一个逗号分隔的Dify应用密钥(SKs)列表。每个SK通常对应你希望通过MCP提供的不同Dify工作流程。

####方法2:使用config.yaml

创建一个 config.yaml 文件来存储你的 Dify 基础 URL 和应用 SK。

示例 config.yaml:

  • dify_base_url:你的Dify API的基础URL。
  • dify_app_sks:您的 Dify 应用密钥(SKs)列表。每个 SK 通常对应不同的 Dify 工作流程。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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": {
在 GitHub 查看完整 README

安装

uvx --from git+https://github.com/YanxingLiu/dify-mcp-server dify_mcp_server
新手?先看 mcpskill.org 教程 →

配置

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