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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@liangshen/dify-mcp-server

v1.5.2

Published

一个用于访问Dify API的Model Context Protocol (MCP)服务实现

Readme

Dify MCP Server

这是一个用于访问 Dify API 的 Model Context Protocol (MCP) 服务实现,可以让支持 MCP 协议的 AI 助手(如 Claude, Cursor, Clion, Cherry Studio)直接与 Dify 工作流进行交互。

功能特点

  • 支持通过 SSE (Server-Sent Events) 方式部署为网络服务
  • 支持通过 stdio (标准输入/输出) 方式在本地使用
  • 支持自定义用户 ID,方便追踪和管理
  • 完全兼容 Model Context Protocol 规范

安装方法(STDIO模式运行不需要安装)

全局安装

npm install -g @liangshen/dify-mcp-server

使用方法

方式一:作为 SSE 服务运行

SSE 模式适合部署为网络服务,允许多个客户端同时连接。

准备一个.env文件放在一个目录中

DIFY_API_KEY=your_api_key                # 必填,Dify API 密钥
DIFY_API_BASE=https://your-dify-url      # Dify API 地址,默认为 https://cloud.dify.ai
DIFY_USER_ID=your_user_id                # 用户 ID,用于识别请求用户
DIFY_DESC=搜索BI相关内容                    # 工具描述,默认为"执行工作流"

1. 启动服务

在目录下运行以下脚本

dify-mcp-sse-server
dify-mcp-sse-server & #后台运行

服务将在 http://localhost:3001 上启动。

2. 客户端使用

在支持SSE的MCP客户端使用如下URL:

http://localhost:3001/sse

方式二:使用 stdio 本地运行

stdio 模式适合在本地直接使用,常用于开发测试或与其他支持 stdio 通信的应用集成。

{
  "mcpServers": {
    "BI Search": {
      "command": "npx",
      "args": [
        "-y",
        "@liangshen/dify-mcp-server"
      ],
      "env": {
        "DIFY_DESC": "搜索BI相关内容",
        "DIFY_API_KEY": "xxx",
        "DIFY_API_BASE": "xxx",
        "DIFY_USER_ID": "your_user_id"
      }
    }
  }
}

在 stdio 模式下,程序将通过标准输入/输出与调用程序通信。

开发与构建

# 安装依赖
npm install

# 构建项目
npm run build

# 启动 SSE 服务
npm start

许可证

ISC

作者

Wang Liang [email protected]