View Categories

Dify에서 MCP 클라이언트 역할을 수행하도록 MCP 서버를 연결하는 방법

1. MCP SSE 플러그인 설치 #

먼저 Dify 플러그인 마켓플레이스에서 MCP SSE 플러그인을 설치해야 합니다:

  • Dify 플러그인 마켓플레이스로 이동
  • “MCP SSE” 플러그인 검색 후 설치
  • 안정성을 위해 v0.0.4 버전 사용 권장

2. MCP 서버 URL 설정 #

플러그인 설치 후 MCP 서버에 연결하는 방법:

Agent에서 사용하는 경우: #

  1. 플러그인 페이지에서 “To Authorize” 버튼 클릭
  2. MCP 서버 URL을 다음 JSON 형식으로 입력:

json

{
  "server_name": {
    "url": "https://your-mcp-server-url/sse",
    "headers": {},
    "timeout": 5,
    "sse_read_timeout": 300
  }
}

Workflow에서 사용하는 경우: #

  1. Agent 노드에서 MCP Agent Strategy 플러그인 구성
  2. 위와 동일한 JSON 구조를 MCP SERVER URL 설정 박스에 입력

3. 구체적인 연결 예시 #

Zapier MCP 서버 연결: #

json

{
  "zapier": {
    "url": "https://actions.zapier.com/mcp/*******/sse",
    "headers": {},
    "timeout": 5,
    "sse_read_timeout": 300
  }
}

로컬 MCP 서버 연결: #

json

{
  "local_server": {
    "url": "http://localhost:3000/sse",
    "headers": {},
    "timeout": 5,
    "sse_read_timeout": 300
  }
}

4. 설정 완료 후 사용 #

설정이 완료되면:

  • Agent가 대화 중 자동으로 MCP 서버의 도구와 기능을 활용
  • Workflow에서 Agent 노드가 MCP 서버를 통해 외부 서비스와 상호작용
  • 이메일 발송, CRM 데이터 생성, Slack 알림 등 다양한 작업 자동화 가능

이렇게 설정하면 Dify가 MCP 클라이언트로서 외부 MCP 서버들과 연결되어 다양한 외부 도구와 데이터 소스에 접근할 수 있게 됩니다.Retry

Claude does not have the ability to run the code it generates yet.

BJ

local mcp 서버를 설치하는 방법은?Edit

로컬 MCP 서버를 설치하는 방법에 대해 자세히 알아보겠습니다.

D

search

Request

{ `query`: `local MCP server installation setup development` }

Response

Title: Deploy Dify Docs MCP Service and Chat with Documentation Content: Deploy Dify Docs MCP Service and Chat with Documentation 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. 1. Analyze the Question The AI receives a question and analyzes the concepts and technical details involved. It determines whether it needs to consult Dify documentation. 2. Generate Search Keywords When the AI can't answer from its existing knowledge and needs to reference documentation, it automatically generates search keywords and query strategies. For "How to integrate OpenAI GPT-4 model in Dify", it searches for "model configuration", "API integration", "GPT-4 setup". 3. Retrieve Documentation Content The MCP server receives these queries, searches through Dify's documentation library, and returns the most relevant content. 4. Integrate and Generate Answer The AI organizes the retrieved information and generates an accurate, detailed response. 5. Multi-round Search Optimization If the initial search doesn't provide enough information, the AI refines its search strategy and performs additional queries until it gets a comprehensive answer. Link: en/learn-more/extended-reading/dify-docs-mcp

Response

Title: 2. Initialize MCP Server Content: 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. Link: en/learn-more/extended-reading/dify-docs-mcp

Response

Title: Publishing Dify Apps as MCP Servers Content: Publishing Dify Apps as MCP Servers Dify now supports exposing your applications as MCP (Model Context Protocol) servers, enabling seamless integration with AI assistants like Claude Desktop and development environments like Cursor. This allows these tools to directly interact with your Dify apps as if they were native extensions. If you're looking to use MCP tools within Dify workflows & agents, see here. Link: en/guides/application-publishing/publish-mcp

Response

Title: Publishing Dify Apps as MCP Servers Content: Publishing Dify Apps as MCP Servers Publishing Dify Apps as MCP Servers Dify now supports exposing your applications as MCP (Model Context Protocol) servers, enabling seamless integration with AI assistants like Claude Desktop and development environments like Cursor. This allows these tools to directly interact with your Dify apps as if they were native extensions. If you're looking to use MCP tools within Dify workflows & agents, see here. Link: en/guides/application-publishing/publish-mcp

Response

Title: 3. Configure MCP Server Content: 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. Link: en/learn-more/extended-reading/dify-docs-mcp

Response

Title: Step 2: Install the MCP SSE Plugin Content: Step 2: Install the MCP SSE Plugin Go to the Dify plugin marketplace, search for the MCP SSE plugin and click install. For optimal stability, we recommend using plugin version v0.0.4 . You can change the version in the plugin’s detail settings. Click the To Authorize button on the plugin page, and paste the Zapier MCP Server URL obtained earlier into the plugin. Reference address format: Link: en/plugins/best-practice/how-to-use-mcp-zapier

Response

Title: Step 2: Install the MCP SSE Plugin Content: Step 2: Install the MCP SSE Plugin Go to the Dify plugin marketplace, search for the MCP SSE plugin and click install. For optimal stability, we recommend using plugin version v0.0.4 . You can change the version in the plugin’s detail settings. Click the To Authorize button on the plugin page, and paste the Zapier MCP Server URL obtained earlier into the plugin. Reference address format: { "server_name": { "url": "https://actions.zapier.com/mcp/*******/sse", "headers": {}, "timeout": 5, "sse_read_timeout": 300 } } Link: en/plugins/best-practice/how-to-use-mcp-zapier

Response

Title: Deploy Dify Docs MCP Service and Chat with Documentation Content: Deploy Dify Docs MCP Service and Chat with Documentation Learn how to deploy a local documentation MCP server and chat with documentation using AI. Link: en/learn-more/extended-reading/dify-docs-mcp

Response

Title: Use Case 2: Configuring MCP Agent Strategy in Workflow Content: Use Case 2: Configuring MCP Agent Strategy in Workflow In addition to adding the MCP SSE plugin as a tool to the Agent, you can also use the MCP Agent Strategy plugin in Workflow. After installation, configure it in the corresponding Agent node as follows: Use the following JSON structure as a template, replacing the url value with the MCP Server address, then copy and paste the complete modified JSON into the MCP SERVER URL configuration box: Once configured, when the Workflow runs to that Agent node, it can execute tasks using the configured Zapier MCP Server according to the Prompt instructions. As shown below, calling Gmail to send an email: Edit this page | Report an issue Link: en/plugins/best-practice/how-to-use-mcp-zapier

Response

Title: Use Case 2: Configuring MCP Agent Strategy in Workflow Content: Use Case 2: Configuring MCP Agent Strategy in Workflow In addition to adding the MCP SSE plugin as a tool to the Agent, you can also use the MCP Agent Strategy plugin in Workflow. After installation, configure it in the corresponding Agent node as follows: Use the following JSON structure as a template, replacing the url value with the MCP Server address, then copy and paste the complete modified JSON into the MCP SERVER URL configuration box: { "server_name": { "url": "https://actions.zapier.com/mcp/*******/sse", "headers": {}, "timeout": 5, "sse_read_timeout": 300 } } Link: en/plugins/best-practice/how-to-use-mcp-zapier

D

search

Request

{ `query`: `dify docs MCP server repository installation command` }

Response

Title: Deploy Dify Docs MCP Service and Chat with Documentation Content: Deploy Dify Docs MCP Service and Chat with Documentation 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. 1. Analyze the Question The AI receives a question and analyzes the concepts and technical details involved. It determines whether it needs to consult Dify documentation. 2. Generate Search Keywords When the AI can't answer from its existing knowledge and needs to reference documentation, it automatically generates search keywords and query strategies. For "How to integrate OpenAI GPT-4 model in Dify", it searches for "model configuration", "API integration", "GPT-4 setup". 3. Retrieve Documentation Content The MCP server receives these queries, searches through Dify's documentation library, and returns the most relevant content. 4. Integrate and Generate Answer The AI organizes the retrieved information and generates an accurate, detailed response. 5. Multi-round Search Optimization If the initial search doesn't provide enough information, the AI refines its search strategy and performs additional queries until it gets a comprehensive answer. Link: en/learn-more/extended-reading/dify-docs-mcp

Response

Title: Publishing Dify Apps as MCP Servers Content: Publishing Dify Apps as MCP Servers Dify now supports exposing your applications as MCP (Model Context Protocol) servers, enabling seamless integration with AI assistants like Claude Desktop and development environments like Cursor. This allows these tools to directly interact with your Dify apps as if they were native extensions. If you're looking to use MCP tools within Dify workflows & agents, see here. Link: en/guides/application-publishing/publish-mcp

Response

Title: Publishing Dify Apps as MCP Servers Content: Publishing Dify Apps as MCP Servers Publishing Dify Apps as MCP Servers Dify now supports exposing your applications as MCP (Model Context Protocol) servers, enabling seamless integration with AI assistants like Claude Desktop and development environments like Cursor. This allows these tools to directly interact with your Dify apps as if they were native extensions. If you're looking to use MCP tools within Dify workflows & agents, see here. Link: en/guides/application-publishing/publish-mcp

Response

Title: Deploy Dify Docs MCP Service and Chat with Documentation Content: Deploy Dify Docs MCP Service and Chat with Documentation Learn how to deploy a local documentation MCP server and chat with documentation using AI. Link: en/learn-more/extended-reading/dify-docs-mcp

Response

Title: Dify Docs MCP サービスをデプロイしてドキュメントと対話する Content: Dify Docs MCP サービスをデプロイしてドキュメントと対話する Model Context Protocol (MCP) は、Anthropic によって開発された標準化するオープンプロトコルで、AIが外部のツールやデータソースと対話するための標準化されたインターフェースを提供し、そしてこのプロトコルを用いてソフトウェアツールやデータリソースにアクセスします。 本記事では、 dify-docs リポジトリ に基づいてローカル MCP サーバーをデプロイし、LLM とドキュメントの自然な対話を実現する方法を紹介します。 MCP プロトコルの詳細については、 Model Context Protocol を参照してください。 AI が質問を受信すると、必要な概念と技術的詳細を分析します。Dify Docsを参照する必要がある場合、モデルは自動的に検索クエリを生成します。 AI は質問の性質に基づいて対応する検索キーワードとクエリ戦略を生成します。「Dify で OpenAI GPT-4 モデルを統合する方法」に対して、モデルは「モデル設定」、「API 統合」、「GPT-4 設定」などのクエリを生成し、完全な情報取得を確保します。 MCP サーバーはクエリを受信した後、Dify Docsライブラリを検索し、関連コンテンツを返します。モデルは情報を統合し、正確で詳細な回答を生成します。 このプロセスは多回ラウンドの対話クエリをサポートし、初回結果に基づいて後続の検索戦略を調整します。 Link: ja-jp/learn-more/extended-reading/dify-docs-mcp

Response

Title: Dify Docs MCP サービスをデプロイしてドキュメントと対話する Content: Dify Docs MCP サービスをデプロイしてドキュメントと対話する ローカルドキュメント MCP サーバーをデプロイし、AI を通じてドキュメントと対話する方法を学習します。 Link: ja-jp/learn-more/extended-reading/dify-docs-mcp

Response

Title: 部署 Dify Docs MCP 服务,与文档进行对话 Content: 部署 Dify Docs MCP 服务,与文档进行对话 学习如何部署本地文档 MCP 服务器,并通过 AI 与文档进行对话。 Link: zh-hans/learn-more/extended-reading/dify-docs-mcp

Response

Title: 部署 Dify Docs MCP 服务,与文档进行对话 Content: 部署 Dify Docs MCP 服务,与文档进行对话 Model Context Protocol (MCP) 是由 Anthropic 开发的开放标准协议,为 AI 与外部工具和数据源提供标准化交互接口。AI 通过此协议访问软件工具和数据资源。 本文介绍如何基于 dify-docs 仓库 部署本地 MCP 服务器,实现 LLM 与文档的自然对话。 详细了解 MCP 协议,请参考 Model Context Protocol。 1. 分析问题 接收到问题后,AI 会先分析其中涉及的概念和技术细节,判断是否需要查阅 Dify 的官方文档。 2. 生成查询关键词 如果需要文档支持,AI 会根据问题的核心内容,自动生成搜索关键词和查询策略。比如询问“如何在 Dify 中集成 OpenAI GPT-4 模型”,AI 可能会生成“模型配置”、“API 集成”、“GPT-4 设置”等关键词,用于精准搜索。 3. 检索文档内容 MCP 服务器接收到这些查询后,会在 Dify 的文档库中进行搜索,并返回最相关的内容。 4. 整合生成答案 AI 将检索到的信息进行整理和分析,最终生成一个准确、详细的回答。 5. 多轮搜索优化 如果初次搜索结果不够完整,AI 会根据结果自动调整搜索策略,进行进一步查询,直到获取更完整的答案。 Link: zh-hans/learn-more/extended-reading/dify-docs-mcp

Response

Title: 2. Initialize MCP Server Content: 2. Initialize MCP Server Navigate to the documentation directory and install the MCP server: cd dify-docs npx mint-mcp add dify-6c0370d8 Link: en/learn-more/extended-reading/dify-docs-mcp

Response

Title: Configuring Your Dify App as an MCP Server Content: Configuring Your Dify App as an MCP Server Navigate to your application's configuration interface in Dify, you'll find an MCP Server configuration module. The feature is disabled by default. When you toggle it on, Dify generates an unique MCP Server address for your application. This address serves as the connection point for external tools. Your MCP Server URL contains authentication credentials, so treat it like an API key. If you suspect it's been compromised, use the regenerate button to create a new URL. The old one will immediately stop working. CleanShot 2025-07-07 at 08.18.02.png Link: en/guides/application-publishing/publish-mcp

MCP server installation local development guide

10 results

Build an MCP Server – Model Context Protocolmodelcontextprotocol.io

How to Build an MCP Server (Step-by-Step Guide) 2025leanware.co

Building MCP Servers: Part 1 — Getting Started with Resources | by Christopher Strolia-Davis | Mediummedium.com

Build a Remote MCP server · Cloudflare Agents docscloudflare.com

Use MCP servers in VS Codevisualstudio.com

MCP server: A step-by-step guide to building from scratch – Composiocomposio.dev

Get started using the Azure MCP Server – Azure MCP Server | Microsoft Learnmicrosoft.com

How to Build Your Own MCP Serverbuilder.io

How to Build an MCP Server Fast: A Step-by-Step Tutorial | by Eugenii Shevchenko | Mediummedium.com

Build and Deploy a Remote MCP Server to Google Cloud Run in Under 10 Minutes | Google Cloud Bloggoogle.com

로컬 MCP 서버를 설치하는 방법을 단계별로 설명드리겠습니다.

1. Dify Docs MCP 서버 설치 (가장 간단한 방법) #

Dify 문서에서 제공하는 예제를 사용하는 방법입니다:

1-1. 사전 요구사항 #

  • Node.js 설치 필요
  • npm 또는 yarn 패키지 매니저

1-2. 설치 단계 #

bash

# 1. dify-docs 리포지토리 클론 또는 문서 디렉토리로 이동
cd dify-docs

# 2. MCP 서버 초기화 및 설치
npx mint-mcp add dify-6c0370d8

이 명령어는 다음 작업을 수행합니다:

  • 로컬 MCP 서버 인스턴스 생성
  • 문서 내용 분석 및 인덱싱
  • 필요한 의존성 구성

2. 커스텀 MCP 서버 개발 #

자체 MCP 서버를 개발하려는 경우:

2-1. 프로젝트 초기화 #

bash

# 새 프로젝트 디렉토리 생성
mkdir my-mcp-server
cd my-mcp-server

# npm 프로젝트 초기화
npm init -y

# MCP SDK 설치
npm install @modelcontextprotocol/sdk

2-2. 기본 서버 구조 생성 #

javascript

// server.js
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

const server = new Server(
  {
    name: 'my-mcp-server',
    version: '0.1.0',
  },
  {
    capabilities: {
      tools: {},
      resources: {},
    },
  }
);

// 도구 등록
server.setRequestHandler('tools/list', async () => {
  return {
    tools: [
      {
        name: 'example_tool',
        description: '예제 도구',
        inputSchema: {
          type: 'object',
          properties: {
            query: {
              type: 'string',
              description: '검색 쿼리'
            }
          }
        }
      }
    ]
  };
});

// 서버 시작
async function main() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
}

main().catch(console.error);

2-3. 서버 실행 #

bash

node server.js

3. 기존 MCP 서버 사용 #

커뮤니티에서 제공하는 MCP 서버들을 설치하여 사용할 수 있습니다:

3-1. 파일 시스템 MCP 서버 #

bash

npm install @modelcontextprotocol/server-filesystem

3-2. SQLite MCP 서버 #

bash

npm install @modelcontextprotocol/server-sqlite

3-3. Git MCP 서버 #

bash

npm install @modelcontextprotocol/server-git

4. 서버 테스트 #

4-1. MCP Inspector 사용 #

MCP inspector를 사용하여 서버를 테스트할 수 있습니다. localhost:8787/sse URL로 연결하여 웹 브라우저에서 도구를 호출해볼 수 있습니다. Build a Remote MCP server · Cloudflare Agents docs

bash

npx @modelcontextprotocol/inspector

4-2. 로컬 서버 URL 확인 #

일반적으로 로컬 MCP 서버는 다음과 같은 형식의 URL을 가집니다:

  • http://localhost:3000/sse
  • http://localhost:8787/sse

5. Dify와 연결 #

로컬 MCP 서버가 실행되면, 앞서 설명한 방법으로 Dify의 MCP SSE 플러그인에 연결합니다:

json

{
  "local_server": {
    "url": "http://localhost:3000/sse",
    "headers": {},
    "timeout": 5,
    "sse_read_timeout": 300
  }
}

이렇게 설정하면 로컬에서 실행되는 MCP 서버를 Dify와 연결하여 사용할 수 있습니다.

Powered by BetterDocs

Leave a Reply