Dify MCP server
io.github.salted-butter-joshua/dify-mcp·v0.1.0MCP server exposing Dify knowledge base retrieval to Cursor and other MCP clients
0 stars22 downloads/wk
Reviews
Write oneNobody has reviewed Dify yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Dify tools (5)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
get_datasetGet details for one allowed knowledge base.
list_datasetsList allowed Dify knowledge bases (filtered by DIFY_ALLOWED_DATASETS).
list_document_segmentsList text segments (chunks) for a document in an allowed knowledge base.
list_documentsList documents inside an allowed knowledge base.
search_knowledgeRetrieve relevant chunks from an allowed Dify knowledge base.
Public scan report
scanner v0.1.9 · 2026-09-26 · same rubric, same numbers if you re-run it
- Code scan7 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 83 days ago12/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Dify compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 78/100
- higher than 57% of 48,255 servers
- Tools
- 5
- the typical server has 7
- Tools that change things
- 0%
- typical: 0%. Fewer write tools means less an agent can break
- Downloads a week
- 22
- more than 8% of 12,191 servers with a package
What its tools let an agent do: 5 read
Install Dify in Claude Code, Cursor or VS Code
claude mcp add dify-mcp -- uvx dify-mcp
What the publisher says
From the Dify repository's README, as published. We do not edit it. Read it on GitHub
dify-mcp
<!-- mcp-name: io.github.salted-butter-joshua/dify-mcp -->
Expose Dify knowledge base retrieval capabilities via MCP (Model Context Protocol), for use in Cursor and other MCP-compatible clients.
Connect to a self-hosted or remote Dify instance over HTTP, with optional dataset allowlisting for access control.
Features
- Knowledge base discovery — list and inspect allowed datasets
- Semantic retrieval — search chunks via Dify POST /datasets/{dataset_id}/retrieve
- Document browsing — list documents and segments within a dataset
- Dataset allowlist — restrict access to specific dataset_id values
- stdio transport — no manual server startup; the MCP client launches the process
Requirements
- Python 3.11+
- A running Dify instance with Knowledge Base API enabled
- Network access from the machine running the MCP server to your Dify API endpoint
- A Dify Knowledge Base API Key (Dify → Knowledge → Service API → API Key)
Quick Start
1. Clone and install
git clone https://github.com/salted-butter-joshua/dify-mcp.git
cd dify-mcp
python3.11 -m venv .venv
# Windows
.venv\Scripts\python.exe -m pip install -e .
# macOS / Linux
.venv/bin/python -m pip install -e .Verify import:
# Windows
.venv\Scripts\python.exe -c "import dify_mcp; print('OK')"
# macOS / Linux
.venv/bin/python -c "import dify_mcp; print('OK')"2. Configure environment
Copy the example env file and edit it:
cp .env.example .envDIFY_API_BASE=http://your-dify-host/v1
DIFY_API_KEY=dataset-your-api-key
DIFY_ALLOWED_DATASETS=dataset-uuid-1,dataset-uuid-2
DIFY_TIMEOUT=30
DIFY_VERIFY_SSL=falseRun the health check:
# Windows
.venv\Scripts\python.exe scripts/health_check.py
# macOS / Linux
.venv/bin/python scripts/health_check.py3. Add to Cursor
You do not need to start the MCP server manually. Cursor launches it automatically via stdio.
- Open Cursor Settings → MCP → Edit config
- Add the following to mcpServers in your MCP config file:
- Windows: %USERPROFILE%\.cursor\mcp.json
- macOS / Linux: ~/.cursor/mcp.json
- Replace paths and env values with your own
- Restart Cursor
See mcp.json.example for a full example.
Windows example:
{
"mcpServers": {
"dify-knowledge": {
"command": "/absolute/path/to/dify-mcp/.venv/Scripts/python.exe",
"args": ["-m", "dify_mcp.server"],
"cwd": "/absolute/path/to/dify-mcp",
"env": {
"DIFY_API_BASE": "http://your-dify-host/v1",
"DIFY_API_KEY": "dataset-your-api-key",
"DIFY_ALLOWED_DATASETS": "dataset-uuid-1,dataset-uuid-2",
"DIFY_TIMEOUT": "30",
"DIFY_VERIFY_SSL": "false"
}
}
}
}macOS / Linux example:
{
"mcpServers": {
"dify-knowledge": {
"command": "/absolute/path/to/dify-mcp/.venv/bin/python",
"args": ["-m", "dify_mcp.server"],
"cwd": "/absolute/path/to/dify-mcp",
"env": {
"DIFY_API_BASE": "http://your-dify-host/v1",
"DIFY_API_KEY": "dataset-your-api-key",
"DIFY_ALLOWED_DATASETS": "dataset-uuid-1,dataset-uuid-2"
}
}
}
}4. Verify in Cursor
- Cursor Settings → MCP → confirm dify-knowledge shows as enabled
- In chat, try:
- List available Dify knowledge bases
- Search the knowledge base for "your query"
MCP Tools
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Dify: common questions
- Is Dify MCP server safe?
- Mostly: it is graded B (78/100). Read the Dify safety report
- How do I install Dify?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Dify need an API key?
- Yes. The registry entry asks for
DIFY_API_KEY. - Is Dify maintained?
- The last commit was 122 days ago (2026-07-05). The latest release is v0.1.0.
- How does Dify compare with other MCP servers?
- safety score 78/100 (higher than 57% of 48,255 servers); tools 5 (the typical server has 7); tools that change things 0% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.