Airtable MCP Server 使用说明

项目简介

Airtable MCP Server 是一个 MCP (Model Context Protocol) 服务器,它扩展了 LLM (如 Claude) 的能力,使其能够与 Airtable 数据库进行交互。通过这个服务器,用户可以使用自然语言指令,让 LLM 客户端调用预设的工具,实现对 Airtable 数据库的查询、创建、更新和删除等操作。

主要功能点

  • Base 管理: 列出、创建和更新 Airtable Base (数据库)。
  • Table 管理: 列出、创建和更新 Airtable Table (表格)。
  • Field 管理: 在表格中创建和更新字段,支持多种字段类型。
  • Record 操作: 在表格中列出、创建、更新、删除和搜索记录。
  • 字段类型支持: 支持 Airtable 常见的字段类型,例如单行文本、多行文本、数字、单选、多选、日期、复选框、邮件、电话号码和货币等。

安装步骤

本服务器基于 Node.js 运行,推荐使用 'npx' 方法进行安装和配置,无需全局安装,方便快捷。

  1. 安装 Node.js: 确保你的电脑上已安装 Node.js (版本 18 或更高)。你可以从 nodejs.org 下载安装。安装完成后,在终端或命令提示符中运行 'node --version' 和 'npm --version' 验证安装是否成功。

  2. 获取 Airtable API 密钥:

    • 登录 Airtable 账户。
    • 访问 Airtable's Builder Hub 创建个人访问令牌 (Personal access token)。
    • 在创建令牌时,选择以下权限范围 (scopes):
      • 'data.records:read'
      • 'data.records:write'
      • 'schema.bases:read'
      • 'schema.bases:write'
    • 选择你要授权访问的工作区或 Base。
    • 复制并妥善保管你的 API 密钥。
  3. 配置 Claude Desktop:

    • 打开 Claude Desktop 应用程序。
    • 进入设置 (Settings) > 开发者 (Developer) > 编辑配置 (Edit Config)。
    • 这将打开 'claude_desktop_config.json' 配置文件。
    • 在 'mcpServers' 字段中添加或修改 'airtable' 服务器配置,将 'your_api_key_here' 替换为你刚刚获取的 Airtable API 密钥。

服务器配置 (claude_desktop_config.json)

{
  "mcpServers": {
    "airtable": {
      "command": "npx",
      "args": ["@felores/airtable-mcp-server"],
      "env": {
        "AIRTABLE_API_KEY": "your_api_key_here"  // 替换为你的 Airtable API 密钥
      }
    }
  }
}

配置参数说明:

  • '"server name"': '"airtable"',服务器在 Claude Desktop 中显示和引用的名称。
  • '"command"': '"npx"',用于启动服务器的命令,这里使用 'npx' 运行 npm 包。
  • '"args"': '["@felores/airtable-mcp-server"]',传递给 'npx' 的参数,指定要运行的 npm 包名称。
  • '"env"': 环境变量配置。
    • '"AIRTABLE_API_KEY"': 必须配置,用于 Airtable API 鉴权的密钥,请替换为你的实际 API 密钥。

基本使用方法

  1. 启动 Claude Desktop: 配置完成后,重启 Claude Desktop 应用程序。

  2. 验证连接: 在 Claude Desktop 中,你可以在 "Connected MCP Servers" 部分看到 "airtable-server" 是否已连接。

  3. 使用指令: 在 Claude Desktop 中,你可以使用自然语言指令来操作 Airtable。例如:

    • 'List all bases' (列出所有 Base)
    • 'List tables in base <base_id>' (列出指定 Base 中的所有表格,'<base_id>' 替换为实际 Base ID)
    • 'Create a table named "Projects" in base <base_id> with fields "Name: singleLineText", "Status: singleSelect"' (在指定 Base 中创建一个名为 "Projects" 的表格,包含 "Name" 和 "Status" 字段)

    你可以参考 "Features" 部分的 "Available Operations" 了解更多可用的指令。

请注意,你需要将指令中的 '<base_id>'、'<table_name>'、'<record_id>' 等占位符替换为你在 Airtable 中实际使用的 ID 或名称。你可以先使用 'List all bases' 和 'List tables' 等指令来获取相应的 ID 信息。

信息

分类

数据库与文件