The mcp-difyworkflow-server provides a way to integrate and interact with Dify workflows through the Model Context Protocol (MCP). It allows you to query and invoke multiple custom Dify workflows on demand, serving as a bridge between your applications and the Dify platform.
You can install the mcp-difyworkflow-server by following these steps:
# Clone the repository
git clone https://github.com/gotoolkis/mcp-difyworkflow-server.git
# Navigate to the project directory
cd mcp-difyworkflow-server
# Build using Go
go build .
# Alternatively, use make to build
make build
The server requires proper configuration to connect with your Dify workflows. Create a configuration file with the following structure:
{
"mcpServers": {
"mcp-difyworkflow-server": {
"command": "mcp-difyworkflow-server",
"args": ["-base-url", "http://localhost/v1"],
"env": {
"DIFY_WORKFLOW_NAME": "workflow-translator,workflow-genImage",
"DIFY_API_KEYS": "appkey-xxxxxxxxxxxa,appkey-xxxxxxxxxxxb"
}
}
}
}
base-url: The base URL of your Dify platform API server
command: The command to execute the server binary
sudo ln -s <gitWorkPath>/mcp-difyworkflow-server /usr/local/bin/mcp-difyworkflow-server
DIFY_WORKFLOW_NAME and DIFY_API_KEYS:
The mcp-difyworkflow-server provides two main functions:
workflow_name
, input
"message"
You can interact with the server using prompts like:
查看 mcp-difyworkflow-server 可使用的工具列表
This will list all available workflows.
给我执行 dify 名为 workflow-translator 的工作流,输入的消息为"这是一条测试消息"
This will execute the "workflow-translator" workflow with the message "这是一条测试消息".
In English:
View the list of tools available for mcp-difyworkflow-server.
Execute the workflow named 'workflow-translator' for me, the input message is "This is a test message".
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.
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"
]
}
}
}
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.
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.