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 從公開儲存庫中收錄這些內容。

檢舉或申請下架