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

@pengian/feishu-bot-server

v1.0.1

Published

A Feishu bot MCP server to send messages to feishu

Readme

Feishu MCP Server

一个基于 MCP (Model Context Protocol) 的飞书机器人服务器,支持通过 Webhook 发送消息到飞书。

功能特点

  • 支持通过 Webhook 发送消息到飞书
  • 支持多种传输协议(stdio/SSE)
  • 自动端口选择,避免端口冲突
  • 支持多种文本样式:
    • 加粗:**text**
    • 斜体:*text*
    • 删除线:~~text~~
    • 行内代码:`code`
    • 链接:[text](url)
    • 换行:\n
    • 引用:> text
    • 字体颜色:<font color='green'>绿色文本</font>

安装

  1. 安装依赖:
npm install
  1. 构建项目:
# 构建 stdio 版本
npm run build:stdio

# 构建 SSE 版本
npm run build:sse

配置

环境变量

项目使用 .env 文件管理环境变量。你可以复制 .env.example 文件并重命名为 .env

cp .env.example .env

然后编辑 .env 文件,配置以下环境变量:

  • FEISHU_WEBHOOK_URL:飞书机器人的 Webhook URL(必需)
  • PORT:SSE 传输协议的起始端口(默认:3000

你也可以在运行时通过命令行设置环境变量:

# stdio 模式
export FEISHU_WEBHOOK_URL=your_webhook_url
node dist/stdio/index.js

# SSE 模式
export FEISHU_WEBHOOK_URL=your_webhook_url
export PORT=3000
node dist/sse/index.js

获取飞书 Webhook URL

  1. 登录飞书

  2. 创建机器人应用

工作台

创建机器人

配置webHook

获取webHook URL

配置消息发送

配置消息发送变量

  1. 获取步骤2的webHook URL,并配置到 env 环境变量中

使用方法

使用 stdio 传输协议(推荐)

{
  "mcpServers": {
    "feishu-bot-server": {
      "command": "npx",
      "args": [
        "@pengian/feishu-bot-server"
      ],
      "env": {
        "FEISHU_WEBHOOK_URL": "<your_webhook_url>"
      },
      "transportType": "stdio"
    }
  }
}

使用 SSE 传输协议(未完成)

export FEISHU_WEBHOOK_URL=your_webhook_url
export PORT=3000  # 可选,默认从3000开始寻找可用端口
node dist/sse/index.js

发送消息示例

// 发送文本消息
{
  "name": "send_message",
  "arguments": {
    "subject": "测试消息",
    "content": "这是一条**加粗**的测试消息\n> 这是一段引用\n<font color='green'>这是绿色文本</font>"
  }
}

开发

项目结构

src/
  ├── core/           # 核心业务逻辑
  │   └── FeishuService.ts
  ├── transport/      # 传输协议实现
  │   ├── Transport.ts
  │   ├── StdioTransport.ts
  │   └── SseTransport.ts
  ├── stdio/          # stdio 入口
  │   └── index.ts
  └── sse/            # SSE 入口
      └── index.ts

开发命令

  • npm run build:stdio:构建 stdio 版本
  • npm run build:sse:构建 SSE 版本
  • npm run build:构建所有版本
  • npm run dev:stdio:开发模式运行 stdio 版本
  • npm run dev:sse:开发模式运行 SSE 版本
  • npm test:运行测试
  • npm run lint:代码检查

贡献

欢迎提交 Issue 和 Pull Request!

许可证

MIT