Dify.ai Workflow MCP server

Integrates with Dify.ai's workflow applications by transforming Dify workflows into dynamically discoverable tools with parameter validation and response formatting capabilities.
Back to servers
Provider
Teddy Lee
Release date
Mar 18, 2025
Language
Python
Stats
1 star

The Dify MCP Server provides a simple implementation of a Model Context Protocol server that allows you to invoke Dify workflows through MCP tools. This enables your AI assistants to utilize Dify's capabilities within any MCP-compatible client.

Installation Options

You can install the Dify MCP Server either via Smithery (recommended) or manually. Both methods require preparing a configuration file first.

Preparing the Configuration File

Before installation, create a config.yaml file with your Dify base URL and application secret keys:

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

Each secret key (SK) corresponds to a different Dify workflow that your MCP server can invoke.

Installing via Smithery

The easiest installation method is using Smithery, which automates the setup process:

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

This command installs the Dify MCP Server configured for Claude Desktop.

Manual Installation

For manual installation, you'll need to configure your MCP-compatible client with the server settings:

  1. Locate or create your client's configuration file
  2. Add an MCP server entry with 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"
    }
  }
}

Replace ${DIFY_MCP_SERVER_PATH} with the actual path to where you've placed the server files, and $CONFIG_PATH with the path to your config.yaml file.

Usage

After installation, the Dify MCP Server will be available in any MCP-compatible client. You can then use Dify tools seamlessly within your conversations with AI assistants.

The server automatically handles the communication between your MCP client and the Dify API, allowing the AI to invoke workflows defined in your Dify account using the secret keys you provided in the configuration.

No additional setup is required - simply start your MCP-compatible client, and the Dify tools should be available for use in your conversations.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later