📊airtable-cli
- プラグイン
- airtable
- ライセンス
- MIT
- ソース
- GitHub で見る ↗
説明
`airtable-mcp` CLI を通じて、Airtableのベース一覧取得、レコードの読み書き、テーブルおよびフィールドの管理、データのフィルタリングや検索を行います。 次のような場合に使用: タスクがAirtableのデータに関係する場合、またはユーザーがairtable-mcp、ベース、テーブル、レコード、フィールドについて言及した場合。
原文を表示
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.
ユースケース
- ✓Airtableのベース一覧を取得する
- ✓レコードの読み書きを行う
- ✓テーブルやフィールドを管理する
- ✓データをフィルタリングや検索する
- ✓ユーザーがAirtableデータについて言及した
本文(日本語訳)
airtable-mcp
セルフディスカバリー
ToolはMCPサーバーから実行時に取得されるため、CLIにはコマンドのハードコードされたリストがありません。 利用可能なToolを確認するには:
airtable-mcp tools # 人が読みやすい形式のリスト
airtable-mcp tools --json # 機械処理向けのリスト
airtable-mcp <tool> --help # 各Toolのフラグと説明を表示
Toolの存在を前提とする前に、必ず airtable-mcp tools を実行してください。
Tool名・引数・出力の形式は、CLIを更新しなくてもサーバーのリリースによって変わる場合があります。
インストール
npm install -g @airtable/mcp-cli
認証
CLIにはAirtableのパーソナルアクセストークン(PAT)が必要です。設定方法は2通りあります。
環境変数(スクリプト/Agentへの利用に推奨):
export AIRTABLE_TOKEN=pat_xxx
インタラクティブな設定(トークンを ~/.airtable/cli.json にパーミッション0600で保存):
airtable-mcp configure
トークンは https://airtable.com/create/tokens で作成してください。 呼び出すToolに必要なスコープがトークンに付与されていることを確認してください。
--profile フラグを指定しない場合、AIRTABLE_TOKEN は保存済みプロファイルより優先されます。
トークンをログ出力・echoしないよう注意してください。
クイックリファレンス
| タスク | コマンド |
|---|---|
| 認証情報の設定 | airtable-mcp configure |
| 名前付きプロファイルの追加 | airtable-mcp configure --profile work |
| 認証状態の確認 | airtable-mcp whoami |
| 認証情報の削除 | airtable-mcp logout |
| すべてのプロファイルを削除 | airtable-mcp logout --all |
| 利用可能なToolの一覧 | airtable-mcp tools |
| Toolの実行 | airtable-mcp <tool> --flagName value |
| Toolのヘルプ表示 | airtable-mcp <tool> --help |
| stdinから引数を渡す | echo '{"key":"val"}' | airtable-mcp <tool> --input - |
| Toolキャッシュをバイパス | airtable-mcp <tool> --refresh |
| ステータスメッセージを抑制 | airtable-mcp <tool> -q |
| テキストをそのまま出力 | airtable-mcp <tool> --output raw |
| 特定のプロファイルを使用 | airtable-mcp <tool> --profile work |
Tool名はCLI上ではハイフン区切り(list-records)ですが、MCP上ではアンダースコア区切り(list_records)になります。
CLIが自動的に変換します。
ワークフロー
- 認証 —
AIRTABLE_TOKENを設定するか、airtable-mcp configureを実行 - ディスカバリー —
airtable-mcp toolsを実行して利用可能なToolを確認 - インスペクション —
airtable-mcp <tool> --helpでフラグと説明を確認 - アクセス確認 —
tools --jsonの出力にあるaccessフィールドを確認:read-only(読み取り専用)、write(書き込み)、destructive(破壊的操作)のいずれか。destructiveなToolを実行する前には必ずユーザーに確認を取ること。 - 実行 —
airtable-mcp <tool> --flagName valueを実行
出力と自動化
- デフォルト出力はstdoutへのフォーマット済みJSON。ステータスメッセージはstderrへ出力されます。
toolsに--jsonを付けると、{name, title, access}のJSON配列を返します。-q/--quietでstderrのステータスメッセージ(キャッシュ警告など)を抑制します。--output rawはJSONをパースせず、サーバーからのレスポンステキストをそのまま返します。--input -はフラグのパースをバイパスし、stdinからJSONオブジェクトとしてTool引数を読み込みます。- 終了コード:
0成功、1エラー(認証・Tool失敗・未発見)、2使用方法エラー(不正なフラグ・不正な入力)。
よくあるタスク
ベースを検索してテーブルを一覧表示:
airtable-mcp search-bases --searchQuery "Project Tracker" -q
airtable-mcp list-tables-for-base --baseId appEXAMPLEbase001 -q
特定フィールドのレコードを一覧表示:
airtable-mcp list-records-for-table \
--baseId appEXAMPLEbase001 --tableId tblEXAMPLEtable01 \
--fieldIds '["Name","Status"]' --pageSize 10 -q
レコードのフィルタリング —
フィルターはフォーミュラ文字列ではなく、構造化されたJSONを使用します。
条件は operands 配列でラップしてください。省略した場合、トップレベルの operator はデフォルトで and になります:
airtable-mcp list-records-for-table \
--baseId appEXAMPLEbase001 --tableId tblEXAMPLEtable01 \
--filters '{"operator":"and","operands":[{"operator":"=","operands":["Status","Done"]}]}' -q
選択フィールドでフィルタリングする際は、表示名ではなく(get-table-schema で取得できる)チョイスIDを使用してください。
複合フィルター・日付フィルター・フィールド型別の演算子については、airtable-filters skillを参照してください。
レコードの検索 —
大規模なテーブルへの自由テキスト/あいまい検索には search-records を使用し、
特定フィールドの値で絞り込む場合は list-records-for-table に --filters を使用します:
airtable-mcp search-records \
--baseId appEXAMPLEbase001 --table tblEXAMPLEtable01 \
--query "acme" --fields '["Name","Notes"]' -q
すべてのインデックス済みフィールドを横断して検索するには --fields ALL_SEARCHABLE_FIELDS を渡してください。
日付・評価・チェックボックス・ボタンフィールドは検索対象外です。
レコードの更新 —
複雑な引数は --input - を使うと簡単です:
echo '{"baseId":"appEXAMPLEbase001","tableId":"tblEXAMPLEtable01","records":[{"id":"recEXAMPLErecord1","fields":{"fldEXAMPLEfield01":"Done"}}]}' \
| airtable-mcp update-records-for-table --input - -q
選択フィールドの値は読み取り時にはオブジェクト形式({"id":"sel...","name":"Done"})で返されますが、
書き込み時は文字列("Done")で指定する必要があります。
作成・更新時のレコードフィールドキーは現在フィールドID(fldEXAMPLEfield02)が必要です。
書き込む前に get-table-schema で名前からIDを解決してください。
なお、fieldIds・sort・filters は名前とIDのどちらも受け付けます。
よくある落とし穴
| 問題 | 原因 | 対処法 |
|---|---|---|
Unknown tool: X |
Tool名がサーバーに存在しないか、キャッシュが古い | airtable-mcp tools --refresh でキャッシュを更新して再試行 |
Authentication failed |
トークンの期限切れ・失効・誤り | airtable-mcp configure を実行するか AIRTABLE_TOKEN を確認 |
Access denied |
トークンに必要なスコープが不足 | https://airtable.com/create/tokens でスコープを追加 |
Connection timed out |
サーバーに到達不能(タイムアウト10秒) | ネットワークを確認。利用可能であれば古いキャッシュにフォールバックされます |
| ブールフラグに値を渡している | --dryRun true とすると "true" が次の引数として渡される |
--dryRun のみを指定する(ブール値は存在ベースで判定) |
| 配列/オブジェクト引数が失敗する | 値が有効なJSONでない | JSON文字列として渡す: --fieldMappings '{"a":"b"}' |
| トップレベルでフィルターが拒否される | operands でラップせずに単一条件を渡している |
{"operands":[...]} でラップする(operator はデフォルトで and) |
ソートキーが field ではなく fieldId |
--sort '[{"field":"Name"}]' は黙って無視される |
{"fieldId":"Name","direction":"asc"} を使用(フィールドIDまたは名前を受け付ける) |
| 選択フィルターが一致しない | 表示名でフィルタリングしている | 先に get-table-schema を実行して sel... 形式のチョイスIDを取得 |
バッチ書き込みで INVALID_RECORDS |
バッチ上限はリクエストあたり10件(デフォルト値。アカウントにより異なる) | 10件以下のチャンクに分割し、<tool> --help で現在の上限を確認 |
list-records-for-table でパーミッションエラー |
ユーザーがそのベースにインターフェース専用でアクセスしている | 代わりに list-records-for-page / get-record-for-page を使用 |
| エンドポイントが制限されている | CLIは *.airtable.com へのHTTPSのみ許可 |
任意のサーバーに向けることはできません(セキュリティ上の制約) |
原文(English)を表示
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:
airtable-mcp tools # human-readable list
airtable-mcp tools --json # machine-parseable list
airtable-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
npm install -g @airtable/mcp-cli
Auth
The CLI needs an Airtable personal access token (PAT). Two paths:
Environment variable (preferred for scripts/agents):
export AIRTABLE_TOKEN=pat_xxx
Interactive configure (stores token in ~/.airtable/cli.json with 0600 permissions):
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
| Task | Command |
|---|---|
| Set up credentials | airtable-mcp configure |
| Add a named profile | airtable-mcp configure --profile work |
| Check auth status | airtable-mcp whoami |
| Remove credentials | airtable-mcp logout |
| Remove all profiles | airtable-mcp logout --all |
| List available tools | airtable-mcp tools |
| Run a tool | airtable-mcp <tool> --flagName value |
| Get tool help | airtable-mcp <tool> --help |
| Pass args via stdin | echo '{"key":"val"}' | airtable-mcp <tool> --input - |
| Bypass tool cache | airtable-mcp <tool> --refresh |
| Suppress status msgs | airtable-mcp <tool> -q |
| Raw text output | airtable-mcp <tool> --output raw |
| Use a specific profile | airtable-mcp <tool> --profile work |
Tool names use hyphens on the CLI (list-records) but underscores in MCP (list_records). The CLI translates automatically.
Workflow
- Auth — set
AIRTABLE_TOKENor runairtable-mcp configure - Discover — run
airtable-mcp toolsto see available tools - Inspect — run
airtable-mcp <tool> --helpfor flags and descriptions - Check access — in
tools --jsonoutput, check theaccessfield:read-only,write, ordestructive. Confirm with the user before runningdestructivetools. - Execute — run
airtable-mcp <tool> --flagName value
Output & automation
- Default output is formatted JSON to stdout. Status messages go to stderr.
--jsonontoolsgives a JSON array of{name, title, access}.-q/--quietsuppresses stderr status messages (cache warnings, etc).--output rawreturns the raw server response text instead of parsed JSON.--input -reads tool arguments as a JSON object from stdin, bypassing flag parsing.- Exit codes:
0success,1error (auth, tool failure, not found),2usage error (bad flags, bad input).
Common tasks
Find a base and list its tables:
airtable-mcp search-bases --searchQuery "Project Tracker" -q
airtable-mcp list-tables-for-base --baseId appEXAMPLEbase001 -q
List records with specific fields:
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:
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:
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 -:
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
| Problem | Cause | Fix |
|---|---|---|
Unknown tool: X |
Tool name doesn't exist on the server or cache is stale | Run airtable-mcp tools --refresh to refresh, then retry |
Authentication failed |
Token expired, revoked, or wrong | Run airtable-mcp configure or check AIRTABLE_TOKEN |
Access denied |
Token missing required scopes | Add scopes at https://airtable.com/create/tokens |
Connection timed out |
Server unreachable (10s timeout) | Check network; CLI falls back to stale cache if available |
| Boolean flags take no value | --dryRun true passes "true" as next arg |
Use --dryRun alone (booleans are presence-based) |
| Array/object args fail | Value isn't valid JSON | Pass as JSON string: --fieldMappings '{"a":"b"}' |
| Filter rejected at top level | Single condition passed without operands wrapper |
Wrap in {"operands":[...]} (operator defaults to and) |
Sort key is fieldId not field |
--sort '[{"field":"Name"}]' silently ignored |
Use {"fieldId":"Name","direction":"asc"} — accepts field IDs or names |
| Select filter returns no matches | Filtering by display name instead of choice ID | Run get-table-schema first to get sel... choice IDs |
INVALID_RECORDS on batch write |
Batch 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-table |
User has interface-only access to the base | Use list-records-for-page / get-record-for-page instead |
| Endpoints restricted | CLI only allows HTTPS on *.airtable.com |
Cannot point at arbitrary servers (security constraint) |
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。