dify
MCP server from zhuzhoulin/dify-mcp-server
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:
- Clone the repository
git clone https://github.com/zhuzhoulin/dify-mcp-server.git
cd dify-mcp-server
- Install dependencies
npm install
- Build the project
npm run build
- 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
- 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
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.