dify-mcp-server

dify-mcp-server

MCP server for Dify Console API that enables managing apps, workflows, knowledge bases, models, plugins, and MCP servers programmatically from Claude Code or any MCP client.

Category
访问服务器

README

dify-mcp-server

GitHub Release License: MIT 52 Tools

MCP server for Dify Console API — manage apps, workflows, knowledge bases, models, plugins, and MCP servers programmatically from Claude Code or any MCP client.

Works with self-hosted Dify v1.6+ instances (v1.10+ recommended for plugins and MCP tools).

What can you do?

  • Create and configure Dify apps from Claude Code
  • Import/export apps as YAML DSL templates
  • Build knowledge bases with datasets, documents, and segments
  • Manage model providers and set default models
  • Install, upgrade, and remove plugins
  • Connect MCP servers to Dify programmatically
  • Organize apps with tags
  • Browse conversation and message history

Quick Start

Option A: Homebrew (macOS / Linux):

brew tap overpod/tap
brew install dify-mcp-server

Option B: Download binary (no dependencies needed):

# macOS (Apple Silicon)
curl -L https://github.com/overpod/dify-mcp-server/releases/latest/download/dify-mcp-server-darwin-arm64 -o dify-mcp-server
chmod +x dify-mcp-server

# macOS (Intel)
curl -L https://github.com/overpod/dify-mcp-server/releases/latest/download/dify-mcp-server-darwin-x64 -o dify-mcp-server
chmod +x dify-mcp-server

# Linux (x64)
curl -L https://github.com/overpod/dify-mcp-server/releases/latest/download/dify-mcp-server-linux-x64 -o dify-mcp-server
chmod +x dify-mcp-server

Windows:

Invoke-WebRequest -Uri "https://github.com/overpod/dify-mcp-server/releases/latest/download/dify-mcp-server-windows-x64.exe" -OutFile "dify-mcp-server.exe"

Add to your .mcp.json:

{
  "mcpServers": {
    "dify": {
      "command": "./dify-mcp-server",
      "env": {
        "DIFY_BASE_URL": "https://your-dify-instance.com",
        "DIFY_EMAIL": "admin@example.com",
        "DIFY_PASSWORD": "your-password"
      }
    }
  }
}

Use from Claude Code:

"List all my Dify apps" "Create a new chat app called Customer Support" "Export the Customer Support app as YAML" "Connect an MCP server at https://mcp.example.com/sse to Dify" "What models are configured in my Dify instance?"

Alternative: From source

git clone https://github.com/overpod/dify-mcp-server
cd dify-mcp-server
bun install && bun run build
bun dist/index.js

Use Case Examples

Create an agent from template

1. export_app → get YAML DSL of an existing app
2. Edit the YAML (change prompt, model, tools)
3. import_dsl → import as a new app
4. publish_workflow → make it live
5. enable_api + create_api_key → get API access

Build a knowledge base

1. create_dataset → new knowledge base
2. create_document_by_text → add documents
3. Attach dataset to an app workflow

Connect MCP servers to Dify

1. create_mcp_server → add by URL (auto-discovers tools)
2. list_mcp_servers → verify connection
3. get_mcp_server_tools → see available tools
4. refresh_mcp_server_tools → update after changes

Manage model configuration

1. list_model_providers → see configured providers
2. list_models → check available models
3. set_default_model → set workspace default LLM

Development

git clone https://github.com/overpod/dify-mcp-server
cd dify-mcp-server
bun install
# Hot reload
DIFY_BASE_URL=https://your-dify.com DIFY_EMAIL=admin@example.com DIFY_PASSWORD=secret bun run dev

# Type check and lint
bun run check    # biome check
bun run build    # tsc

# Run tests
bun run test

# Test with MCP Inspector
npx @modelcontextprotocol/inspector bun dist/index.js

Requirements

  • Bun 1.3+
  • Self-hosted Dify v1.6+ instance
  • Dify admin account (email/password)

Contributing

  1. Fork the repo and create a branch from main
  2. Run bun run check — code must pass Biome linting
  3. Run bun run build — code must compile without errors
  4. Run bun run test — tests must pass
  5. Update CHANGELOG.md under ## [Unreleased]
  6. Keep PRs focused — one feature or fix per PR

Adding a new tool

  1. Add the API method to src/dify-client.ts
  2. Register the MCP tool in src/index.ts with Zod schema
  3. Add an entry to CHANGELOG.md

Code style

  • Formatter/linter: Biome (tabs, 100 line width)
  • Language: TypeScript strict mode
  • Run bun run fix to auto-format

Releases

Releases are automated. Tag and push:

git tag v0.7.0
git push --tags

GitHub Actions builds binaries for all platforms and creates a release with notes from CHANGELOG.

Auth Notes

  • Uses Dify's undocumented Console API (/console/api/)
  • Password is Base64-encoded (Dify's @decrypt_password_field)
  • Auth via HttpOnly cookies with CSRF token (Dify 1.9.2+)
  • Auto-login on first request, auto-retry on 401
  • Console API is internal — may change between Dify versions

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选