Get the FREE Ultimate OpenClaw Setup Guide →

dify

MCP server from zhuzhoulin/dify-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio zhuzhoulin-dify-mcp-server node /path/to/dify-mcp-server/build/index.js \
  --env TIMEOUT="60000" \
  --env BASE_URL="https://api.dify.ai" \
  --env AGENT_API_KEYS="your_api_key1,your_api_key2"

How to use

Dify MCP Server exposes multiple Dify applications as MCP tools that can be used directly from the MCP Client. After starting the server, it connects to the specified Dify instances using the provided API keys, fetches application metadata and parameter specifications, and dynamically generates MCP tool interfaces for each Dify application. Each Dify app is exposed as a distinct tool named in the format: dify_app_info_{application_name}. These tools can be browsed and invoked from the MCP Client, enabling you to supply inputs (text, paragraphs, select options, etc.) and receive structured outputs from the corresponding Dify application. The server supports both blocking and streaming response modes and includes robust error handling and JSON BigInt support for large numeric values. To use it inside Windsurf IDE or any MCP-compatible client, configure the MCP server as shown in the integration example, ensuring your environment variables (API keys, base URL, and timeout) are set correctly. Once configured, the MCP client will present the dynamically created tools for each Dify application and route user requests to the Dify APIs via the MCP server.

How to install

Prerequisites:

  • Node.js v16 or higher
  • npm or yarn

Setup steps:

  1. Clone the repository
git clone https://github.com/zhuzhoulin/dify-mcp-server.git
cd dify-mcp-server
  1. Install dependencies
npm install
  1. Build the project
npm run build
  1. Run the server (example)
# Ensure you have environment variables set or provide a .env file
export AGENT_API_KEYS=your_api_key1,your_api_key2
export BASE_URL=https://api.dify.ai
export TIMEOUT=60000
node build/index.js
  1. Integrate with Windsurf IDE or any MCP client by adding the server configuration as shown in the README integration snippet.

Additional notes

Tips and notes:

  • Ensure your AGENT_API_KEYS provide access to the Dify applications you want to expose.
  • The server reads BASE_URL and TIMEOUT from environment variables; adjust as needed for network environments with different latency.
  • Each Dify application is exposed as a tool named dify_app_info_{application_name}. If an application cannot be loaded, check the Dify API permissions and the application’s accessibility.
  • When debugging, enable verbose logs in your MCP client or consult server logs for detailed error messages.
  • If running behind a proxy or in a restricted network, verify that outbound requests to the Dify API are allowed and that TLS certificates are trusted.
  • The server supports both blocking and streaming response modes; choose the mode that best fits your use case in the MCP client.

Related MCP Servers

Sponsor this space

Reach thousands of developers