airtable-mcp-server

jakreymyers/airtable-mcp-server

3.2

If you are the rightful owner of airtable-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server for integrating Airtable with AI assistants, enabling retrieval of records from Airtable bases.

Tools
  1. getAirtableRecord

    Retrieves a specific record from an Airtable base using the record ID, base ID, and table name.

Airtable MCP Server

A Model Context Protocol (MCP) server for Airtable integration that allows AI assistants to retrieve records from Airtable bases.

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • Airtable Personal Access Token
  • Airtable base with accessible tables

Installation

  1. Clone and setup the project:

    git clone <repository-url>
    cd airtable-mcp-server
    npm install
    
  2. Get your Airtable Personal Access Token:

  3. Configure environment:

    cp .env.example .env
    # Edit .env and set your AIRTABLE_PERSONAL_ACCESS_TOKEN
    
  4. Build and test:

    npm run build
    npm start
    

๐Ÿ”ง Usage

The server provides one tool: getAirtableRecord

Tool Parameters

ParameterTypeRequiredDescription
recordIdstringYesAirtable record ID (format: recXXXXXXXXXXXXXX)
baseIdstringYesAirtable base ID (format: appXXXXXXXXXXXXXX)
tableNamestringYesName of the table containing the record

Example Usage

Input:

{
  "recordId": "recABC123DEF456",
  "baseId": "appXYZ789ABC123",
  "tableName": "Artists"
}

Output:

{
  "content": [
    {
      "type": "text",
      "text": "{\"id\":\"recABC123DEF456\",\"fields\":{\"Name\":\"Vincent van Gogh\",\"Bio\":\"Dutch painter...\",\"Genre\":[\"Post-Impressionism\"]},\"createdTime\":\"2024-01-15T10:30:00.000Z\"}"
    }
  ]
}

๐Ÿ”— MCP Client Integration

Claude Desktop

Add to your ~/.claude/mcp.json (see examples/claude-desktop.json):

{
  "mcpServers": {
    "airtable": {
      "command": "node",
      "args": ["/path/to/airtable-mcp-server/dist/index.js"],
      "env": {
        "AIRTABLE_PERSONAL_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Cursor IDE

Add to your .cursor/mcp.json (see examples/cursor-ide.json):

{
  "mcpServers": {
    "airtable": {
      "command": "node",
      "args": ["./dist/index.js"],
      "env": {
        "AIRTABLE_PERSONAL_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

VS Code

Add to your MCP configuration (see examples/vscode.json):

{
  "mcpServers": {
    "airtable": {
      "command": "node",
      "args": ["./dist/index.js"],
      "env": {
        "AIRTABLE_PERSONAL_ACCESS_TOKEN": "your_token_here"
      },
      "transport": "stdio"
    }
  }
}

Global Installation (NPM)

npm install -g airtable-mcp-server

# Then in your MCP client config:
{
  "command": "npx",
  "args": ["-y", "airtable-mcp-server@latest"]
}

๐Ÿ› ๏ธ Development

Scripts

CommandDescription
npm run devDevelopment mode with hot reload
npm run buildCompile TypeScript to JavaScript
npm startRun compiled server
npm run cleanRemove build artifacts
npm testRun unit tests
npm run test:integrationRun integration tests
npm run test:allRun all tests

Project Structure

airtable-mcp-server/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts              # Server entry point
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts          # Configuration management
โ”‚   โ”‚   โ””โ”€โ”€ validation.ts     # Config validation
โ”‚   โ”œโ”€โ”€ tools/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts          # Tool registry
โ”‚   โ”‚   โ””โ”€โ”€ getRecord.ts      # Record retrieval tool
โ”‚   โ”œโ”€โ”€ types/
โ”‚   โ”‚   โ””โ”€โ”€ index.ts          # Type definitions
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ error.ts          # Error handling
โ”‚       โ””โ”€โ”€ validation.ts     # Input validation
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ integration.test.ts   # Integration tests
โ”‚   โ”œโ”€โ”€ unit/
โ”‚   โ”‚   โ””โ”€โ”€ tools.test.ts     # Unit tests
โ”‚   โ””โ”€โ”€ fixtures/
โ”‚       โ””โ”€โ”€ sample-record.json # Test data
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ claude-desktop.json   # Claude Desktop config
โ”‚   โ”œโ”€โ”€ cursor-ide.json       # Cursor IDE config
โ”‚   โ”œโ”€โ”€ vscode.json           # VS Code config
โ”‚   โ””โ”€โ”€ usage.md              # Usage examples
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ DEPLOYMENT.md         # Deployment guide
โ”œโ”€โ”€ dist/                     # Compiled JavaScript (generated)
โ”œโ”€โ”€ PRD.md                    # Product requirements
โ”œโ”€โ”€ CLAUDE.md                 # Claude Code guidance
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tsconfig.json
โ”œโ”€โ”€ .env.example
โ””โ”€โ”€ README.md

๐Ÿ”’ Security

Token Management

  • Environment Only: Never commit tokens to version control
  • Minimal Scope: Use read-only permissions for target bases only
  • Token Rotation: Support for refreshing tokens when needed

Input Validation

  • Record IDs must match pattern: rec[A-Za-z0-9]{14}
  • Base IDs must match pattern: app[A-Za-z0-9]{14}
  • Table names are sanitized for safe usage

Rate Limiting

  • Respects Airtable's 5 requests/second per base limit
  • Implements exponential backoff for rate limit errors
  • Configurable retry attempts and delays

โš™๏ธ Configuration

Environment variables:

VariableRequiredDefaultDescription
AIRTABLE_PERSONAL_ACCESS_TOKENYes-Your Airtable PAT
AIRTABLE_TIMEOUTNo30000Request timeout (ms)
AIRTABLE_RETRY_ATTEMPTSNo3Number of retry attempts
AIRTABLE_RETRY_DELAYNo1000Retry delay (ms)

๐Ÿšจ Error Handling

The server handles various error scenarios:

Error TypeHTTP StatusDescription
Invalid Record ID404Record not found or invalid format
Authentication Failure401Invalid or expired token
Access Forbidden403Token lacks permissions
Rate Limit Exceeded429Too many requests
Invalid Parameters422Malformed request data
Server Error500+Airtable service issues

All errors return structured responses with helpful messages.

๐Ÿ“Š Performance

Requirements Met

  • โœ… Response Time: <2 seconds for record retrieval
  • โœ… Memory Usage: <50MB baseline footprint
  • โœ… Concurrent Requests: Handles up to Airtable's rate limits
  • โœ… Error Recovery: Graceful handling with exponential backoff

Monitoring

  • Request/response logging to stderr
  • Configuration validation on startup
  • Structured error messages for debugging

๐Ÿงช Testing

Manual Testing

  1. Valid Record Retrieval:

    # Replace with your actual IDs
    echo '{"recordId":"recYourRecordId","baseId":"appYourBaseId","tableName":"YourTable"}' | node dist/index.js
    
  2. Error Scenarios:

    • Invalid record ID format
    • Non-existent record
    • Invalid base ID
    • Missing permissions
    • Rate limiting

Test Cases

The implementation includes comprehensive error handling for:

  • โœ… Successful record retrieval
  • โœ… Validation errors (invalid ID formats)
  • โœ… Authentication failures (401/403)
  • โœ… Not found errors (404)
  • โœ… Rate limiting (429)
  • โœ… Server errors (500+)

๐Ÿ”„ Future Enhancements

Planned Features

  • Additional Tools: Create, update, delete operations
  • Batch Operations: Multi-record processing
  • Advanced Queries: Formula-based filtering
  • Field Selection: Granular field retrieval
  • HTTP Transport: REST API support
  • Caching: Redis-based response caching

Production Features

  • OAuth integration
  • Multi-base support
  • Audit logging
  • High availability deployment

๐Ÿ†˜ Troubleshooting

Common Issues

Server won't start:

  • Check that AIRTABLE_PERSONAL_ACCESS_TOKEN is set
  • Verify token has read permissions for target bases
  • Ensure Node.js 18+ is installed

Authentication errors:

  • Verify token is valid and not expired
  • Check token has access to specified base
  • Confirm base ID format: appXXXXXXXXXXXXXX

Record not found:

  • Verify record ID format: recXXXXXXXXXXXXXX
  • Check record exists in specified table
  • Confirm table name is exactly correct (case-sensitive)

Rate limiting:

  • Reduce request frequency
  • Implement delays between requests
  • Monitor Airtable usage limits

Debug Mode

Enable verbose logging:

DEBUG=* npm run dev

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

๐Ÿ“š Resources


Version: 1.0.0
Compatible with: Claude Desktop, Cursor IDE, VS Code MCP extensions
Node.js: 18+ required
Airtable API: Personal Access Token authentication