Content
# Dify Workflows MCP Server (TypeScript)
A TypeScript implementation of a Model Context Protocol (MCP) server that exposes Dify workflows as tools.
## Features
- Converts Dify applications into MCP tools
- Supports streaming responses from Dify workflows (to be implemented)
- Configurable via YAML configuration files
- Written in TypeScript with type safety
## Prerequisites
- Node.js version 18 or higher
- npm version 8 or higher
- Access to Dify API and application keys
## Installation
1. Clone the repository:
```bash
git clone https://github.com/localSummer/dify-workflow-mcp
cd dify-workflow-mcp
```
2. Install dependencies:
```bash
npm install
```
3. Create a configuration file:
```yaml
# config.yaml
dify_base_url: 'https://api.dify.ai/v1'
dify_app_sks:
- 'your-dify-app-sk-1' # Replace with your actual Dify application key
- 'your-dify-app-sk-2' # Replace with your actual Dify application key
```
## Usage
1. Build the project:
```bash
npm run build
```
2. Start the server:
```bash
npm start
```
Development environment:
```bash
npm run dev
```
## Configuration
The server can be configured using a YAML file. By default, it looks for `config.yaml` in the project root directory. You can specify a different path using the `CONFIG_PATH` environment variable.
### Configuration Options
- `dify_base_url`: Base URL for the Dify API
- `dify_app_sks`: List of Dify application keys
## Cline/Roo Code Configuration
```json
"dify-workflow-mcp": {
"command": "node",
"args": [
"path/dify-workflow-mcp/build/index.js"
],
"env": {
"CONFIG_PATH": "path/dify-workflow-mcp/config.yaml"
},
"disabled": false,
"alwaysAllow": [],
"timeout": 300
}
```
## Notes
- The current response mode used for running workflows is: `response_mode: 'blocking'`, which will wait for the workflow to complete before outputting the final result.
- The current workflow output fields are: `code` and `checkResult`. If the output fields are inconsistent, you need to adjust the following code:
```ts
const { code, checkResult } = responseData.data.outputs;
```
## License
ISC
Connection Info
You Might Also Like
MarkItDown MCP
Converting files and office documents to Markdown.
Time
Obtaining current time information and converting time between different...
Filesystem
Model Context Protocol Servers
Sequential Thinking
Offers a structured approach to dynamic and reflective problem-solving,...
Git
Model Context Protocol Servers
Context 7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors