Get the FREE Ultimate OpenClaw Setup Guide →

dify -ts

MCP server from faiz-gear/dify-mcp-server-ts

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio faiz-gear-dify-mcp-server-ts node dist/server.js \
  --env CONFIG_PATH="Path to YAML config (default: ./config.yaml in project root)."

How to use

This MCP server translates Dify workflows into MCP tools, enabling you to invoke Dify applications as modular tools within the MCP ecosystem. It processes Dify-based workflows and streams responses back through the MCP protocol, allowing collaborative and interactive tool usage. The server is written in TypeScript for type safety and reads configuration from a YAML file to connect to Dify, including the base API URL and application secret keys. After building, you can run the server to expose your Dify workflows as MCP-compatible tools that can be discovered and invoked by MCP clients.

How to install

Prerequisites:

  • Node.js 18 or higher
  • npm 8 or higher
  • Access to Dify API and application secret keys

Installation steps:

  1. (Optional) Install via Smithery (automatic setup for specific clients): npx -y @smithery/cli install @faiz-gear/dify-mcp-server-ts --client claude

  2. Clone the repository: git clone <repository-url> cd dify-mcp-server-ts

  3. Install dependencies: npm install

  4. Create a configuration file (config.yaml) in the project root with Dify settings:

    config.yaml

    dify_base_url: 'https://api.dify.ai/v1' dify_app_sks:

    • 'your-dify-app-sk-1' # Replace with your actual Dify app secret key
    • 'your-dify-app-sk-2' # Replace with your actual Dify app secret key
  5. Build and run: npm run build npm start

Development mode: npm run dev

Additional notes

Notes:

  • The server expects a YAML configuration file (config.yaml by default) with dify_base_url and dify_app_sks. You can override the path using the CONFIG_PATH environment variable.
  • Ensure your Dify API keys are kept secure and not committed to version control.
  • If you encounter streaming issues with Dify workflows, verify that your environment supports streaming responses and that the MCP client can handle streaming data.
  • The npm package name for this server is @faiz-gear/dify-mcp-server-ts. If you customize or fork it, update the mcp_config and npm_package fields accordingly.

Related MCP Servers

Sponsor this space

Reach thousands of developers