Skip to main content
Glama

飞书MCP服务器

飞书(Feishu)MCP服务器 - 提供多维表格和电子表格的MCP工具

功能特性

  • ✅ 自动token管理(2小时有效期自动刷新)

  • ✅ 多维表格完整支持(9个工具)

  • ✅ 统一错误处理

  • ✅ JSON格式响应

已实现功能

多维表格(Bitable)

应用管理:

  • 创建多维表格应用

  • 复制多维表格应用

记录操作:

  • 创建/更新/查询记录

  • 批量创建/更新/获取/删除记录

  • 支持分页查询

电子表格(Sheets)

待实现(计划17个工具)

安装

1. 克隆项目

git clone <repository-url>
cd yuppie-mcp-feishu

2. 配置环境变量

复制环境变量模板:

cp .env.example .env

编辑 .env 文件,填入你的飞书应用凭证:

FEISHU_APP_ID=cli_xxxxxxxxxxxxx
FEISHU_APP_SECRET=xxxxxxxxxxxxxxxxxxxx

3. 安装依赖

uv sync

使用

测试运行

uv run python test_mcp.py

作为MCP服务器运行

uv run yuppie-mcp-feishu

或使用模块方式:

uv run python -m yuppie_mcp_feishu

Claude Desktop配置

在Claude Desktop配置文件中添加:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "feishu": {
      "command": "/path/to/yuppie-mcp-feishu/.venv/bin/python",
      "args": ["-m", "yuppie_mcp_feishu"],
      "env": {
        "FEISHU_APP_ID": "cli_xxxxxxxxxxxxx",
        "FEISHU_APP_SECRET": "xxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

注意:将 /path/to/yuppie-mcp-feishu 替换为实际项目路径。

可用工具

多维表格应用

create_bitable_app

创建新的多维表格应用

参数:

  • name (string): 多维表格名称

  • folder_token (string, 可选): 文件夹token

返回:JSON格式的应用信息

copy_bitable_app

复制多维表格应用

参数:

  • app_token (string): 要复制的应用token

  • name (string): 新应用名称

  • folder_token (string, 可选): 文件夹token

返回:JSON格式的应用信息

多维表格记录

create_bitable_record

创建单条记录

参数:

  • app_token (string): 多维表格token

  • table_id (string): 数据表ID

  • fields (dict): 记录字段

update_bitable_record

更新单条记录

参数:

  • app_token (string): 多维表格token

  • table_id (string): 数据表ID

  • record_id (string): 记录ID

  • fields (dict): 要更新的字段

search_bitable_records

查询记录(支持分页)

参数:

  • app_token (string): 多维表格token

  • table_id (string): 数据表ID

  • page_size (int, 可选): 每页记录数(1-500)

  • page_token (string, 可选): 分页token

  • filter (dict, 可选): 过滤条件

batch_create_bitable_records

批量创建记录(最多1000条)

参数:

  • app_token (string): 多维表格token

  • table_id (string): 数据表ID

  • records (list): 记录列表

batch_update_bitable_records

批量更新记录(最多1000条)

参数:

  • app_token (string): 多维表格token

  • table_id (string): 数据表ID

  • records (list): 记录列表(包含record_id和fields)

batch_get_bitable_records

批量获取记录(最多100条)

参数:

  • app_token (string): 多维表格token

  • table_id (string): 数据表ID

  • record_ids (list): 记录ID列表

batch_delete_bitable_records

批量删除记录

参数:

  • app_token (string): 多维表格token

  • table_id (string): 数据表ID

  • record_ids (list): 要删除的记录ID列表

项目结构

src/yuppie_mcp_feishu/
├── __init__.py              # 主入口点
├── config.py                # 配置管理
├── client.py                # 飞书客户端管理
├── exceptions.py            # 错误处理
└── tools/
    ├── __init__.py
    ├── bitable_app.py       # 多维表格应用工具
    └── bitable_record.py    # 多维表格记录工具

技术栈

  • Python: >= 3.10

  • 飞书SDK: lark-oapi >= 1.5.2

  • MCP框架: mcp[cli] >= 1.25.0

  • 包管理: UV

开发

运行测试

uv run python test_mcp.py

安装依赖

uv sync

添加新依赖

uv add <package-name>

参考资料

许可证

MIT License

贡献

欢迎提交Issue和Pull Request!

Available Tools

9 tools
batch_create_bitable_recordsC
    批量创建多维表格记录(最多1000条)

    参数:
        app_token: 多维表格的token
        table_id: 数据表ID
        records: 记录列表,每条记录是一个fields字典

    返回:
        创建的记录信息
    

Inputs: app_token (required), table_id (required), records (required). Returns: result

batch_delete_bitable_recordsC
    批量删除多维表格记录

    参数:
        app_token: 多维表格的token
        table_id: 数据表ID
        record_ids: 要删除的记录ID列表

    返回:
        删除结果
    

Inputs: app_token (required), table_id (required), record_ids (required). Returns: result

batch_get_bitable_recordsB
    批量获取多维表格记录(最多100条)

    参数:
        app_token: 多维表格的token
        table_id: 数据表ID
        record_ids: 记录ID列表

    返回:
        记录信息
    

Inputs: app_token (required), table_id (required), record_ids (required). Returns: result

batch_update_bitable_recordsC
    批量更新多维表格记录(最多1000条)

    参数:
        app_token: 多维表格的token
        table_id: 数据表ID
        records: 要更新的记录列表,每条记录包含record_id和fields

    返回:
        更新后的记录信息
    

Inputs: app_token (required), table_id (required), records (required). Returns: result

copy_bitable_appB
    复制多维表格应用

    参数:
        app_token: 要复制的多维表格token
        name: 新多维表格的名称
        folder_token: (可选) 文件夹token,指定创建位置

    返回:
        JSON格式的应用信息
    

Inputs: app_token (required), name (required), folder_token. Returns: result

create_bitable_appB
    创建多维表格应用

    参数:
        name: 多维表格名称
        folder_token: (可选) 文件夹token,指定创建位置

    返回:
        JSON格式的应用信息,包含app_token等
    

Inputs: name (required), folder_token. Returns: result

create_bitable_recordC
    在多维表格中创建单条记录

    参数:
        app_token: 多维表格的token
        table_id: 数据表ID
        fields: 记录字段字典,例如 {"text_field": "值", "number_field": 123}

    返回:
        创建的记录信息
    

Inputs: app_token (required), table_id (required), fields (required). Returns: result

search_bitable_recordsB
    查询多维表格记录(支持分页)

    参数:
        app_token: 多维表格的token
        table_id: 数据表ID
        page_size: 每页记录数(1-500)
        page_token: 分页token,首次查询为空
        filter: (可选) 过滤条件

    返回:
        记录列表和分页信息
    

Inputs: app_token (required), table_id (required), page_size, page_token, +1 more. Returns: result

update_bitable_recordC
    更新多维表格中的单条记录

    参数:
        app_token: 多维表格的token
        table_id: 数据表ID
        record_id: 记录ID
        fields: 要更新的字段字典

    返回:
        更新后的记录信息
    

Inputs: app_token (required), table_id (required), record_id (required), fields (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 9 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose focused on specific operations for Feishu's Bitable (multidimensional table) feature. The tools are well-differentiated by their action (create, delete, get, update, search, copy) and scope (single vs. batch operations), with no overlapping functionality that would cause confusion.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with 'bitable' as the common domain identifier (e.g., create_bitable_record, batch_update_bitable_records). The naming is uniform, using snake_case throughout, making it predictable and easy to understand the tool's purpose at a glance.

    Tool Count5/5

    With 9 tools, this server is well-scoped for managing Feishu Bitable applications and records. It covers essential CRUD operations for both single and batch processing, along with app management (create and copy), which is appropriate for the domain without being overly complex or insufficient.

    Completeness5/5

    The tool set provides complete coverage for the Bitable domain, including full CRUD lifecycle for records (create, get, update, delete, search) in both single and batch forms, plus app creation and copying. There are no obvious gaps; agents can perform all expected operations without dead ends.

    Related MCP Connectors