Home / MCP / Dify MCP Server

Dify MCP Server

Provides an MCP server that integrates Dify AI API for generating Ant Design component code via text and image inputs with streaming responses.

typescript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "dify_server": {
            "command": "node",
            "args": [
                "your/path/dify-server/build/index.js"
            ],
            "env": {
                "DIFY_API_KEY": "***"
            }
        }
    }
}

You are running a TypeScript MCP server that integrates Dify AI API to generate Ant Design business components. It accepts text and image inputs, supports streaming responses, and is designed to be used by MCP clients to quickly produce UI code from conversational prompts.

How to use

Run the MCP server as a local stdio process and connect your MCP client to it. You will provide your Dify API key as an environment variable. Your client can send text prompts (and optionally images) to generate Ant Design component code, receiving streaming responses as the server processes the request.

How to install

Prerequisites you need before installation: Node.js (supported version aligns with the project setup) and npm.

Install dependencies for the MCP server and set up for development.

npm install

Start development with automatic rebuilding when files change.

npm run watch

Build the server for production use.

npm run build

Additional configuration and troubleshooting

Configure how the MCP server is integrated into your environment. You can use either stdio-based local integration or an http-based remote method if you have a remote MCP endpoint.

If you use a local stdio integration, you must launch the server with Node and point to the built index.

Debugging MCP connections can be challenging because communication happens over standard input and output. You can enable an inspector to help diagnose issues.

npm run inspector

Available tools

antd-component-codegen-mcp-tool

Generates Ant Design business component code from prompts. Supports text and optional image input, handles image uploads, and streams responses from the Dify AI API.