- Explore MCP Servers
- dify-connect-mcp
Dify Connect Mcp
What is Dify Connect Mcp
Dify Connect MCP is a Model Context Protocol (MCP) server that integrates with the Dify API, allowing chat applications to send queries and receive responses.
Use cases
Use cases include sending queries like ‘What is the weather today?’ to the Dify chat and retrieving specific information from the knowledge base, such as product features.
How to use
To use Dify Connect MCP, install the necessary dependencies using npm, compile the TypeScript code, set up the required environment variables in a .env file, and then start the server using the provided scripts.
Key features
Key features include the ability to send queries to the Dify chat application and retrieve responses, as well as querying the Dify knowledge base for information.
Where to use
Dify Connect MCP can be used in various fields such as customer support, information retrieval, and any application requiring interactive chat functionalities.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Dify Connect Mcp
Dify Connect MCP is a Model Context Protocol (MCP) server that integrates with the Dify API, allowing chat applications to send queries and receive responses.
Use cases
Use cases include sending queries like ‘What is the weather today?’ to the Dify chat and retrieving specific information from the knowledge base, such as product features.
How to use
To use Dify Connect MCP, install the necessary dependencies using npm, compile the TypeScript code, set up the required environment variables in a .env file, and then start the server using the provided scripts.
Key features
Key features include the ability to send queries to the Dify chat application and retrieve responses, as well as querying the Dify knowledge base for information.
Where to use
Dify Connect MCP can be used in various fields such as customer support, information retrieval, and any application requiring interactive chat functionalities.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Dify Connect MCP
Dify APIと連携するModel Context Protocol (MCP) サーバー。
概要
このMCPサーバーは、Dify APIと連携して、チャットアプリケーションにクエリを送信し、結果を取得する機能を提供します。
機能
- dify-chat: Difyチャットアプリにクエリを送信し、応答を取得します
- knowledge-base-query: Difyの知識ベースにクエリを送信し、応答を取得します
セットアップ
前提条件
- Node.js (v16以上)
- npm
- Dify APIキー
インストール
- 依存関係をインストールします:
npm install
- TypeScriptコードをコンパイルします:
./build.sh
設定
以下の環境変数を設定する必要があります:
DIFY_BASE_URL: Dify APIのベースURL(デフォルト: https://api.dify.ai/v1)DIFY_SECRET_KEY: Dify APIキー(必須)NODE_ENV: 実行環境(development/production)LOG_LEVEL: ログレベル(debug/info/warn/error)
これらの環境変数は、.envファイルで設定できます:
.env.exampleファイルを.envにコピーします:
cp .env.example .env
.envファイルを編集して、実際のDify APIキーを設定します:
# Dify API設定 DIFY_BASE_URL=https://api.dify.ai/v1 DIFY_SECRET_KEY=your_actual_dify_secret_key_here # サーバー設定 NODE_ENV=production LOG_LEVEL=info
スクリプト(start-mcp.shとrun-mcp.sh)は自動的に.envファイルから環境変数を読み込みます。
実行
サーバーを起動するには:
./start-mcp.sh
MCPサーバーの設定
Clineで使用するには、MCPサーバー設定ファイルに以下を追加します:
{
"mcpServers": {
"dify-connect-mcp": {
"command": "/bin/bash",
"args": [
"<リポジトリのパス>/run-mcp.sh"
],
"disabled": false,
"autoApprove": []
}
}
}
<リポジトリのパス>は、実際のリポジトリのパスに置き換えてください。
この設定では、run-mcp.shスクリプトが.envファイルから環境変数を読み込むため、MCPサーバー設定ファイルに直接APIキーを記述する必要はありません。
使用例
MCPサーバーが設定されると、以下のようなコマンドでDifyにクエリを送信できます:
dify-chat "こんにちは、今日の天気は?"
または知識ベースにクエリを送信:
knowledge-base-query "製品の特徴について教えてください" "knowledge_base_id_here"
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










