12 KiB
Query Airtable data from ChatGPT using an MCP server
https://n8nworkflows.xyz/workflows/query-airtable-data-from-chatgpt-using-an-mcp-server-13458
Query Airtable data from ChatGPT using an MCP server
disclaimer Le texte fourni provient exclusivement d’un workflow automatisé réalisé avec n8n, un outil d’intégration et d’automatisation. Ce traitement respecte strictement les politiques de contenu en vigueur et ne contient aucun élément illégal, offensant ou protégé. Toutes les données manipulées sont légales et publiques.
1. Workflow Overview
This workflow turns n8n into an MCP (Model-Client-Protocol) server that exposes Airtable search capabilities as AI tools. External AI clients (e.g., ChatGPT with Developer Mode enabled or a custom GPT) can connect to the MCP endpoint and query Airtable tables using natural language; the client then calls the appropriate tool(s) hosted by this n8n workflow.
1.1 MCP Server Entry Point (Tool Host)
- Provides an MCP endpoint (webhook-like URL) that an AI client connects to.
- Registers n8n “AI Tool” nodes (Airtable search tools) so the client can call them.
1.2 Airtable Search Tools (Data Access Layer)
- Two Airtable Tool nodes are exposed:
- Search Contacts table
- Search Companies table
- Each tool performs a search operation against the configured base/table.
1.3 Documentation / Operator Notes
- Sticky notes describe setup steps (Airtable token scopes, configuring n8n credentials, and connecting ChatGPT to the MCP URL).
- Includes a link to a video walkthrough.
2. Block-by-Block Analysis
Block A — MCP Server Entry Point (Tool Registration + Endpoint)
Overview:
Creates the MCP server endpoint in n8n and acts as the host/registry for AI tools. External AI clients connect to this endpoint and can invoke the registered Airtable tools.
Nodes Involved:
- Airtable CRM MCP Trigger
Node: Airtable CRM MCP Trigger
- Type / Role:
@n8n/n8n-nodes-langchain.mcpTrigger— MCP server trigger node; exposes an MCP endpoint and receives tool calls from an MCP-capable client. - Key configuration (interpreted):
- Path/Webhook ID:
20c5d050-e533-469d-a15e-98da73e32cf7
This becomes part of the MCP URL path used by clients.
- Path/Webhook ID:
- Connections:
- Inputs: Receives tool invocations from an MCP client (not a traditional n8n wire input).
- Outputs: Not used as a typical “data output” node here; instead it collects tool definitions via the special
ai_toolconnections from the Airtable Tool nodes.
- Version-specific requirements:
- Uses typeVersion 2; requires an n8n version that includes the LangChain/MCP nodes (
@n8n/n8n-nodes-langchain).
- Uses typeVersion 2; requires an n8n version that includes the LangChain/MCP nodes (
- Edge cases / failure modes:
- Client cannot connect if the workflow is not active/published or if networking/reverse proxy blocks the endpoint.
- Wrong URL (test vs production URL) or wrong path leads to 404/connection errors.
- If no tools are connected via
ai_tool, the MCP server will expose no useful actions. - Authentication/authorization to the n8n instance (if configured) may block external clients unless allowed.
- Sub-workflow reference: None (this workflow does not call other workflows).
Block B — Airtable Search Tools (Contacts + Companies)
Overview:
Defines two Airtable-backed tools that an AI client can call. Each tool searches a specific table in a specific base using the Airtable Personal Access Token configured in n8n.
Nodes Involved:
- Search Contacts
- Search Companies
Node: Search Contacts
- Type / Role:
n8n-nodes-base.airtableTool— Airtable node configured as an AI tool so the MCP server can expose it to the AI client. - Key configuration (interpreted):
- Operation:
search - Base: “Contacts (YT n8n Tutorial Base)” (
app1bfDNQWWNpiwal) - Table: “Contacts” (
tblubuxXAzrkV59GY) - Options: empty/default (no extra filters/options configured in this workflow JSON)
- Operation:
- Credentials:
- Uses Airtable Personal Access Token credential:
Airtable Personal Access Token account - Token must have appropriate scopes (see sticky note): read/write records and schema read.
- Uses Airtable Personal Access Token credential:
- Connections:
- Output (ai_tool): Connected to Airtable CRM MCP Trigger via the
ai_toolchannel, registering this node as a callable tool. - No standard data input is wired; parameters are driven by the tool call payload from the MCP client.
- Output (ai_tool): Connected to Airtable CRM MCP Trigger via the
- Version-specific requirements:
- Uses typeVersion 2.1 of the Airtable Tool node.
- Edge cases / failure modes:
- 401/403 if token is invalid or missing required scopes.
- 404/base/table not found if base/table IDs don’t exist or were changed.
- Schema mismatch if the client searches using fields that don’t exist (depending on how the tool constructs its query internally).
- Rate limits from Airtable if many searches are executed rapidly.
- Empty results are valid outcomes and should be handled by the calling AI client.
Node: Search Companies
- Type / Role:
n8n-nodes-base.airtableTool— second Airtable AI tool for a different table. - Key configuration (interpreted):
- Operation:
search - Base: “Contacts (YT n8n Tutorial Base)” (
app1bfDNQWWNpiwal) - Table: “Companies” (
tblih4kyMEc5y5Fsx) - Options: empty/default
- Operation:
- Credentials:
- Same Airtable Personal Access Token credential as above.
- Connections:
- Output (ai_tool): Connected to Airtable CRM MCP Trigger via the
ai_toolchannel.
- Output (ai_tool): Connected to Airtable CRM MCP Trigger via the
- Version-specific requirements:
- Uses typeVersion 2.1.
- Edge cases / failure modes:
- Same as “Search Contacts” (auth, base/table mismatch, rate limiting, empty result sets).
Block C — Embedded Operator Notes (Sticky Notes)
Overview:
Two sticky notes provide human guidance: overall setup instructions and a video link. They do not affect execution but are important for reproducing and operating the workflow.
Nodes Involved:
- Workflow Description (sticky note)
- Video Walkthrough (sticky note)
Node: Workflow Description (Sticky Note)
- Type / Role:
n8n-nodes-base.stickyNote— documentation. - Content highlights (interpreted):
- Explains the purpose: MCP server exposing Airtable as AI tools.
- Setup steps: create Airtable token with scopes:
data.records:readdata.records:writeschema.bases:read
- Add token to n8n credentials.
- Enable Developer Mode in ChatGPT and add MCP server URL as an app.
- Configure base/tables and copy production URL from MCP trigger node after publishing.
- Edge cases: None (non-executable).
Node: Video Walkthrough (Sticky Note)
- Type / Role:
n8n-nodes-base.stickyNote— documentation with link. - Content (link preserved):
- Edge cases: None (non-executable).
3. Summary Table
4. Reproducing the Workflow from Scratch
-
Create Airtable Personal Access Token
- Go to
https://airtable.com/create/tokens. - Create a token granting these scopes:
data.records:readdata.records:writeschema.bases:read
- Ensure the token has access to the target base(s).
- Go to
-
Create n8n Airtable Credential
- In n8n: Credentials → New.
- Choose Airtable Personal Access Token API.
- Paste the token and save (name it e.g., “Airtable Personal Access Token account”).
-
Add the MCP Trigger Node
- Create a new workflow.
- Add node: MCP Trigger (LangChain / MCP).
- Set the Path (or let n8n generate one). In this workflow it is:
20c5d050-e533-469d-a15e-98da73e32cf7 - Save the workflow.
-
Add “Search Contacts” Airtable Tool
- Add node: Airtable Tool.
- Select your Airtable Personal Access Token credential.
- Configure:
- Operation: Search
- Base: select your base (or paste base ID)
- Table: select “Contacts” (or your equivalent table)
- Leave options at defaults unless you need filters/limits.
-
Add “Search Companies” Airtable Tool
- Add another Airtable Tool node.
- Use the same Airtable credential.
- Configure:
- Operation: Search
- Base: same base (or your base)
- Table: “Companies” (or your equivalent table)
-
Connect Tools to the MCP Trigger
- From Search Contacts, connect its AI Tool output (
ai_tool) to Airtable CRM MCP Trigger. - From Search Companies, connect its AI Tool output (
ai_tool) to Airtable CRM MCP Trigger.
- Note: This is not a standard “main” connection; it must be the tool connection type so the MCP Trigger can register the nodes as tools.
- From Search Contacts, connect its AI Tool output (
-
(Optional) Add Sticky Notes
- Add a Sticky Note for setup instructions (token scopes, configuration guidance).
- Add a Sticky Note with the video link: https://youtu.be/lQh1fuIrBN8
-
Activate/Publish and Retrieve the MCP URL
- Activate the workflow (and publish if your n8n deployment requires publishing for production URLs).
- Open the MCP Trigger node and copy the Production URL (naming may vary by n8n version).
- This URL is what the external AI client will use as the MCP server address.
-
Connect from an External AI Client (ChatGPT / Custom GPT)
- Enable Developer Mode (or the equivalent MCP/app integration setting).
- Add a new MCP server/app and paste the MCP URL from step 8.
- Verify that two tools are available to the client: “Search Contacts” and “Search Companies”.
5. General Notes & Resources
| Note Content | Context or Link |
|---|---|
Airtable token scopes required: data.records:read, data.records:write, schema.bases:read |
From “Workflow Description” sticky note |
| Configure both Airtable Tool nodes to point to your own base/tables | From “Workflow Description” sticky note |
| After publishing, copy the Production URL from the MCP Trigger to connect external apps | From “Workflow Description” sticky note |
| Video walkthrough link | https://youtu.be/lQh1fuIrBN8 |
| Thumbnail image used in sticky note | https://vasarmilan-public.s3.us-east-1.amazonaws.com/blog_thumbnails/thumbnail_recidrbznaXlmqFUI.jpg |