A TypeScript-based server that connects MCP Clients to Dify applications, dynamically exposing Dify applications as tools that can be used directly within the MCP Client.
A TypeScript-based MCP (Model Context Protocol) server that connects the MCP Client to Dify applications. This server dynamically exposes Dify applications as tools that can be used directly within the MCP Client.
This server implements the Model Context Protocol to bridge between MCP Client and Dify applications. It dynamically fetches application specifications from Dify APIs and exposes them as MCP tools. The server allows users to interact with multiple Dify applications through a unified interface within the MCP Client.
git clone https://github.com/zhuzhoulin/dify-mcp-server.git cd dify-mcp-server
npm install
npm run build
To use with Windsurf IDE, add the server config to your MCP settings:
{ "mcpServers": { "dify-mcp-server": { "command": "node", "args": [ "/path/to/dify-mcp-server/build/index.js" ], "env": { "AGENT_API_KEYS": "key1,key2,key3", "BASE_URL": "https://api.dify.ai", "TIMEOUT": "60000" } } } }
AGENT_API_KEYS
: Comma-separated list of Dify API keysBASE_URL
: Base URL for Dify API(default:https://api.dify.ai)TIMEOUT
: Request timeout in milliseconds (default: 60000)API密钥(AGENT_API_KEYS): 多个以,分割
Once configured, the Dify MCP Server will:
Each Dify application will be exposed as a separate tool with a name format of dify_app_info_{application_name}
.
npm run build
: Build the projectnpm run prepare
: Prepare the project for distributionnpm run watch
: Watch for changes and rebuildnpm run inspector
: Run the MCP inspector for debuggingsrc/index.ts
: Main server implementationsrc/request.ts
: HTTP client for Dify API communicationsrc/type.ts
: TypeScript interfaces for Dify APIIf you encounter issues:
This project is licensed under the terms specified in the LICENSE file.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!