Skip to main content

mcp-feishu

面向大语言模型与智能 Agent 的标准 Model Context Protocol (MCP) Server。

它的作用是为 AI 提供 send_to_feishu 工具,将长文本、运维命令、配置片段等内容以富文本卡片的形式推送到飞书自定义机器人群组中。用户在飞书客户端可以直接一键整段复制命令,无需在终端手动抄写。


特性

  • 标准协议支持:基于 Model Context Protocol Python SDK 实现,遵循 MCP 标准规范。
  • 零配置中心依赖:纯粹通过环境变量读取参数,不强绑定任何特定主机或配置中心(如 Nacos)。可跨机器无缝迁移部署。
  • 即装即用:支持直接通过 uvx mcp-feishu 或 pip install mcp-feishu 启动。
  • 安全与防泄露:内置敏感请求日志脱敏机制,确保 Webhook 凭据不打印至终端或日志。
  • 富文本排版:飞书交互式卡片渲染,支持 Markdown 与等宽代码块整段复制。

环境变量配置

本服务完全由环境变量控制,无需修改任何代码文件:

环境变量 必填 默认值 说明
FEISHU_WEBHOOK 是 无 飞书群自定义机器人的 Webhook 地址(形如 https://open.feishu.cn/open-apis/bot/v2/hook/...)
FEISHU_SECRET 否 空 机器人开启「签名校验」时的校验 Secret
FEISHU_TITLE 否 📋 来自 AI 的消息 发送卡片的默认标题

快速使用

1. Claude Desktop / Codex 配置 (推荐使用 uvx)

在你的客户端配置文件(如 claude_desktop_config.json 或 ~/.codex/config.toml)中加入配置:

JSON 格式 (Claude Desktop / Cursor 等)

{
  "mcpServers": {
    "feishu": {
      "command": "uvx",
      "args": ["mcp-feishu"],
      "env": {
        "FEISHU_WEBHOOK": "https://open.feishu.cn/open-apis/bot/v2/hook/YOUR_ROBOT_WEBHOOK_KEY",
        "FEISHU_SECRET": "YOUR_SECRET_IF_ENABLED"
      }
    }
  }
}

TOML 格式 (Codex 等)

[mcp_servers.feishu]
type = "stdio"
command = "uvx"
args = ["mcp-feishu"]

[mcp_servers.feishu.env]
FEISHU_WEBHOOK = "https://open.feishu.cn/open-apis/bot/v2/hook/YOUR_ROBOT_WEBHOOK_KEY"
FEISHU_SECRET = "YOUR_SECRET_IF_ENABLED"

2. 通过 pip 安装运行

pip install mcp-feishu
export FEISHU_WEBHOOK="https://open.feishu.cn/open-apis/bot/v2/hook/xxx"
mcp-feishu

提供的工具 (Tools)

send_to_feishu

向指定的飞书群机器人发送通知卡片。

  • 参数:
    • text (string, required): 消息正文。支持 Markdown;长命令或代码建议使用 ``` 包裹,以便在客户端整段复制。
    • title (string, optional): 卡片头部标题。留空时使用 FEISHU_TITLE 默认标题。
  • 返回:发送状态结果描述(例如 "已送达" 或失败原因)。

开源协议

MIT License

Metadata

Release files for mcp-feishu 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-feishu 0.1.0
File Size Uploaded
mcp_feishu-0.1.0.tar.gz 64.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-feishu 0.1.0
File Interpreter ABI Platform
mcp_feishu-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 69.5 kB

Release files / mcp_feishu-0.1.0.tar.gz

Download URL mcp_feishu-0.1.0.tar.gz
Size 64.1 kB
Tags Source
SHA-256 checksum
How to use checksums
63be729637e7659b90a2c52fc33845b65aabccb5d3c511fe9f26ca5703695a1e
BLAKE2b-256 checksum
How to use checksums
a1f68f763874dd09247e16d7e9521f812423a5cb7f2efa3a1d98b3f97f4195f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mcp_feishu-0.1.0-py3-none-any.whl

Download URL mcp_feishu-0.1.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b13b5f7ee4cfa6c30cc372a08d33826e3632288d7e450c086d5401cddacadc74
BLAKE2b-256 checksum
How to use checksums
56ac3ac4ac408a2c323618fa298fd4a5728f912e8f0d4ade7644927ee1a861dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page