NocoDB MCP Server
Enables AI agents to interact with NocoDB databases for managing tables, records, views, and file attachments. Supports advanced queries, bulk operations, and full CRUD functionality for storing operational data.
README
NocoDB MCP Server
A Model Context Protocol (MCP) server that provides a comprehensive interface to NocoDB - the open source Airtable alternative. This server enables AI agents to interact with NocoDB databases, making it perfect for storing and managing operational data across multiple AI teams.
Features
- Database Operations: List and manage NocoDB bases/projects
- Table Management: Create, list, and delete tables with custom schemas
- Column Management: Add columns to existing tables with full type support
- Record CRUD: Full create, read, update, delete operations on records
- Advanced Queries: Filter, sort, search, and aggregate data
- View Management: Create and use different views (Grid, Gallery, Form, etc.)
- Bulk Operations: Insert multiple records at once
- File Attachments: Upload files locally or from URLs, attach to records
Installation
Via NPM (Global)
npm install -g @andrewlwn77/nocodb-mcp
Via NPX (No installation)
npx @andrewlwn77/nocodb-mcp
Configuration
Environment Variables
Create a .env file in your project root:
# Required
NOCODB_BASE_URL=http://localhost:8080
NOCODB_API_TOKEN=your_api_token_here
# Optional
NOCODB_DEFAULT_BASE=your_default_base_id
Getting Your API Token
- Log into your NocoDB instance
- Click on your profile icon
- Select "API Tokens"
- Create a new token with appropriate permissions
MCP Configuration
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nocodb": {
"command": "npx",
"args": ["@andrewlwn77/nocodb-mcp"],
"env": {
"NOCODB_BASE_URL": "http://localhost:8080",
"NOCODB_API_TOKEN": "your_api_token_here"
}
}
}
}
Or if installed globally:
{
"mcpServers": {
"nocodb": {
"command": "nocodb-mcp",
"env": {
"NOCODB_BASE_URL": "http://localhost:8080",
"NOCODB_API_TOKEN": "your_api_token_here"
}
}
}
}
Available Tools
Database Operations
list_bases- List all available databases/projectsget_base_info- Get detailed information about a specific base
Table Management
list_tables- List all tables in a baseget_table_info- Get table schema and column informationcreate_table- Create a new table with custom schemadelete_table- Delete a tableadd_column- Add a new column to an existing tabledelete_column- Delete a column from a table
Record Operations
insert_record- Insert a single recordbulk_insert- Insert multiple records at onceget_record- Retrieve a specific record by IDlist_records- List records with filtering and paginationupdate_record- Update an existing recorddelete_record- Delete a recordsearch_records- Full-text search across records
Query Operations
query- Advanced filtering with multiple conditionsaggregate- Perform SUM, COUNT, AVG, MIN, MAX operationsgroup_by- Group records by a column
View Management
list_views- List all views for a tablecreate_view- Create a new viewget_view_data- Get records from a specific view
File Attachments
upload_attachment- Upload a local file to NocoDB storageupload_attachment_by_url- Upload files from URLsattach_file_to_record- Upload and attach a file to a recordget_attachment_info- Get attachment information from a record
Usage Examples
Creating a Table
{
"tool": "create_table",
"arguments": {
"base_id": "p_abc123",
"table_name": "customers",
"columns": [
{
"title": "Name",
"uidt": "SingleLineText",
"rqd": true
},
{
"title": "Email",
"uidt": "Email",
"unique": true
},
{
"title": "Revenue",
"uidt": "Number",
"dt": "decimal"
},
{
"title": "Status",
"uidt": "SingleSelect",
"dtxp": "'active','inactive','pending'"
}
]
}
}
Adding Columns to Existing Tables
The add_column tool allows you to dynamically add columns to existing tables. Here are some examples:
Basic Column Types
{
"tool": "add_column",
"arguments": {
"table_id": "table_id_here",
"title": "Description",
"uidt": "LongText"
}
}
Column with Constraints
{
"tool": "add_column",
"arguments": {
"table_id": "table_id_here",
"title": "Product Code",
"uidt": "SingleLineText",
"unique": true,
"rqd": true
}
}
Select Column with Options
{
"tool": "add_column",
"arguments": {
"table_id": "table_id_here",
"title": "Priority",
"uidt": "SingleSelect",
"meta": {
"options": [
{"title": "Low", "color": "#059669"},
{"title": "Medium", "color": "#d97706"},
{"title": "High", "color": "#dc2626"},
{"title": "Critical", "color": "#7c3aed"}
]
}
}
}
Currency Column
{
"tool": "add_column",
"arguments": {
"table_id": "table_id_here",
"title": "Price",
"uidt": "Currency",
"meta": {
"currency_code": "USD"
}
}
}
For more column type examples, see Column Types Examples.
Deleting Columns
The delete_column tool allows you to remove columns from existing tables. You can identify the column to delete by either its ID or name.
Delete by Column ID
{
"tool": "delete_column",
"arguments": {
"table_id": "table_id_here",
"column_id": "column_id_to_delete"
}
}
Delete by Column Name
{
"tool": "delete_column",
"arguments": {
"table_id": "table_id_here",
"column_name": "ColumnToDelete"
}
}
Note: The tool will search for columns matching either the column_name or title field, making it flexible for different naming conventions.
Inserting Records
{
"tool": "insert_record",
"arguments": {
"base_id": "p_abc123",
"table_name": "customers",
"data": {
"Name": "Acme Corp",
"Email": "contact@acme.com",
"Revenue": 50000,
"Status": "active"
}
}
}
Querying with Filters
{
"tool": "query",
"arguments": {
"base_id": "p_abc123",
"table_name": "customers",
"where": "(Status,eq,active)~and(Revenue,gt,10000)",
"sort": ["-Revenue", "Name"],
"fields": ["Name", "Email", "Revenue"],
"limit": 10
}
}
Aggregating Data
{
"tool": "aggregate",
"arguments": {
"base_id": "p_abc123",
"table_name": "customers",
"column_name": "Revenue",
"function": "sum",
"where": "(Status,eq,active)"
}
}
File Upload Examples
Upload a Local File
{
"tool": "upload_attachment",
"arguments": {
"file_path": "/path/to/document.pdf",
"storage_path": "documents/2024"
}
}
Upload from URL
{
"tool": "upload_attachment_by_url",
"arguments": {
"urls": [
"https://example.com/image1.png",
"https://example.com/image2.jpg"
],
"storage_path": "images"
}
}
Attach File to Record
{
"tool": "attach_file_to_record",
"arguments": {
"base_id": "p_abc123",
"table_name": "products",
"record_id": "42",
"attachment_field": "ProductImages",
"file_path": "/path/to/product-photo.jpg"
}
}
Get Attachment Information
{
"tool": "get_attachment_info",
"arguments": {
"base_id": "p_abc123",
"table_name": "products",
"record_id": "42",
"attachment_field": "ProductImages"
}
}
NocoDB Field Types
Supported UI data types (uidt) for columns:
Basic Types
SingleLineText- Short text fieldLongText- Multi-line textNumber- Integer numeric valuesDecimal- Decimal numbers with precisionCheckbox- Boolean true/false
Date & Time
Date- Date without timeDateTime- Date with timeTime- Time onlyDuration- Time duration
Specialized Text
Email- Email addresses with validationURL- Web linksPhoneNumber- Phone numbers (note: use "PhoneNumber" not "Phone")
Numeric Types
Currency- Money values (requiresmeta.currency_code)Percent- Percentage valuesRating- Star rating
Selection Types
SingleSelect- Dropdown with single selection (requiresmeta.options)MultiSelect- Multiple selections (requiresmeta.options)
Advanced Types
Attachment- File uploadsJSON- JSON data storage
Virtual/Computed Columns
Formula- Calculated fieldsRollup- Aggregate related recordsLookup- Lookup values from related recordsQrCode- Generate QR codes (requiresmeta.fk_qr_value_column_id)Barcode- Generate barcodes (requiresmeta.fk_barcode_value_column_id)
Relational
LinkToAnotherRecord- Relationships between tablesLinks- Many-to-many relationships
Special Parameters for Column Types
Some column types require additional parameters in the meta field:
- SingleSelect/MultiSelect:
meta.optionsarray with{title, color}objects - Currency:
meta.currency_code(e.g., "USD", "EUR") - QrCode:
meta.fk_qr_value_column_id- ID of column to encode - Barcode:
meta.fk_barcode_value_column_id- ID of column to encode, optionalmeta.barcode_format
Filter Syntax
NocoDB uses a specific syntax for filtering:
(field,operator,value)- Basic condition~and- AND operator~or- OR operator~not- NOT operator
Operators
eq- Equal toneq- Not equal togt- Greater thange- Greater than or equallt- Less thanle- Less than or equallike- Contains (use % for wildcards)nlike- Does not containnull- Is nullnotnull- Is not null
Examples
(Status,eq,active)- Status equals "active"(Revenue,gt,1000)~and(Status,eq,active)- Revenue > 1000 AND Status = "active"(Name,like,%Corp%)- Name contains "Corp"
Development
Building from Source
# Clone the repository
git clone https://github.com/your-org/nocodb-mcp.git
cd nocodb-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev
Running Tests
npm test
Error Handling
The server provides detailed error messages for common issues:
- Invalid API token
- Base/table not found
- Invalid column types
- Network connectivity issues
- Rate limiting
Best Practices
- Use Views: Create views for commonly accessed data subsets
- Batch Operations: Use
bulk_insertfor multiple records - Field Selection: Specify only needed fields to reduce payload size
- Pagination: Use limit/offset for large datasets
- Caching: Consider caching frequently accessed data on the client side
Limitations
- Some advanced NocoDB features may not be exposed through this interface
- Rate limits depend on your NocoDB instance configuration
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Support
For issues and feature requests, please create an issue on the GitHub repository.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。