dify-server logo

dify-server

by AI-FE

dify-server is an MCP server that integrates the Dify AI API to provide code generation capabilities for Ant Design business components. It demonstrates core MCP concepts like chat completion, text and image input support, and streaming response handling.

View on GitHub

Last updated: N/A

What is dify-server?

dify-server is a Model Context Protocol (MCP) server built with TypeScript that integrates the Dify AI API. It enables the generation of Ant Design business component code by leveraging the Dify AI API for chat completion and supporting both text and image inputs.

How to use dify-server?

To integrate dify-server, you need to configure it within Continue or Cline. For Continue, add the server configuration to ~/.continue/config.json. For Cline, add it to your/path/cline_mcp_settings.json. Ensure you set the DIFY_API_KEY environment variable. You can debug using the MCP Inspector.

Key features of dify-server

  • Integrates Dify AI API for chat completion

  • Supports text and image input

  • Provides streaming response handling

  • Generates Ant Design business component code

Use cases of dify-server

  • Generating Ant Design component code from textual descriptions

  • Creating UI components based on image inputs

  • Integrating AI-powered code generation into development workflows

  • Rapid prototyping of Ant Design based applications

FAQ from dify-server

What is the purpose of DIFY_API_KEY?

The DIFY_API_KEY is used to authenticate your server with the Dify AI API, allowing it to access the necessary functionalities for code generation.

Can I use this server with other UI frameworks besides Ant Design?

Currently, the server is specifically designed to generate Ant Design components. Support for other frameworks may be added in the future.

What kind of image formats are supported?

The server can handle common image formats like JPEG, PNG, and GIF. Ensure that the image is properly encoded and accessible to the server.

How do I handle errors and exceptions during code generation?

The server provides error messages and logging to help you identify and resolve issues. You can also use the MCP Inspector for debugging and inspecting the communication between the server and the client.

Is the server compatible with different versions of Dify AI API?

The server is designed to be compatible with the latest version of the Dify AI API. It's recommended to keep both the server and the API updated to ensure optimal performance and compatibility.