Skip to main content

A Feishu bot using MCP (Model Context Protocol)

Project description

Feishu MCP Server

集成飞书(Lark)的 MCP 服务器,支持消息、Drive 与多维表(Bitable)操作。

新增 Bitable 字段相关工具

已注册以下 MCP 工具:

  • bitable_query_fields(app_token, table_id)

    • 获取指定表的所有字段信息,返回 Markdown。
    • 示例:
      {
        "tool": "bitable_query_fields",
        "args": {"app_token": "bitable_app_token_xxx", "table_id": "tbl_xxx"}
      }
      
  • bitable_upsert_fields(app_token, table_id, fields)

    • 批量新增或更新字段(Upsert):
      • 若对象包含 field_id 则更新;
      • 若无 field_id 但提供 field_name 且同名字段存在,则更新;
      • 其他情况为新增。
    • 字段对象示例:
      [
        {"field_name": "状态", "type": 3, "property": {"options": [{"name": "Open"}, {"name": "Closed"}]}},
        {"field_id": "fld_123", "field_name": "负责人", "type": 11, "description": "任务负责人"}
      ]
      
    • 调用示例:
      {
        "tool": "bitable_upsert_fields",
        "args": {"app_token": "bitable_app_token_xxx", "table_id": "tbl_xxx", "fields": [/* 如上 */]}
      }
      
  • bitable_delete_fields(app_token, table_id, field_ids=None)

    • 批量删除字段:仅支持通过 field_ids 指定。
    • 调用示例:
      {
        "tool": "bitable_delete_fields",
        "args": {"app_token": "bitable_app_token_xxx", "table_id": "tbl_xxx", "field_ids": ["fld_1", "fld_2"]}
      }
      

新增 Bitable 表创建工具(Create-only)

  • bitable_create_table(app_token, table_name, fields=None)
    • 仅创建数据表:
      • 若同名表已存在:返回存在提示,不进行任何字段更新。
      • 若不存在同名表:创建新表。fields 参数将被忽略,请使用 bitable_upsert_fields 管理字段。
    • 调用示例:
      {
        "tool": "bitable_create_table",
        "args": {"app_token": "bitable_app_token_xxx", "table_name": "任务列表"}
      }
      

环境变量

在运行前确保配置:

  • FEISHU_APP_ID
  • FEISHU_APP_SECRET

注意事项

  • type 需使用飞书多维表字段类型编码(如:3=单选、4=多选、11=人员等)。
  • 批量新增/更新会拉取已有字段以做名称到 ID 匹配,字段很多时请求耗时会增长。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_feishu_bot-0.2.1.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_feishu_bot-0.2.1-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_feishu_bot-0.2.1.tar.gz.

File metadata

  • Download URL: mcp_feishu_bot-0.2.1.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for mcp_feishu_bot-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7acfaf9cc746f29db3c2c8c9ffa306eb020fbb17447bdf9ec8fa8ddfa589c136
MD5 f9175fafe223fa1592b0a17c5322a884
BLAKE2b-256 c41d2ac30a00bace3cf85a5f1918bd84915535f745db98acbd5399c6513c5e9b

See more details on using hashes here.

File details

Details for the file mcp_feishu_bot-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_feishu_bot-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for mcp_feishu_bot-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 24e0c261c1c70ae6fe6e8a9cdae89e254d5b9c92c1528d1fa89d1308ebf7a492
MD5 f558e366c24ed262c6e2a65e5a73df41
BLAKE2b-256 da2ce149724bb4e0d905d5c5a58604eb15f9b361aff022bccd97de8b52a3f13c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page