Dify Workflow MCP server

Connects Claude with Dify Workflow to expose workflow capabilities as tools, enabling structured automation through dynamic parameter retrieval and multi-workflow support.
Back to servers
Provider
Tomoki Ishimine
Release date
Mar 29, 2025
Language
TypeScript
Package
Stats
664 downloads
5 stars

The Dify Workflow MCP Tool Server enables seamless integration between Claude AI and Dify Workflow using the Model Context Protocol (MCP). This server acts as a bridge, allowing Claude to utilize Dify Workflow capabilities through bidirectional communication.

Requirements

  • Node.js 16 or higher
  • npm 7 or higher
  • Dify Workflow API key

Installation

The Dify Workflow MCP Tool Server can be easily integrated with the Claude Desktop App by modifying Claude's configuration file. There's no need for manual installation as the server runs directly through npx.

Configuration for Windows

Edit Claude's configuration file located at %AppData%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "dify-workflow": {
      "command": "npx",
      "args": ["@tonlab/dify-mcp-server"],
      "env": {
        "DIFY_BASE_URL": "https://your-dify-endpoint",
        "DIFY_API_KEY": "your-api-key-here"
      }
    }
  }
}

Configuration for macOS/Linux

Edit Claude's configuration file located at ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "dify-workflow": {
      "command": "npx",
      "args": ["@tonlab/dify-mcp-server"],
      "env": {
        "DIFY_BASE_URL": "https://your-dify-endpoint",
        "DIFY_API_KEY": "your-api-key-here"
      }
    }
  }
}

Usage

Basic Configuration

The server requires two environment variables:

  • DIFY_BASE_URL: The URL of your Dify API endpoint
  • DIFY_API_KEY: Your Dify API key

Using Multiple API Keys

You can configure multiple Dify API keys, which will create multiple tools (one per API key):

{
  "mcpServers": {
    "dify": {
      "command": "npx",
      "args": ["@tonlab/dify-mcp-server"],
      "env": {
        "DIFY_BASE_URL": "https://api.dify.ai/v1",
        "DIFY_API_KEYS": "app-FirstAPIKeyHere,app-SecondAPIKeyHere,app-ThirdAPIKeyHere"
      }
    }
  }
}

With this configuration:

  • Each API key will be exposed as a separate tool in Claude
  • Each tool will have a distinct number appended to its name
  • Claude can then access different Dify Workflow applications using the appropriate tool

Once configured, restart the Claude Desktop App. The Dify Workflow tool(s) will appear in Claude's available tools list, enabling direct interaction with your Dify workflows.

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