Get the FREE Ultimate OpenClaw Setup Guide →

dify

A Model Context Protocol server for Dify

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ai-fe-dify-mcp-server node your/path/dify-server/build/index.js \
  --env DIFY_API_KEY="***"

How to use

This MCP server integrates the Dify AI API to provide Ant Design component code generation capabilities through the Model Context Protocol (MCP). It accepts text prompts (and optional image inputs) and streams responses as the code for Ant Design business components is generated. The server enables chat-style interactions with the Dify AI model to refine and iterate on the generated code, with support for uploading images to inform the component design. The core tool exposed by this server is the antd-component-codegen-mcp-tool, which orchestrates the prompt handling, file uploads, and streaming of code results. To use it, you connect a client through MCP’s stdio interface, send a request, and receive a streaming response that progressively yields the generated code. The system is designed to work well in environments where you want live, interactive generation of UI components based on natural language descriptions and optional visual references.

How to install

Prerequisites:

  • Node.js (LTS) installed
  • npm installed

Installation steps:

  1. Clone or download the repository for the dify MCP server
  2. Install dependencies npm install
  3. (Optional) Run in development watch mode for automatic rebuilds npm run watch
  4. Build the server for production or deployment npm run build
  5. Run the server (example, adjust paths as needed) node build/index.js

Notes:

  • Ensure you have a valid DIFY_API_KEY for integration with the Dify AI API and place it in the environment or config as required by the server setup.
  • The server communicates via stdio when run in certain environments; verify your client is configured to connect via stdin/stdout as documented in MCP tooling.

Additional notes

Tips and common considerations:

  • Set DIFY_API_KEY in the environment where the MCP server runs to enable access to Dify AI capabilities.
  • The antd-component-codegen-mcp-tool supports text prompts and optional image inputs; use image inputs to influence component styling and structure when applicable.
  • Streaming responses allow you to display partial code as it is generated, improving perceived latency.
  • Debugging MCP servers can be challenging due to stdio communication; consider using MCP Inspector for browser-based debugging and to inspect message sequences.
  • If integrating with Continue or Cline configurations, mirror the env and args shown in the README to ensure consistent behavior across environments.

Related MCP Servers

Sponsor this space

Reach thousands of developers