Deploy Dify Docs MCP Service and Chat with Documentation
Learn how to deploy a local documentation MCP server and chat with documentation using AI.
Model Context Protocol (MCP) is an open standard developed by Anthropic. It provides standardized interfaces for AI models to interact with external tools and data sources. AI models can access software tools and data through this protocol.
This guide shows how to deploy a local MCP server using the dify-docs repository. This enables natural conversations between LLMs and documentation.
For detailed information about the MCP protocol, please refer to Model Context Protocol.
Prerequisites
- Node ≥ 16.0
- Git
- MCP client (such as Claude Desktop, VS Code, etc.)
Installation Steps
1. Clone Repository
Clone the Dify documentation repository locally:
This repository serves as the data source for the MCP server.
2. Initialize MCP Server
Navigate to the documentation directory and install the MCP server:
This command performs the following operations:
- Creates a local MCP server instance
- Analyzes and indexes documentation content
- Configures necessary dependencies
Installation takes a few minutes, depending on your network connection.
3. Configure MCP Server
MCP Client and Server Relationship:
MCP servers provide knowledge and tools. They handle query requests, manage data resources, and execute functions. Clients are user interfaces—typically AI applications or chat tools. They receive user questions, forward queries to MCP servers, and return integrated responses.
During installation, you’ll select an MCP client. Using Claude Desktop as an example, the tool generates the corresponding configuration information.
After installation completes, add the MCP server in Claude Desktop settings. Go to settings, add the server address and port in the MCP server configuration section, save the configuration, and restart the application.
Conversing with Documentation
Once configured, you can have conversations with Dify documentation. This supports natural language queries—no need to search page by page or match keywords precisely.
For example, ask “I want to create a customer service chatbot—should I choose Workflow or Chatflow?”. The system explains the differences between both options and provides recommendations for customer service scenarios.
For technical questions like “How do I modify the Dify port number?”, the AI provides specific steps:
The MCP approach lets you describe problems in natural language. Even when you’re unsure about specific technical terms, you can describe what you want to achieve and get relevant information.
Comparison with RAG Methods
Feature | RAG (Retrieval Augmented Generation) | MCP (Model Context Protocol) |
---|---|---|
Principle | Splits documents into text chunks and builds indexes using vector embeddings. When users ask questions, the system calculates similarity between questions and text chunks, then selects relevant chunks as context for generating answers. | AI actively generates query strategies based on question requirements. Supports multi-round interactive queries and adjusts subsequent searches based on initial results. |
Advantages | Fast processing speed, suitable for large-scale static documents. | - Can access complete document content, supports cross-chapter complex queries - No complex reprocessing after document updates—simply regenerate MCP service - Provides coherent and complete answers |
Limitations | - Static document splitting may fragment related information - Vector similarity-based retrieval may miss semantically related but lexically different content - Context window limitations—only generates answers based on specific chnks | - Requires significant token consumption, higher cost - Relies on LLM’s query strategy generation capability, may affect retrieval accuracy - Multi-round interactive queries may lead to longer response times - Requires additional MCP server deployment and maintenance costs |