Dify ConnectSAFE
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
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"
b01e2eaf26f2OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add dify-mcp4 --env DIFY_SECRET_KEY=${DIFY_SECRET_KEY} -- npx -y [email protected]{
"mcpServers": {
"dify-mcp4": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DIFY_SECRET_KEY": "${DIFY_SECRET_KEY}"
}
}
}
}Exposed tools (2)
2 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
dify-chat | read | Difyチャットアプリにクエリを送信し、応答を取得します |
knowledge-base-query | read | Difyの知識ベースにクエリを送信し、応答を取得します |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (1 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (2)
@modelcontextprotocol/sdk, axios, dotenv, express, winston, @types/express, @types/node, ts-node
Gates applied: no_behavioural_pass, no_license.
b01e2eaf26f2full audit observations/trust-audit/mcp-server/difybase__dify-connect.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | b01e2eaf26f2 | SAFE | B | 89 | first audit |
Questions
What tools does Dify Connect expose?
2 in total: 2 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Dify Connect safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Dify Connect need?
It reads DIFY_SECRET_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Dify Connect run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as dify-mcp4 at 1.0.0.
How current is this page?
The grade is for one exact copy of the source (b01e2eaf26f2), read on 2026-10-08. The repository is watched and re-audited when it changes.