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.
You can install the Dify MCP Server either via Smithery (recommended) or manually. Both methods require preparing a configuration file first.
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.
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.
For manual installation, you'll need to configure your MCP-compatible client with the server settings:
"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.
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.
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.