MCP server that exposes Dify knowledge base retrieval as agent tools
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"dify-kb-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# dify-kb-mcp MCP server that exposes [Dify](https://dify.ai) knowledge base retrieval as agent tools. Two tools, both read-only: | Tool | What it does | |---|---| | `search_knowledge` | Semantic search across one or more datasets, returns the best passages with scores | | `list_knowledge_bases` | Lists datasets with document counts and retrieval settings | ## Install ```bash uvx dify-kb-mcp # or pip install dify-kb-mcp ``` ## Configure | Variable | Required | Default | Notes | |---|---|---|---| | `DIFY_API_BASE` | no | `http://localhost:5001/v1` | Your Dify API base, e.g. `https://dify.example.com/v1` | | `DIFY_DATASET_TOKEN` | **yes** | – | Dataset API key from Dify → 知识库 → API | | `DIFY_RERANK` | no | `0` | `1` enables reranking when the dataset has it configured | | `DIFY_RERANK_PROVIDER` | no | `huggingface_tei` | Rerank provider name | | `DIFY_RERANK_MODEL` | no | `bge-reranker-base` | Rerank model name | | `DIFY_MAX_RESULT_CHARS` | no | `3000` | Result truncation limit | ## MCP client config ```json { "mcpServers": { "dify-kb": { "command": "uvx", "args": ["dify-kb-mcp"], "env": { "DIFY_API_BASE": "https://dify.example.com/v1", "DIFY_DATASET_TOKEN": "dataset-xxxxxxxx" } } } } ``` ## Behaviour notes - Only datasets with at least one document are searched. - Each dataset's own retrieval settings (search method, score threshold) are respected; only reranking is overridden by `DIFY_RERANK`. - If reranking is requested but the rerank service is down, the request is retried once without reranking instead of failing. - Errors (bad token, unreachable host) are returned as readable text rather than raised, so the agent can explain them to the user. ## License MIT
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.