Dify as MCP Server logo

Dify as MCP Server

by MCP-Mirror

This project implements a Dify plugin to expose Dify workflows as a Model Context Protocol (MCP) server for AI clients like Claude. It allows AI clients to discover and use your Dify workflows as tools.

View on GitHub

Last updated: N/A

What is Dify as MCP Server?

This is a Dify plugin that exposes Dify workflows as a Model Context Protocol (MCP) server. It allows AI clients supporting MCP, such as Claude Desktop and Cursor, to access and utilize Dify workflows as tools.

How to use Dify as MCP Server?

  1. Configure your Dify application with at least one workflow. 2. In the AI client (e.g., Claude, Cursor), add a new MCP server with the URL https://your_dify_instance_address/difyapp_as_mcp_server. 3. Save and enable the server in the client settings. Then you can use your tools in the AI client.

Key features of Dify as MCP Server

  • Supports MCP standard JSON-RPC interface

  • Automatic tool discovery and registration

  • Compatible with Claude Desktop/Cursor

  • Secure SSE connection implementation

  • Server-side session management

  • Compliant with the latest MCP Streamable HTTP specification

Use cases of Dify as MCP Server

  • Providing Dify workflows as tools to Claude and other AI clients

  • Enabling AI clients to discover and use your workflows

  • Integrating Dify workflows into AI assistants without modifying the workflows

  • Exposing Dify workflows to other applications supporting MCP

FAQ from Dify as MCP Server

What if I have connection problems?

Ensure the URL is correct and accessible. Check for firewalls or proxies that might be blocking the connection.

What if the tools are not visible in the client?

Make sure the application ID is configured correctly. Verify that the workflow is published and that the Dify API key has sufficient permissions.

What if the tool execution fails?

Check the Dify application logs and confirm that the workflow can run normally within Dify.

What is Model Context Protocol (MCP)?

Model Context Protocol (MCP) is an open standard that allows AI models to interact with external tools and data sources.

What is Streamable HTTP?

Streamable HTTP is a new transport mode for MCP that provides better support for stateless servers by standardizing message formats and stream processing.