Lark Helper MCP Server
一个用于 Lark (飞书) 集成的 Model Context Protocol (MCP) 服务器。
功能特性
- 🚀 基于 FastMCP 构建的高性能 MCP 服务器
- 📱 支持向飞书用户和群聊发送文本消息
- 🔐 安全的环境变量配置管理
- 🛠 支持多种安装和运行方式
环境要求
- Python 3.12+
- 有效的飞书应用凭据(App ID 和 App Secret)
安装
方法一:使用 uvx(推荐)
# 临时运行
uvx lark-helper-mcp
# 或永久安装
uv tool install lark-helper-mcp
方法二:使用 pip
pip install lark-helper-mcp
方法三:开发安装
git clone <repository-url>
cd lark-helper-mcp
uv sync
uv run python main.py
配置
在运行之前,需要设置以下环境变量:
export LARK_APP_ID=your_app_id_here
export LARK_APP_SECRET=your_app_secret_here
或者创建 .env 文件:
LARK_APP_ID=your_app_id_here
LARK_APP_SECRET=your_app_secret_here
获取飞书应用凭据
- 访问 飞书开放平台
- 创建一个新的应用或选择现有应用
- 在应用详情页面获取 App ID 和 App Secret
- 确保应用有发送消息的权限
使用方法
作为独立服务器运行
# 使用 uvx
uvx lark-helper-mcp
# 或使用已安装的命令
lark-helper-mcp
# 或使用 Python 模块
python -m lark_helper_mcp
在 Claude Desktop 中使用
在 Claude Desktop 的配置文件中添加:
{
"mcpServers": {
"lark-helper": {
"command": "uvx",
"args": ["lark-helper-mcp"],
"env": {
"LARK_APP_ID": "your_app_id_here",
"LARK_APP_SECRET": "your_app_secret_here"
}
}
}
}
可用工具
send_text_message
向指定的飞书用户或群聊发送文本消息。
参数:
receive_id(string): 接收者 IDreceive_id_type(string): 接收者 ID 类型,支持:user_id: 用户 IDopen_id: Open IDchat_id: 群聊 ID
text_content(string): 要发送的文本内容
示例使用:
# 发送消息给用户
send_text_message(
receive_id="user123",
receive_id_type="user_id",
text_content="Hello from MCP!"
)
# 发送消息到群聊
send_text_message(
receive_id="oc_chat456",
receive_id_type="chat_id",
text_content="团队通知:会议将在10分钟后开始"
)
开发
环境设置
# 克隆仓库
git clone <repository-url>
cd lark-helper-mcp
# 创建虚拟环境并安装依赖
uv venv
uv sync
# 运行开发服务器
uv run python main.py
代码质量检查
# 运行 linter
ruff check
# 格式化代码
ruff format
构建和发布
# 构建包
uv build
# 发布到 PyPI(需要配置 PyPI 凭据)
twine upload dist/*
许可证
MIT License - 详见 LICENSE 文件。
贡献
欢迎提交 Issue 和 Pull Request!
支持
如有问题,请在 GitHub Issues 中提出。
Metadata
Release files for lark-helper-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lark_helper_mcp-0.1.0.tar.gz | 5.8 kB | Without provenance | Details for lark_helper_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lark_helper_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for lark_helper_mcp-0.1.0-py3-none-any.whl |
Total release size: 12.2 kB
Release files / lark_helper_mcp-0.1.0.tar.gz
| Download URL | lark_helper_mcp-0.1.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f6e7c140c3e5d3285be11ef04327b0c8e4e1a157fb1ea64d641bdca14f0f3cb
|
|
BLAKE2b-256 checksum How to use checksums |
8c85de58054fb37dd9ef1b0278d36b8e3cf3a73e44de9080a15a33efbc34330d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / lark_helper_mcp-0.1.0-py3-none-any.whl
| Download URL | lark_helper_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef18e7bff9725b04011f56bf0de35f6f86e5016a1f559860099399e3095d273e
|
|
BLAKE2b-256 checksum How to use checksums |
b61b175ab6280583f072b8eed08274ec31d1993a513e3d1f3217282a08e8d33f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for lark-helper-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.