DifySAFE
A Model Context Protocol server for Dify
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
一个集成 Dify AI API 的 Model Context Protocol 服务器
这是一个基于 TypeScript 的 MCP 服务器,通过集成 Dify AI API 来提供 Ant Design 业务组件的代码生成能力。它展示了以下核心 MCP 概念:
- 集成 Dify AI API 实现聊天完成功能
- 支持文本和图片输入
- 流式响应处理
功能特性
Tools
antd-component-codegen-mcp-tool- 生成 Ant Design 业务组件代码- 支持文本和可选的图片输入
- 处理图片文件上传
- 支持来自 Dify AI API 的流式响应
开发指南
安装依赖:
npm install
开发模式(自动重新构建):
npm run watch
构建服务器:
npm run build
安装说明
在 Continue 中集成
在~/.continue/config.json中添加以下配置:
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "node",
"args": ["your/path/dify-server/build/index.js"],
"env": {
"DIFY_API_KEY": "***"
}
}
}
]
}
}在 Cline 中集成
在your/path/cline_mcp_settings.json中添加以下配置:
{
"mcpServers": {
"dify-server": {
"command": "node",
"args": ["your/path/dify-server/build/index.js"],
"env": {
"DIFY_API_KEY": "***"
}
}
}
}调试
由于 MCP 服务器通过标准输入输出(stdio)进行通信,调试可能会比较困难。我们推荐使用 MCP Inspector,可通过以下命令启动:
npm run inspector
Inspector 将提供一个可在浏览器中访问的调试工具 URL。
c6106837a140OBSERVED · 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-mcp-server --env DIFY_API_KEY=${DIFY_API_KEY} -- npx -y [email protected]{
"mcpServers": {
"dify-mcp-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DIFY_API_KEY": "${DIFY_API_KEY}"
}
}
}
}Exposed tools (1)
0 read · 1 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
antd-component-codegen-mcp-tool | write | Send a message to Dify chat API for generating antd biz components code |
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 (3 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (2)
axios, eventsource-parser, form-data, @types/node, typescript
Gates applied: no_behavioural_pass, no_license.
c6106837a140full audit observations/trust-audit/mcp-server/ai-fe__dify-1.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 | c6106837a140 | SAFE | B | 89 | first audit |
Questions
What is the Dify MCP server?
A Model Context Protocol server for Dify
What tools does Dify expose?
1 in total: 0 read-only, 1 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Dify 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 need?
It reads DIFY_API_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 run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as dify-mcp-server at 0.1.0.
How current is this page?
The grade is for one exact copy of the source (c6106837a140), read on 2026-10-08. The repository is watched and re-audited when it changes.