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 🙏

© 2025 – Pkg Stats / Ryan Hefner

feishu-bitable

v1.0.10

Published

飞书多维表格 MCP 服务器

Readme

飞书多维表格 MCP 服务器

这是一个基于 Node.js 的 MCP (Model Context Protocol) 服务器实现,用于管理飞书多维表格。

功能特性

基础表格操作

  • ✅ 创建多维表格 (create_table)
  • ✅ 添加记录 (add_record)
  • ✅ 查询记录 (query_records)
  • ✅ 更新记录 (update_record)
  • ✅ 删除记录 (delete_record)

飞书多维表格API操作

  • ✅ 获取访问令牌 (get_access_token)
  • ✅ 搜索记录 (search_records)
  • ✅ 获取记录详情 (get_record)
  • ✅ 创建记录 (create_record)
  • ✅ 更新记录 (update_record)
  • ✅ 删除记录 (delete_record)
  • ✅ 创建表格 (create_table)

安装

npm install

使用

启动服务器

npm start

或直接运行:

node feishu-bitable.js

工具说明

1. create_table - 创建表格

参数:

  • name (string): 表格名称
  • fields (array): 字段定义数组
    • name (string): 字段名称
    • type (string): 字段类型

示例:

{
  "name": "create_table",
  "arguments": {
    "name": "学生信息表",
    "fields": [
      { "name": "学号", "type": "text" },
      { "name": "姓名", "type": "text" },
      { "name": "年级", "type": "number" }
    ]
  }
}

2. add_record - 添加记录

参数:

  • table_id (string): 表格 ID
  • data (object): 记录数据

示例:

{
  "name": "add_record",
  "arguments": {
    "table_id": "table_1234567890",
    "data": {
      "学号": "2024001",
      "姓名": "张三",
      "年级": 1
    }
  }
}

3. query_records - 查询记录

参数:

  • table_id (string): 表格 ID
  • filter (object, 可选): 过滤条件
  • limit (number, 可选): 返回限制,默认 100

示例:

{
  "name": "query_records",
  "arguments": {
    "table_id": "table_1234567890",
    "filter": { "年级": 1 },
    "limit": 50
  }
}

4. update_record - 更新记录

参数:

  • table_id (string): 表格 ID
  • record_id (string): 记录 ID
  • data (object): 要更新的数据

示例:

{
  "name": "update_record",
  "arguments": {
    "table_id": "table_1234567890",
    "record_id": "record_1234567890_abc123",
    "data": {
      "年级": 2
    }
  }
}

5. delete_record - 删除记录

参数:

  • table_id (string): 表格 ID
  • record_id (string): 记录 ID

示例:

{
  "name": "delete_record",
  "arguments": {
    "table_id": "table_1234567890",
    "record_id": "record_1234567890_abc123"
  }
}

飞书多维表格API工具

6. get_access_token - 获取访问令牌

参数:

  • appId (string): 应用的App ID
  • appSecret (string): 应用的App Secret
  • table_url (string): 表格URL

示例:

{
  "name": "get_access_token",
  "arguments": {
    "appId": "cli_xxxxxxxxxxxxxx",
    "appSecret": "xxxxxxxxxxxxxxxxxxxxx",
    "table_url": "https://xxxx.feishu.cn/base/xxxxxxxxxx?table=tblxxxxxxxxxx&view=vewxxxxxxxxxx"
  }
}

7. search_records - 搜索记录

参数:

  • tenantAccessToken (string): 租户级别的 access_token
  • appToken (string): 多维表格应用 token
  • tableId (string): 表格 ID
  • filter (object, 可选): 过滤条件
  • pageSize (number, 可选): 每页记录数(默认10)
  • pageToken (string, 可选): 分页token

示例:

{
  "name": "search_records",
  "arguments": {
    "tenantAccessToken": "t-xxxxxxxxxxxxxxxxxxxxx",
    "appToken": "app_xxxxxxxxxxxxxx",
    "tableId": "tblxxxxxxxxxx",
    "filter": { "字段名": "字段值" },
    "pageSize": 20
  }
}

8. get_record - 获取记录详情

参数:

  • tenantAccessToken (string): 租户级别的 access_token
  • appToken (string): 多维表格应用 token
  • tableId (string): 表格 ID
  • recordId (string): 记录 ID

示例:

{
  "name": "get_record",
  "arguments": {
    "tenantAccessToken": "t-xxxxxxxxxxxxxxxxxxxxx",
    "appToken": "app_xxxxxxxxxxxxxx",
    "tableId": "tblxxxxxxxxxx",
    "recordId": "recxxxxxxxxxx"
  }
}

9. create_record - 创建记录

参数:

  • tenantAccessToken (string): 租户级别的 access_token
  • appToken (string): 多维表格应用 token
  • tableId (string): 表格 ID
  • fields (object): 记录字段数据

示例:

{
  "name": "create_record",
  "arguments": {
    "tenantAccessToken": "t-xxxxxxxxxxxxxxxxxxxxx",
    "appToken": "app_xxxxxxxxxxxxxx",
    "tableId": "tblxxxxxxxxxx",
    "fields": {
      "姓名": "张三",
      "部门": "技术部"
    }
  }
}

10. update_record - 更新记录

参数:

  • tenantAccessToken (string): 租户级别的 access_token
  • appToken (string): 多维表格应用 token
  • tableId (string): 表格 ID
  • recordId (string): 记录 ID
  • fields (object): 要更新的字段数据

示例:

{
  "name": "update_record",
  "arguments": {
    "tenantAccessToken": "t-xxxxxxxxxxxxxxxxxxxxx",
    "appToken": "app_xxxxxxxxxxxxxx",
    "tableId": "tblxxxxxxxxxx",
    "recordId": "recxxxxxxxxxx",
    "fields": {
      "部门": "产品部"
    }
  }
}

11. delete_record - 删除记录

参数:

  • tenantAccessToken (string): 租户级别的 access_token
  • appToken (string): 多维表格应用 token
  • tableId (string): 表格 ID
  • recordId (string): 记录 ID

示例:

{
  "name": "delete_record",
  "arguments": {
    "tenantAccessToken": "t-xxxxxxxxxxxxxxxxxxxxx",
    "appToken": "app_xxxxxxxxxxxxxx",
    "tableId": "tblxxxxxxxxxx",
    "recordId": "recxxxxxxxxxx"
  }
}

测试客户端

可以使用提供的测试客户端来验证服务器功能:

node test-client.js

项目结构

.
├── feishu-bitable.js    # MCP 服务器主文件
├── test-client.js       # 测试客户端
├── package.json         # 项目配置
├── BITABLE_TOOLS_USAGE.md # 多维表格工具使用说明
├── auth/                # 认证模块
│   └── auth.js
├── bitable/             # 多维表格模块
│   └── bitable.js
├── log/                 # 日志模块
│   └── logger.js
├── wiki/                # Wiki模块
│   └── wiki.js
└── README.md           # 本文件

技术栈

  • Node.js: JavaScript 运行时
  • @modelcontextprotocol/sdk: MCP 官方 SDK

依赖

  • @modelcontextprotocol/sdk - MCP 通信框架

许可证

ISC