Airtable Cli

作者 Airtable812ee67f1fd3MIT50 个星标收录于 2026年10月7日更新于 2026年10月7日仓库2个月前更新

Lists bases, reads and writes records, manages tables and fields, filters and searches data in Airtable via the `airtable-mcp` CLI. Use when the task involves Airtable data or the user mentions airtable-mcp, bases, tables, records, or fields.

AI 生成的概览

通过 airtable-mcp 命令行工具操作 Airtable 的数据库、数据表和记录。

功能
该技能说明如何使用 airtable-mcp CLI 列出数据库、查看表结构,以及读取、搜索、筛选、创建和更新 Airtable 记录。内容涵盖安装、令牌认证、运行时工具发现、输出与退出码行为,以及常用命令示例。它还列出针对工具缓存过期、权限范围不足、筛选条件或批量写入参数无效等错误的排查方法。
适用场景
当任务涉及 Airtable 数据,或用户提到 airtable-mcp、数据库、数据表、记录或字段时使用。它适合需要从命令行查询、筛选、搜索或修改 Airtable 内容的工作流程。
运行要求
需要 Node.js 和全局安装的 @airtable/mcp-cli 包,以及通过 AIRTABLE_TOKEN 环境变量或 configure 命令提供的 Airtable 个人访问令牌。需要访问 Airtable 的 HTTPS 端点。该技能仅包含说明,不附带脚本。

airtable-mcp

Self-discovery

Tools are fetched from the MCP server at runtime, so the CLI never has a hardcoded command list. Discover what's available:

sh
airtable-mcp tools            # human-readable listairtable-mcp tools --json     # machine-parseable listairtable-mcp <tool> --help    # show flags and descriptions for a tool

Run airtable-mcp tools before assuming a tool exists. Tool names, arguments, and output shapes can change between server releases without a CLI update.

Install

sh
npm install -g @airtable/mcp-cli

Auth

The CLI needs an Airtable personal access token (PAT). Two paths:

Environment variable (preferred for scripts/agents):

sh
export AIRTABLE_TOKEN=pat_xxx

Interactive configure (stores token in ~/.airtable/cli.json with 0600 permissions):

sh
airtable-mcp configure

Create tokens at https://airtable.com/create/tokens. Ensure the token has the scopes required by the tools being called.

AIRTABLE_TOKEN takes precedence over saved profiles when no --profile flag is set. Never log or echo tokens.

Quick reference

TaskCommand
Set up credentialsairtable-mcp configure
Add a named profileairtable-mcp configure --profile work
Check auth statusairtable-mcp whoami
Remove credentialsairtable-mcp logout
Remove all profilesairtable-mcp logout --all
List available toolsairtable-mcp tools
Run a toolairtable-mcp <tool> --flagName value
Get tool helpairtable-mcp <tool> --help
Pass args via stdinecho '{"key":"val"}' | airtable-mcp <tool> --input -
Bypass tool cacheairtable-mcp <tool> --refresh
Suppress status msgsairtable-mcp <tool> -q
Raw text outputairtable-mcp <tool> --output raw
Use a specific profileairtable-mcp <tool> --profile work

Tool names use hyphens on the CLI (list-records) but underscores in MCP (list_records). The CLI translates automatically.

Workflow

  1. Auth — set AIRTABLE_TOKEN or run airtable-mcp configure
  2. Discover — run airtable-mcp tools to see available tools
  3. Inspect — run airtable-mcp <tool> --help for flags and descriptions
  4. Check access — in tools --json output, check the access field: read-only, write, or destructive. Confirm with the user before running destructive tools.
  5. Execute — run airtable-mcp <tool> --flagName value

Output & automation

  • Default output is formatted JSON to stdout. Status messages go to stderr.
  • --json on tools gives a JSON array of {name, title, access}.
  • -q / --quiet suppresses stderr status messages (cache warnings, etc).
  • --output raw returns the raw server response text instead of parsed JSON.
  • --input - reads tool arguments as a JSON object from stdin, bypassing flag parsing.
  • Exit codes: 0 success, 1 error (auth, tool failure, not found), 2 usage error (bad flags, bad input).

Common tasks

Find a base and list its tables:

sh
airtable-mcp search-bases --searchQuery "Project Tracker" -qairtable-mcp list-tables-for-base --baseId appEXAMPLEbase001 -q

List records with specific fields:

sh
airtable-mcp list-records-for-table \  --baseId appEXAMPLEbase001 --tableId tblEXAMPLEtable01 \  --fieldIds '["Name","Status"]' --pageSize 10 -q

Filter records — filters use structured JSON, not formula strings. Wrap conditions in an operands array; the top-level operator defaults to and if omitted:

sh
airtable-mcp list-records-for-table \  --baseId appEXAMPLEbase001 --tableId tblEXAMPLEtable01 \  --filters '{"operator":"and","operands":[{"operator":"=","operands":["Status","Done"]}]}' -q

For select fields, filter by choice ID (from get-table-schema), not the display name. The airtable-filters skill covers compound filters, date filters, and operator-by-field-type details.

Search records — use search-records for free-text/fuzzy queries on large tables. Use list-records-for-table with --filters when filtering by exact field values:

sh
airtable-mcp search-records \  --baseId appEXAMPLEbase001 --table tblEXAMPLEtable01 \  --query "acme" --fields '["Name","Notes"]' -q

Pass --fields ALL_SEARCHABLE_FIELDS to search across every indexed field. Date, rating, checkbox, and button fields are not searchable.

Update records — complex args are easier via --input -:

sh
echo '{"baseId":"appEXAMPLEbase001","tableId":"tblEXAMPLEtable01","records":[{"id":"recEXAMPLErecord1","fields":{"fldEXAMPLEfield01":"Done"}}]}' \  | airtable-mcp update-records-for-table --input - -q

Select field values are returned as objects ({"id":"sel...","name":"Done"}) but must be written as plain strings ("Done"). Record field keys in create/update currently require field IDs (fldEXAMPLEfield02) — use get-table-schema to resolve names to IDs before writing. Note that fieldIds, sort, and filters accept both names and IDs.

Gotchas

ProblemCauseFix
Unknown tool: XTool name doesn't exist on the server or cache is staleRun airtable-mcp tools --refresh to refresh, then retry
Authentication failedToken expired, revoked, or wrongRun airtable-mcp configure or check AIRTABLE_TOKEN
Access deniedToken missing required scopesAdd scopes at https://airtable.com/create/tokens
Connection timed outServer unreachable (10s timeout)Check network; CLI falls back to stale cache if available
Boolean flags take no value--dryRun true passes "true" as next argUse --dryRun alone (booleans are presence-based)
Array/object args failValue isn't valid JSONPass as JSON string: --fieldMappings '{"a":"b"}'
Filter rejected at top levelSingle condition passed without operands wrapperWrap in {"operands":[...]} (operator defaults to and)
Sort key is fieldId not field--sort '[{"field":"Name"}]' silently ignoredUse {"fieldId":"Name","direction":"asc"} — accepts field IDs or names
Select filter returns no matchesFiltering by display name instead of choice IDRun get-table-schema first to get sel... choice IDs
INVALID_RECORDS on batch writeBatch limit is 10 records per request (default; varies by account)Split into chunks of ≤10 and check <tool> --help for the current limit
Permission error on list-records-for-tableUser has interface-only access to the baseUse list-records-for-page / get-record-for-page instead
Endpoints restrictedCLI only allows HTTPS on *.airtable.comCannot point at arbitrary servers (security constraint)

来源与署名

来源:Airtable/skills位于plugins/airtable/skills/airtable-cli提交812ee67

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架