npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dify-knowledge-mcp-server

v1.0.9

Published

MCP server for Dify knowledge base retrieval

Downloads

17

Readme

Dify知识库MCP服务器

简介

基于Model Context Provider协议的Dify知识库检索服务,为AI模型提供上下文检索能力。

核心功能

  • 支持MCP协议规范
  • 知识库内容检索接口
  • 可扩展的模型上下文提供
  • 支持多种知识库数据源

安装部署

# 安装依赖
npm install

# 构建项目
npm run build

配置说明

环境变量配置(.env)

DIFY_BASE_URL=http://localhost:8080  # Dify服务基础地址(必填)
DIFY_DATASET_ID=your-dataset-id  # 知识库数据集ID(必填)
DIFY_DATASET_TOKEN=your-dataset-token  # 知识库访问令牌(必填)

| 参数 | 说明 | 必填 | 默认值 | |------|------|------|-------| | DIFY_BASE_URL | Dify服务基础地址(不含API路径) | 是 | 无 | | DIFY_DATASET_ID | 知识库数据集唯一标识 | 是 | 无 | | DIFY_DATASET_TOKEN | 知识库访问认证令牌 | 是 | 无 | | SEARCH_METHOD | 搜索方法 | 否 | hybrid_search | | TITLE | 用于描述工具标题 | 否 | Dify Dataset | | DESCRIPTION | 用于描述工具描述 | 否 | Dify Dataset | | TOP_K | 指定返回知识条目数 | 否 | 1 | | RERANKING_ENABLE | 是否开启检索结果排序 | 否 | true |

⚠️ 安全提示:生产环境必须设置强认证密钥,避免未授权访问

使用示例

{
    "mcpServers": {
        "dify-knowledge-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": ["-y","dify-knowledge-mcp-server"],
            "env": {
              "DIFY_BASE_URL": "http://localhost:8080",
              "DIFY_DATASET_ID": "your-dataset-id",
              "DIFY_DATASET_TOKEN": "your-dataset-token",
              "TITLE": "Dify Knowledge Retrieval",
              "DESCRIPTION": "Retrieve knowledge from Dify dataset",
              "TOP_K": "5"
            }
        }
    }
}

技术栈

  • Node.js v18+
  • TypeScript 5.3.3
  • Express框架
  • Zod数据校验
  • Axios HTTP客户端

目录结构

├── dist/              # 编译输出
├── src/               # 源代码
├── .env               # 环境配置
├── package.json       # 项目配置
└── tsconfig.json      # TypeScript配置