Integration with AI
Connect Tables with AI Agents, Workflows, and Knowledge Bases — turn data into intelligent actions.
Table of Contents
· [Integration Overview](#integration-overview)
· [Tables + Workflow](#tables--workflow)
· [Tables + AI Agent](#tables--ai-agent)
· [Tables + Webhooks](#tables--webhooks)
· [REST API](#rest-api)
· [MCP Server — Connect AI via MCP Protocol](#mcp-server--connect-ai-via-mcp-protocol)
· [AI Integration Use-cases](#ai-integration-use-cases)
· [Best Practices](#best-practices)
Integration Overview
ClickAI Tables is more than just data storage — it's the central hub connecting the entire ClickAI AI ecosystem. You can:
graph LR A[📊 Tables] --> B[🤖 AI Agent] A --> C[⚙️ Workflow] A --> D[🔔 Webhooks] A --> E[📡 REST API] A --> F[🔌 MCP Server] C --> A B --> A F --> B
· Read data from Tables in Workflows/Agents
· Write data to Tables from AI processing results
· Trigger automations when data changes via Webhooks
· Access programmatically via REST API
· Connect LLMs directly via MCP Server (Model Context Protocol)
Tables + Workflow
Read Data from Tables in a Workflow
Use the HTTP Request node in a Workflow to query data from the Tables API:
1. Add an HTTP Request node to the Workflow
2. Configure:
· Method: GET
· URL: https://tables.clickai.vn/api/v2/tables/{table_id}/records
· Headers: xc-auth: {API_TOKEN}
3. Process the response data in subsequent nodes
Write Data to Tables from a Workflow
4. Add an HTTP Request node to the Workflow
5. Configure:
· Method: POST
· URL: https://tables.clickai.vn/api/v2/tables/{table_id}/records
· Headers: xc-auth: {API_TOKEN}
· Body: JSON containing the new record data
{ "Title": "{{workflow.output.title}}", "Status": "Processed", "AI_Summary": "{{workflow.output.summary}}", "Score": {{workflow.output.score}} }
Example Workflow: Automated Lead Processing
graph TD A[🔔 Webhook: New Lead] --> B[📊 Read Lead from Tables] B --> C[🧠 LLM: Analyze Lead] C --> D{Score > 80?} D -->|Yes| E[📊 Update Status = Hot] D -->|No| F[📊 Update Status = Cold] E --> G[📧 Send notification to Sales] F --> H[📧 Send nurturing email]
Tables + AI Agent
Use Tables as a Tool for AI Agent
AI Agents can use the Tables API as a tool to query and update data:
6. In the Agent configuration, add a Custom Tool
7. Configure the Tables API endpoint
8. The Agent will automatically call the API when it needs to look up information
Example: A customer support Agent can:
· Look up customer information from the "Customers" table
· Check order status from the "Orders" table
· Create new tickets in the "Support Tickets" table
· Update processing status
Connect Tables via App Integration
Use the App Integration module (Composio) to connect Tables:
9. Go to Workspace → App Integration
10. Find and connect NocoDB/ClickAI Tables
11. Configure authentication
12. Use the available actions in Agent/Workflow
Tables + Webhooks
Webhooks send automatic notifications when data in Tables changes:
Webhook Configuration
13. Open the table → Table Details → Webhooks tab
14. Click Create Webhook
15. Configure:
Setting
Description
Event
After Insert / After Update / After Delete
URL
Receiving endpoint (e.g., ClickAI Workflow trigger)
Method
POST
Headers
Custom headers if needed
Condition
Trigger only when specific conditions are met
Webhook Payload
{ "type": "records.after.insert", "data": { "table_id": "tbl_xxxxx", "rows": [ { "Id": 1, "Title": "New Customer Lead", "Email": "[email protected]", "Status": "New" } ] }, "timestamp": "2024-01-15T10:30:00Z" }
Connect Webhook → ClickAI Workflow
16. Create a new Workflow in ClickAI Studio
17. Use the Start Node with trigger type Webhook
18. Copy the Webhook URL from the Workflow
19. Paste the URL into the table's Webhook configuration
20. Whenever data changes → Webhook triggers → Workflow runs automatically
REST API
ClickAI Tables provides a full REST API for all data operations:
Authentication
# Using API Token curl -H "xc-auth: YOUR_API_TOKEN" \ https://tables.clickai.vn/api/v2/tables/{table_id}/records
Key API Endpoints
Method
Endpoint
Description
GET
/api/v2/tables/{id}/records
List records
GET
/api/v2/tables/{id}/records/{row_id}
Get a specific record
POST
/api/v2/tables/{id}/records
Create new record(s)
PATCH
/api/v2/tables/{id}/records
Update record(s)
DELETE
/api/v2/tables/{id}/records
Delete record(s)
Query Parameters
Parameter
Description
Example
where
Filter records
(Status,eq,Active)
sort
Sort records
-CreatedAt (descending)
fields
Select returned fields
Title,Email,Status
limit
Limit number of records
25
offset
Pagination offset
50
Example: Get Active Customers
curl -X GET \ "https://tables.clickai.vn/api/v2/tables/tbl_xxx/records?where=(Status,eq,Active)&sort=-CreatedAt&limit=10" \ -H "xc-auth: YOUR_API_TOKEN"
Example: Create a New Record
curl -X POST \ "https://tables.clickai.vn/api/v2/tables/tbl_xxx/records" \ -H "xc-auth: YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "Title": "John Doe", "Email": "[email protected]", "Phone": "+1234567890", "Status": "New" }'
💡 TIP: You can find the API Token in **Table Details** → **API Snippet** tab or in **Workspace Settings** → **API Tokens**.
MCP Server — Connect AI via MCP Protocol
MCP (Model Context Protocol) is a standard protocol that allows AI applications (LLMs) to interact directly with data in Tables using natural language — no API coding required.
With MCP, you can ask AI directly:
· *"Show me all customers from Hanoi"*
· *"Add a new task: Review documentation, priority High"*
· *"Update order #123 status to Delivered"*
· *"Delete all leads with status = Lost"*
How MCP Works
graph LR A[👤 User] -->|Natural language| B[🤖 AI Client] B -->|MCP Protocol| C[🔌 MCP Server] C -->|REST API| D[📊 ClickAI Tables] D -->|Data| C C -->|Results| B B -->|Response| A
Component
Role
AI Client
AI application (Claude Desktop, Cursor, Windsurf...)
MCP Server
Bridge between AI and Tables — translates AI commands into API calls
ClickAI Tables
Database that receives and processes data requests
MCP Server Capabilities
Feature Group
Capabilities
Record CRUD
Create, read, update, delete records using natural language
Table Management
List, create, delete tables
Field Management
Add, delete, manage fields/columns
View Management
List, create, delete views (Grid, Gallery, Kanban...)
Data Operations
Filter, sort, search, aggregate data
Configure MCP on ClickAI Tables
Method 1: Create MCP Endpoint from the UI (Recommended)
21. Open a base in ClickAI Tables
22. Click the Overview button in the left sidebar
23. Select the Settings tab
24. Choose Model Context Protocol from the settings menu
25. Click New MCP Endpoint
26. Name the endpoint and click Create
27. Copy the auto-generated MCP Config JSON
Method 2: Manual Configuration (Self-hosted)
For self-hosted ClickAI Tables instances, configure manually using an API Token:
Step 1: Gather configuration details
Setting
How to obtain
NOCODB_BASE_URL
Your Tables instance URL (e.g., https://tables.clickai.vn)
NOCODB_API_TOKEN
Account Settings → API Tokens → Create Token
NOCODB_BASE_ID
Found in the URL when opening a base: .../#/nc/base/BASE_ID_HERE/...
Step 2: Create the MCP Config JSON
{ "mcpServers": { "clickai-tables": { "command": "npx", "args": ["-y", "nocodb-mcp-server"], "env": { "NOCODB_BASE_URL": "https://tables.clickai.vn", "NOCODB_API_TOKEN": "your_api_token_here", "NOCODB_BASE_ID": "your_base_id_here" } } } }
Connect to Claude Desktop
28. Open Claude Desktop → Preferences (⌘+, on Mac / Ctrl+, on Windows)
29. Go to Develop → Edit Config
30. Paste the MCP Config JSON into claude_desktop_config.json
31. Save the file and restart Claude Desktop
32. Verify: open Claude, you should see the 🔌 MCP Tools icon in the input area
// ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) // %APPDATA%\Claude\claude_desktop_config.json (Windows) { "mcpServers": { "clickai-tables": { "command": "npx", "args": ["-y", "nocodb-mcp-server"], "env": { "NOCODB_BASE_URL": "https://tables.clickai.vn", "NOCODB_API_TOKEN": "xc-auth-xxxxxxxxxxxxx", "NOCODB_BASE_ID": "p_xxxxxxxxxxxxxxxx" } } } }
Connect to Cursor
33. Open Cursor → Settings (⇧+⌘+J / Ctrl+Shift+J)
34. Navigate to the MCP tab
35. Click Add Custom MCP
36. Paste the MCP Config JSON and save
37. On success, you will see the NocoDB tools listed
Example Usage with Claude
After connecting, you can communicate using natural language:
👤 "Show me the 10 most recent customers in the Customers table" 🤖 Claude auto-calls MCP → list_records(table: Customers, sort: -CreatedAt, limit: 10) → Returns a table of the 10 newest customers 👤 "Add a new customer: John Doe, email: [email protected], phone: +1234567890" 🤖 Claude auto-calls MCP → create_record(table: Customers, data: {...}) → ✅ Record created successfully 👤 "Create a new table called 'Feedback' with 3 columns: Customer Name, Rating, Comment" 🤖 Claude auto-calls MCP → create_table(...) + create_fields(...) → ✅ Feedback table created with 3 fields
MCP Permission Management
Mode
Description
Best for
Always Ask Permission
AI asks for confirmation before each action
Production data, critical operations
Allow Unsupervised
AI executes without confirmation
Test data, dev environments
🚨 WARNING: **Security when using MCP:** - Use API Tokens with minimal permissions (read-only if you only need to query) - Never use Admin tokens for MCP integrations - Enable "Always Ask Permission" mode for production data - Review MCP Config JSON carefully before sharing — ensure tokens are not exposed
💡 TIP: MCP is especially useful for developers who want to quickly prototype, query data, or manage databases without opening the Tables UI. Combining MCP with Claude Desktop turns Tables into your personal data assistant.
AI Integration Use-cases
1. Smart CRM with AI Agent
Customer chats → AI Agent queries CRM in Tables → Responds based on purchase history → Logs interaction in Tables
2. Automated Customer Segmentation
Webhook: New Order → Workflow → LLM analyzes behavior → Updates Segment field in Tables → Triggers personalized outreach
3. AI-Powered Content Calendar
Form View collects ideas → Workflow → LLM writes draft → Saves draft to table → Kanban View manages progress
4. Automated Helpdesk
Form View receives ticket → Webhook → AI classifies → Updates Priority & Category → Assigns to appropriate staff
5. Intelligent Reporting
Scheduled Workflow → Query Tables API → LLM analyzes data → Generates report → Sends email to management
Best Practices
💡 TIP: **Effective Table Design:** - Each table should focus on a single entity (Customers, Orders, Products) - Use Links to create relationships instead of duplicating data - Use clear, descriptive field names - Use Single Select for status fields to leverage Kanban View
🚨 WARNING: **API Integration Notes:** - Secure API Tokens — never hardcode in client-side code - Implement rate limiting to avoid excessive API calls - Validate data before writing to Tables - Set up error handling in Workflows for API failure cases
⚠️ IMPORTANT: **Performance Optimization:** - Use the `fields` parameter to fetch only necessary data - Implement pagination for tables with many records - Use `where` filters at the API level instead of client-side filtering - Cache API results when data doesn't change frequently
Last updated