Install Dify in Claude Desktop
What you need first
- Claude Desktop, installed.
- uv, which
gives the
uvxcommand the server starts with. - Your own values for
YOUR_DIFY_API_BASE,YOUR_DIFY_API_KEY,YOUR_DIFY_ALLOWED_DATASETS.
Steps
- In Claude Desktop, open Settings › Developer and choose Edit Config. It opens
claude_desktop_config.json. - Add this block. If the file already has
mcpServers, add only the entry inside it.
{
"mcpServers": {
"dify-mcp": {
"command": "uvx",
"args": ["dify-mcp==0.1.0"],
"env": { "DIFY_API_BASE": "YOUR_DIFY_API_BASE", "DIFY_API_KEY": "YOUR_DIFY_API_KEY", "DIFY_ALLOWED_DATASETS": "YOUR_DIFY_ALLOWED_DATASETS" }
}
}
} - Replace
YOUR_DIFY_API_BASE,YOUR_DIFY_API_KEY,YOUR_DIFY_ALLOWED_DATASETSwith your own values. - Save the file, quit Claude Desktop completely and open it again.
Check it worked
Ask Claude Desktop: List the tools of dify-mcp.
If it does not start
- spawn uvx ENOENT
- uv is not on the PATH that Claude Desktop sees. Install it, or write the
full path of
uvxin the config. - The server starts, but its tools fail
- A
YOUR_…placeholder is still in the config, or its value is wrong. - Nothing changes after a restart
- The file is not valid JSON any more. Look for a missing comma where the block was added.