@rashidazarang/airtable-mcp 2.2.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,13 +3,21 @@
3
3
  [![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/rashidazarang/airtable-mcp)](https://archestra.ai/mcp-catalog/rashidazarang__airtable-mcp)
4
4
  [![smithery badge](https://smithery.ai/badge/@rashidazarang/airtable-mcp)](https://smithery.ai/server/@rashidazarang/airtable-mcp)
5
5
  ![Airtable](https://img.shields.io/badge/Airtable-18BFFF?style=for-the-badge&logo=Airtable&logoColor=white)
6
- [![MCP](https://img.shields.io/badge/MCP-1.6.0-green)](https://github.com/rashidazarang/airtable-mcp)
6
+ [![MCP](https://img.shields.io/badge/MCP-2.2.1-blue)](https://github.com/rashidazarang/airtable-mcp)
7
+ [![Security](https://img.shields.io/badge/Security-Enhanced-green)](https://github.com/rashidazarang/airtable-mcp)
8
+ [![Protocol](https://img.shields.io/badge/Protocol-2024--11--05-success)](https://modelcontextprotocol.io/)
7
9
 
8
- A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with your Airtable bases. Query, create, update, and delete records using natural language through a secure, standardized interface.
10
+ 🏆 **Complete MCP 2024-11-05 Implementation** - A production-ready Model Context Protocol server that enables AI assistants like Claude to interact with your Airtable bases through a secure, feature-complete interface.
9
11
 
10
- ## 🔒 Security Notice
12
+ ## 🚀 Latest: Enhanced v2.2.1
11
13
 
12
- **Important**: Version 1.6.0 adds batch operations and attachment management with 33 total tools. Complete Airtable API coverage with advanced features.
14
+ **Complete MCP Protocol Support** with enterprise security:
15
+ - ✅ **Prompts** - 4 AI-powered templates for data analysis
16
+ - ✅ **Sampling** - LLM integration for intelligent operations
17
+ - ✅ **Roots** - Filesystem boundary management
18
+ - ✅ **Logging** - Dynamic structured logging
19
+ - ✅ **OAuth2** - PKCE authentication flow
20
+ - ✅ **Security** - XSS protection, input validation, CSP headers
13
21
 
14
22
  ## ✨ Features
15
23
 
@@ -26,6 +34,8 @@ A Model Context Protocol (MCP) server that enables AI assistants like Claude to
26
34
  - 📎 **Attachment Management** - Upload files via URLs to attachment fields
27
35
  - ⚡ **Batch Operations** - Create, update, delete up to 10 records at once
28
36
  - 👥 **Collaboration Tools** - Manage base collaborators and shared views
37
+ - 🤖 **AI Integration** - Prompts and sampling for intelligent data operations
38
+ - 🔐 **Enterprise Security** - OAuth2, rate limiting, comprehensive validation
29
39
 
30
40
  ## 📋 Prerequisites
31
41
 
@@ -238,6 +248,14 @@ Once configured, you can interact with your Airtable data naturally:
238
248
  | `list_collaborators` | View base collaborators and their permission levels |
239
249
  | `list_shares` | List shared views and their public configurations |
240
250
 
251
+ ### 🤖 AI Integration (4 prompts) - **New in v2.2.0**
252
+ | Prompt | Description |
253
+ |--------|-------------|
254
+ | `analyze_data` | AI-powered data analysis with trends and insights |
255
+ | `create_report` | Generate comprehensive reports with AI assistance |
256
+ | `data_insights` | Discover hidden correlations and patterns |
257
+ | `optimize_workflow` | Get AI recommendations for workflow improvements |
258
+
241
259
  ## 🔧 Advanced Configuration
242
260
 
243
261
  ### Using with Smithery Cloud
@@ -346,6 +364,8 @@ lsof -ti:8010 | xargs kill -9
346
364
 
347
365
  ## 📦 Version History
348
366
 
367
+ - **v2.2.1** (2025-08-16) - 🔒 **Security release**: Fixed XSS and format string vulnerabilities
368
+ - **v2.2.0** (2025-08-16) - 🏆 **Major release**: Complete MCP 2024-11-05 protocol implementation
349
369
  - **v1.6.0** (2025-08-15) - 🎆 **Major release**: Added batch operations & attachment management (33 total tools)
350
370
  - **v1.5.0** (2025-08-15) - Added comprehensive schema management (23 total tools)
351
371
  - **v1.4.0** (2025-08-14) - Added webhook support and enhanced CRUD operations (12 tools)
@@ -374,4 +394,4 @@ MIT License - see [LICENSE](./LICENSE) file for details
374
394
 
375
395
  ---
376
396
 
377
- **Version**: 1.2.4 | **Status**: ✅ Production Ready | **Last Updated**: August 14, 2025
397
+ **Version**: 2.2.1 | **Status**: ✅ Production Ready | **MCP Protocol**: 2024-11-05 Complete | **Last Updated**: August 16, 2025
@@ -262,11 +262,11 @@ const TOOLS_SCHEMA = [
262
262
  }
263
263
  ];
264
264
 
265
- // Prompts schema - AI-powered templates for common Airtable operations
265
+ // Enhanced AI-powered prompts for intelligent Airtable operations
266
266
  const PROMPTS_SCHEMA = [
267
267
  {
268
268
  name: 'analyze_data',
269
- description: 'Analyze data patterns and provide insights from Airtable records',
269
+ description: 'Advanced AI data analysis with statistical insights, pattern recognition, and predictive modeling',
270
270
  arguments: [
271
271
  {
272
272
  name: 'table',
@@ -275,19 +275,29 @@ const PROMPTS_SCHEMA = [
275
275
  },
276
276
  {
277
277
  name: 'analysis_type',
278
- description: 'Type of analysis (trends, summary, patterns, insights)',
278
+ description: 'Type of analysis (trends, statistical, patterns, predictive, anomaly_detection, correlation_matrix)',
279
279
  required: false
280
280
  },
281
281
  {
282
282
  name: 'field_focus',
283
283
  description: 'Specific fields to focus the analysis on',
284
284
  required: false
285
+ },
286
+ {
287
+ name: 'time_dimension',
288
+ description: 'Time field for temporal analysis',
289
+ required: false
290
+ },
291
+ {
292
+ name: 'confidence_level',
293
+ description: 'Statistical confidence level (0.90, 0.95, 0.99)',
294
+ required: false
285
295
  }
286
296
  ]
287
297
  },
288
298
  {
289
299
  name: 'create_report',
290
- description: 'Generate a comprehensive report based on Airtable data',
300
+ description: 'Generate intelligent reports with AI-powered insights, visualizations, and actionable recommendations',
291
301
  arguments: [
292
302
  {
293
303
  name: 'table',
@@ -296,19 +306,29 @@ const PROMPTS_SCHEMA = [
296
306
  },
297
307
  {
298
308
  name: 'report_type',
299
- description: 'Type of report (summary, detailed, dashboard, metrics)',
309
+ description: 'Type of report (executive_summary, operational_dashboard, analytical_deep_dive, performance_metrics, predictive_forecast)',
300
310
  required: false
301
311
  },
302
312
  {
303
313
  name: 'time_period',
304
- description: 'Time period for the report (if applicable)',
314
+ description: 'Time period for analysis (last_7_days, last_30_days, last_quarter, year_to_date, custom)',
315
+ required: false
316
+ },
317
+ {
318
+ name: 'stakeholder_level',
319
+ description: 'Target audience (executive, manager, analyst, operational)',
320
+ required: false
321
+ },
322
+ {
323
+ name: 'include_recommendations',
324
+ description: 'Include AI-generated actionable recommendations (true/false)',
305
325
  required: false
306
326
  }
307
327
  ]
308
328
  },
309
329
  {
310
330
  name: 'data_insights',
311
- description: 'Discover hidden insights and correlations in your Airtable data',
331
+ description: 'Discover hidden patterns, correlations, and business insights using advanced AI algorithms',
312
332
  arguments: [
313
333
  {
314
334
  name: 'tables',
@@ -317,23 +337,214 @@ const PROMPTS_SCHEMA = [
317
337
  },
318
338
  {
319
339
  name: 'insight_type',
320
- description: 'Type of insights to find (correlations, outliers, trends, predictions)',
340
+ description: 'Type of insights (correlations, outliers, trends, predictions, segmentation, attribution, churn_analysis)',
341
+ required: false
342
+ },
343
+ {
344
+ name: 'business_context',
345
+ description: 'Business domain context (sales, marketing, operations, finance, customer_success)',
346
+ required: false
347
+ },
348
+ {
349
+ name: 'insight_depth',
350
+ description: 'Analysis depth (surface, moderate, deep, comprehensive)',
321
351
  required: false
322
352
  }
323
353
  ]
324
354
  },
325
355
  {
326
356
  name: 'optimize_workflow',
327
- description: 'Suggest workflow optimizations based on your Airtable usage patterns',
357
+ description: 'AI-powered workflow optimization with automation recommendations and efficiency improvements',
328
358
  arguments: [
329
359
  {
330
360
  name: 'base_overview',
331
- description: 'Overview of the base structure and usage',
361
+ description: 'Overview of the base structure and current workflows',
332
362
  required: false
333
363
  },
334
364
  {
335
365
  name: 'optimization_focus',
336
- description: 'Focus area (automation, fields, views, collaboration)',
366
+ description: 'Focus area (automation, data_quality, collaboration, performance, integration, user_experience)',
367
+ required: false
368
+ },
369
+ {
370
+ name: 'current_pain_points',
371
+ description: 'Known issues or bottlenecks in current workflow',
372
+ required: false
373
+ },
374
+ {
375
+ name: 'team_size',
376
+ description: 'Number of users working with this base',
377
+ required: false
378
+ }
379
+ ]
380
+ },
381
+ {
382
+ name: 'smart_schema_design',
383
+ description: 'AI-assisted database schema optimization and field relationship analysis',
384
+ arguments: [
385
+ {
386
+ name: 'use_case',
387
+ description: 'Primary use case (crm, project_management, inventory, content_management, hr, finance)',
388
+ required: true
389
+ },
390
+ {
391
+ name: 'data_volume',
392
+ description: 'Expected data volume (small, medium, large, enterprise)',
393
+ required: false
394
+ },
395
+ {
396
+ name: 'integration_needs',
397
+ description: 'External systems to integrate with',
398
+ required: false
399
+ },
400
+ {
401
+ name: 'compliance_requirements',
402
+ description: 'Data compliance needs (gdpr, hipaa, sox, none)',
403
+ required: false
404
+ }
405
+ ]
406
+ },
407
+ {
408
+ name: 'data_quality_audit',
409
+ description: 'Comprehensive AI-powered data quality assessment with cleansing recommendations',
410
+ arguments: [
411
+ {
412
+ name: 'tables',
413
+ description: 'Tables to audit (comma-separated or "all")',
414
+ required: true
415
+ },
416
+ {
417
+ name: 'quality_dimensions',
418
+ description: 'Quality aspects to check (completeness, accuracy, consistency, validity, uniqueness, timeliness)',
419
+ required: false
420
+ },
421
+ {
422
+ name: 'severity_threshold',
423
+ description: 'Minimum severity level to report (low, medium, high, critical)',
424
+ required: false
425
+ },
426
+ {
427
+ name: 'auto_fix_suggestions',
428
+ description: 'Include automated fix suggestions (true/false)',
429
+ required: false
430
+ }
431
+ ]
432
+ },
433
+ {
434
+ name: 'predictive_analytics',
435
+ description: 'Advanced predictive modeling and forecasting using historical Airtable data',
436
+ arguments: [
437
+ {
438
+ name: 'table',
439
+ description: 'Table containing historical data',
440
+ required: true
441
+ },
442
+ {
443
+ name: 'target_field',
444
+ description: 'Field to predict or forecast',
445
+ required: true
446
+ },
447
+ {
448
+ name: 'prediction_horizon',
449
+ description: 'Forecast period (next_week, next_month, next_quarter, next_year)',
450
+ required: false
451
+ },
452
+ {
453
+ name: 'model_type',
454
+ description: 'Prediction model (trend_analysis, seasonal_forecast, regression, classification, time_series)',
455
+ required: false
456
+ },
457
+ {
458
+ name: 'feature_fields',
459
+ description: 'Fields to use as predictive features',
460
+ required: false
461
+ }
462
+ ]
463
+ },
464
+ {
465
+ name: 'natural_language_query',
466
+ description: 'Process natural language questions about your data and provide intelligent answers',
467
+ arguments: [
468
+ {
469
+ name: 'question',
470
+ description: 'Natural language question about your data',
471
+ required: true
472
+ },
473
+ {
474
+ name: 'context_tables',
475
+ description: 'Tables that might contain relevant data',
476
+ required: false
477
+ },
478
+ {
479
+ name: 'response_format',
480
+ description: 'Desired response format (narrative, data_summary, visualization_suggestion, action_items)',
481
+ required: false
482
+ },
483
+ {
484
+ name: 'include_confidence',
485
+ description: 'Include confidence scores for answers (true/false)',
486
+ required: false
487
+ }
488
+ ]
489
+ },
490
+ {
491
+ name: 'smart_data_transformation',
492
+ description: 'AI-assisted data transformation, cleaning, and enrichment with intelligent suggestions',
493
+ arguments: [
494
+ {
495
+ name: 'source_table',
496
+ description: 'Source table for transformation',
497
+ required: true
498
+ },
499
+ {
500
+ name: 'transformation_goal',
501
+ description: 'Goal (normalize, standardize, enrich, cleanse, aggregate, pivot)',
502
+ required: true
503
+ },
504
+ {
505
+ name: 'target_format',
506
+ description: 'Desired output format or structure',
507
+ required: false
508
+ },
509
+ {
510
+ name: 'quality_rules',
511
+ description: 'Data quality rules to apply during transformation',
512
+ required: false
513
+ },
514
+ {
515
+ name: 'preserve_history',
516
+ description: 'Maintain audit trail of changes (true/false)',
517
+ required: false
518
+ }
519
+ ]
520
+ },
521
+ {
522
+ name: 'automation_recommendations',
523
+ description: 'Generate intelligent automation suggestions based on workflow patterns and data analysis',
524
+ arguments: [
525
+ {
526
+ name: 'workflow_description',
527
+ description: 'Description of current manual processes',
528
+ required: false
529
+ },
530
+ {
531
+ name: 'automation_scope',
532
+ description: 'Scope (single_table, multi_table, cross_base, external_integration)',
533
+ required: false
534
+ },
535
+ {
536
+ name: 'frequency_patterns',
537
+ description: 'How often tasks are performed',
538
+ required: false
539
+ },
540
+ {
541
+ name: 'complexity_tolerance',
542
+ description: 'Acceptable automation complexity (simple, moderate, advanced)',
543
+ required: false
544
+ },
545
+ {
546
+ name: 'integration_capabilities',
547
+ description: 'Available integration tools (zapier, make, custom_api, native_automations)',
337
548
  required: false
338
549
  }
339
550
  ]
@@ -379,7 +590,7 @@ const server = http.createServer(async (req, res) => {
379
590
  res.writeHead(200, { 'Content-Type': 'application/json' });
380
591
  res.end(JSON.stringify({
381
592
  status: 'healthy',
382
- version: '2.2.1',
593
+ version: '3.0.0',
383
594
  timestamp: new Date().toISOString(),
384
595
  uptime: process.uptime()
385
596
  }));
@@ -409,10 +620,14 @@ const server = http.createServer(async (req, res) => {
409
620
  return;
410
621
  }
411
622
 
412
- // Sanitize all user inputs for HTML output
413
- const safeClientId = escapeHtml(clientId);
414
- const safeRedirectUri = escapeHtml(redirectUri);
415
- const safeState = escapeHtml(state || '');
623
+ // Create safe copies of all variables for JavaScript use
624
+ const safeRedirectUri = redirectUri.slice(0, 2000); // Limit length
625
+ const safeState = (state || '').slice(0, 200); // Limit length
626
+ const safeClientId = clientId.slice(0, 200); // Limit length
627
+
628
+ // Sanitize for HTML display only
629
+ const displayClientId = escapeHtml(safeClientId);
630
+ const displayRedirectUri = escapeHtml(safeRedirectUri);
416
631
 
417
632
  // Generate authorization code
418
633
  const authCode = crypto.randomBytes(32).toString('hex');
@@ -422,12 +637,15 @@ const server = http.createServer(async (req, res) => {
422
637
 
423
638
  res.writeHead(200, {
424
639
  'Content-Type': 'text/html',
425
- 'Content-Security-Policy': "default-src 'self'; script-src 'unsafe-inline'; style-src 'unsafe-inline'",
640
+ 'Content-Security-Policy': "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; connect-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none';",
426
641
  'X-Content-Type-Options': 'nosniff',
427
- 'X-Frame-Options': 'DENY'
642
+ 'X-Frame-Options': 'DENY',
643
+ 'X-XSS-Protection': '1; mode=block',
644
+ 'Referrer-Policy': 'no-referrer'
428
645
  });
429
646
 
430
- res.end(`<!DOCTYPE html>
647
+ // Build HTML with proper escaping and separation of concerns
648
+ const htmlContent = `<!DOCTYPE html>
431
649
  <html>
432
650
  <head>
433
651
  <meta charset="UTF-8">
@@ -436,8 +654,8 @@ const server = http.createServer(async (req, res) => {
436
654
  </head>
437
655
  <body>
438
656
  <h2>Airtable MCP Server - OAuth2 Authorization</h2>
439
- <p>Client ID: ${safeClientId}</p>
440
- <p>Redirect URI: ${safeRedirectUri}</p>
657
+ <p>Client ID: ${displayClientId}</p>
658
+ <p>Redirect URI: ${displayRedirectUri}</p>
441
659
  <div style="margin: 20px 0;">
442
660
  <button onclick="authorize()" style="background: #18BFFF; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">
443
661
  Authorize Application
@@ -447,22 +665,47 @@ const server = http.createServer(async (req, res) => {
447
665
  </button>
448
666
  </div>
449
667
  <script>
450
- function authorize() {
451
- const baseUrl = ${JSON.stringify(redirectUri)};
452
- const code = ${JSON.stringify(authCode)};
453
- const state = ${JSON.stringify(state || '')};
454
- const url = baseUrl + '?code=' + encodeURIComponent(code) + '&state=' + encodeURIComponent(state);
455
- window.location.href = url;
456
- }
457
- function deny() {
458
- const baseUrl = ${JSON.stringify(redirectUri)};
459
- const state = ${JSON.stringify(state || '')};
460
- const url = baseUrl + '?error=access_denied&state=' + encodeURIComponent(state);
461
- window.location.href = url;
462
- }
668
+ // All variables are safely JSON encoded to prevent XSS
669
+ (function() {
670
+ var config = ${JSON.stringify({
671
+ redirectUri: safeRedirectUri,
672
+ code: authCode,
673
+ state: safeState
674
+ })};
675
+
676
+ window.authorize = function() {
677
+ try {
678
+ var url = new URL(config.redirectUri);
679
+ if (url.protocol !== 'http:' && url.protocol !== 'https:') {
680
+ throw new Error('Invalid protocol');
681
+ }
682
+ var finalUrl = config.redirectUri + '?code=' + encodeURIComponent(config.code) + '&state=' + encodeURIComponent(config.state);
683
+ window.location.href = finalUrl;
684
+ } catch (e) {
685
+ console.error('Authorization failed:', e);
686
+ alert('Invalid redirect URL');
687
+ }
688
+ };
689
+
690
+ window.deny = function() {
691
+ try {
692
+ var url = new URL(config.redirectUri);
693
+ if (url.protocol !== 'http:' && url.protocol !== 'https:') {
694
+ throw new Error('Invalid protocol');
695
+ }
696
+ var finalUrl = config.redirectUri + '?error=access_denied&state=' + encodeURIComponent(config.state);
697
+ window.location.href = finalUrl;
698
+ } catch (e) {
699
+ console.error('Denial failed:', e);
700
+ alert('Invalid redirect URL');
701
+ }
702
+ };
703
+ })();
463
704
  </script>
464
705
  </body>
465
- </html>`);
706
+ </html>`;
707
+
708
+ res.end(htmlContent);
466
709
  return;
467
710
  }
468
711
 
@@ -587,9 +830,9 @@ const server = http.createServer(async (req, res) => {
587
830
  logging: {}
588
831
  },
589
832
  serverInfo: {
590
- name: 'Airtable MCP Server Enhanced',
591
- version: '2.2.1',
592
- description: 'Complete MCP 2024-11-05 server with Prompts, Sampling, Roots, Logging, and OAuth2'
833
+ name: 'Airtable MCP Server - AI Agent Enhanced',
834
+ version: '3.0.0',
835
+ description: 'Advanced AI-powered MCP server with 10 intelligent prompt templates, predictive analytics, and enterprise automation capabilities'
593
836
  }
594
837
  }
595
838
  };
@@ -783,7 +1026,7 @@ async function handleToolCall(request) {
783
1026
  }
784
1027
  }
785
1028
 
786
- // Prompt handlers
1029
+ // Enhanced AI-powered prompt handlers
787
1030
  async function handlePromptGet(request) {
788
1031
  const promptName = request.params.name;
789
1032
  const promptArgs = request.params.arguments || {};
@@ -798,74 +1041,400 @@ async function handlePromptGet(request) {
798
1041
 
799
1042
  switch (promptName) {
800
1043
  case 'analyze_data':
801
- const { table, analysis_type = 'summary', field_focus } = promptArgs;
1044
+ const { table, analysis_type = 'statistical', field_focus, time_dimension, confidence_level = '0.95' } = promptArgs;
802
1045
  messages = [
803
1046
  {
804
1047
  role: 'user',
805
1048
  content: {
806
1049
  type: 'text',
807
- text: `Please analyze the data in table "${table}".
808
- Analysis type: ${analysis_type}
809
- ${field_focus ? `Focus on fields: ${field_focus}` : ''}
810
-
811
- First, list the tables and their schemas, then retrieve sample records from "${table}"
812
- and provide insights based on the ${analysis_type} analysis type.`
1050
+ text: `🤖 ADVANCED DATA ANALYSIS REQUEST
1051
+
1052
+ **Table**: ${table}
1053
+ **Analysis Type**: ${analysis_type}
1054
+ **Confidence Level**: ${confidence_level}
1055
+ ${field_focus ? `**Focus Fields**: ${field_focus}` : ''}
1056
+ ${time_dimension ? `**Time Dimension**: ${time_dimension}` : ''}
1057
+
1058
+ **Instructions**:
1059
+ 1. First, examine the table schema and structure using list_tables with include_schema=true
1060
+ 2. Retrieve representative sample data using list_records with appropriate filters
1061
+ 3. Perform ${analysis_type} analysis with statistical rigor
1062
+ 4. Generate insights with confidence intervals and significance testing
1063
+ 5. Provide actionable recommendations based on findings
1064
+
1065
+ **Expected Deliverables**:
1066
+ - Statistical summary with key metrics
1067
+ - Pattern identification and trend analysis
1068
+ - Anomaly detection if applicable
1069
+ - Predictive insights where relevant
1070
+ - Visualization recommendations
1071
+ - Business impact assessment
1072
+
1073
+ Please use the available Airtable tools to gather data and provide comprehensive ${analysis_type} analysis.`
813
1074
  }
814
1075
  }
815
1076
  ];
816
1077
  break;
817
1078
 
818
1079
  case 'create_report':
819
- const { table: reportTable, report_type = 'summary', time_period } = promptArgs;
1080
+ const { table: reportTable, report_type = 'executive_summary', time_period = 'last_30_days', stakeholder_level = 'manager', include_recommendations = 'true' } = promptArgs;
820
1081
  messages = [
821
1082
  {
822
1083
  role: 'user',
823
1084
  content: {
824
1085
  type: 'text',
825
- text: `Create a ${report_type} report for table "${reportTable}".
826
- ${time_period ? `Time period: ${time_period}` : ''}
827
-
828
- Please gather the table schema and recent records, then generate a comprehensive
829
- ${report_type} report with key metrics, trends, and actionable insights.`
1086
+ text: `📊 INTELLIGENT REPORT GENERATION
1087
+
1088
+ **Target Table**: ${reportTable}
1089
+ **Report Type**: ${report_type}
1090
+ **Time Period**: ${time_period}
1091
+ **Stakeholder Level**: ${stakeholder_level}
1092
+ **Include Recommendations**: ${include_recommendations}
1093
+
1094
+ **Report Generation Process**:
1095
+ 1. Analyze table structure and data types
1096
+ 2. Extract relevant data for specified time period
1097
+ 3. Calculate key performance indicators
1098
+ 4. Identify trends and patterns
1099
+ 5. Generate visualizations suggestions
1100
+ 6. Create ${stakeholder_level}-appropriate narrative
1101
+
1102
+ **Report Sections**:
1103
+ - Executive Summary (key findings)
1104
+ - Data Overview and Quality Assessment
1105
+ - Trend Analysis and Patterns
1106
+ - Performance Metrics and KPIs
1107
+ - Risk Assessment and Opportunities
1108
+ ${include_recommendations === 'true' ? '- AI-Generated Recommendations' : ''}
1109
+ - Next Steps and Action Items
1110
+
1111
+ Please gather the necessary data and create a comprehensive ${report_type} tailored for ${stakeholder_level} level stakeholders.`
830
1112
  }
831
1113
  }
832
1114
  ];
833
1115
  break;
834
1116
 
835
1117
  case 'data_insights':
836
- const { tables, insight_type = 'correlations' } = promptArgs;
1118
+ const { tables, insight_type = 'correlations', business_context = 'general', insight_depth = 'moderate' } = promptArgs;
837
1119
  messages = [
838
1120
  {
839
1121
  role: 'user',
840
1122
  content: {
841
1123
  type: 'text',
842
- text: `Discover ${insight_type} insights across these tables: ${tables}
843
-
844
- Please examine the data structures and content to identify:
845
- - ${insight_type} patterns
846
- - Unexpected relationships
847
- - Optimization opportunities
848
- - Data quality insights`
1124
+ text: `🔍 ADVANCED DATA INSIGHTS DISCOVERY
1125
+
1126
+ **Target Tables**: ${tables}
1127
+ **Insight Type**: ${insight_type}
1128
+ **Business Context**: ${business_context}
1129
+ **Analysis Depth**: ${insight_depth}
1130
+
1131
+ **Discovery Framework**:
1132
+ 1. Multi-table schema analysis and relationship mapping
1133
+ 2. Cross-table data correlation analysis
1134
+ 3. Pattern recognition using ${business_context} domain knowledge
1135
+ 4. Statistical significance testing
1136
+ 5. Business impact quantification
1137
+
1138
+ **Insight Categories**:
1139
+ - ${insight_type} analysis with statistical validation
1140
+ - Hidden patterns and unexpected relationships
1141
+ - Segmentation opportunities
1142
+ - Predictive indicators
1143
+ - Data quality insights
1144
+ - Business optimization opportunities
1145
+
1146
+ **${business_context.toUpperCase()} CONTEXT ANALYSIS**:
1147
+ ${business_context === 'sales' ? '- Revenue drivers and conversion patterns\n- Customer lifetime value indicators\n- Sales cycle optimization opportunities' : ''}
1148
+ ${business_context === 'marketing' ? '- Campaign effectiveness and attribution\n- Customer segmentation insights\n- Channel performance analysis' : ''}
1149
+ ${business_context === 'operations' ? '- Process efficiency metrics\n- Resource utilization patterns\n- Bottleneck identification' : ''}
1150
+
1151
+ Please conduct ${insight_depth} analysis across the specified tables and provide actionable business insights.`
849
1152
  }
850
1153
  }
851
1154
  ];
852
1155
  break;
853
1156
 
854
1157
  case 'optimize_workflow':
855
- const { base_overview, optimization_focus = 'automation' } = promptArgs;
1158
+ const { base_overview, optimization_focus = 'automation', current_pain_points, team_size } = promptArgs;
1159
+ messages = [
1160
+ {
1161
+ role: 'user',
1162
+ content: {
1163
+ type: 'text',
1164
+ text: `⚡ AI-POWERED WORKFLOW OPTIMIZATION
1165
+
1166
+ **Optimization Focus**: ${optimization_focus}
1167
+ **Team Size**: ${team_size || 'Not specified'}
1168
+ ${base_overview ? `**Base Overview**: ${base_overview}` : ''}
1169
+ ${current_pain_points ? `**Current Pain Points**: ${current_pain_points}` : ''}
1170
+
1171
+ **Optimization Analysis**:
1172
+ 1. Workflow pattern analysis and bottleneck identification
1173
+ 2. Automation opportunity assessment
1174
+ 3. User experience and efficiency evaluation
1175
+ 4. Integration and scaling considerations
1176
+ 5. ROI analysis for proposed improvements
1177
+
1178
+ **${optimization_focus.toUpperCase()} OPTIMIZATION**:
1179
+ ${optimization_focus === 'automation' ? '- Identify repetitive manual tasks\n- Suggest automation workflows\n- Estimate time savings and ROI' : ''}
1180
+ ${optimization_focus === 'data_quality' ? '- Data validation and cleansing rules\n- Consistency and accuracy improvements\n- Quality monitoring systems' : ''}
1181
+ ${optimization_focus === 'collaboration' ? '- Team workflow improvements\n- Permission and access optimization\n- Communication enhancement strategies' : ''}
1182
+
1183
+ **Deliverables**:
1184
+ - Workflow efficiency assessment
1185
+ - Prioritized improvement recommendations
1186
+ - Implementation roadmap with timelines
1187
+ - Cost-benefit analysis
1188
+ - Change management considerations
1189
+
1190
+ Please analyze the current setup and provide comprehensive ${optimization_focus} optimization recommendations.`
1191
+ }
1192
+ }
1193
+ ];
1194
+ break;
1195
+
1196
+ case 'smart_schema_design':
1197
+ const { use_case, data_volume = 'medium', integration_needs, compliance_requirements = 'none' } = promptArgs;
1198
+ messages = [
1199
+ {
1200
+ role: 'user',
1201
+ content: {
1202
+ type: 'text',
1203
+ text: `🏗️ AI-ASSISTED SCHEMA OPTIMIZATION
1204
+
1205
+ **Use Case**: ${use_case}
1206
+ **Data Volume**: ${data_volume}
1207
+ **Compliance**: ${compliance_requirements}
1208
+ ${integration_needs ? `**Integrations**: ${integration_needs}` : ''}
1209
+
1210
+ **Schema Design Analysis**:
1211
+ 1. Current schema evaluation for ${use_case} best practices
1212
+ 2. Field type and relationship optimization
1213
+ 3. Performance and scalability assessment
1214
+ 4. Compliance requirement implementation
1215
+ 5. Integration compatibility review
1216
+
1217
+ **${use_case.toUpperCase()} OPTIMIZATION**:
1218
+ ${use_case === 'crm' ? '- Customer lifecycle tracking\n- Sales pipeline optimization\n- Contact relationship mapping' : ''}
1219
+ ${use_case === 'project_management' ? '- Task dependency modeling\n- Resource allocation tracking\n- Timeline and milestone management' : ''}
1220
+ ${use_case === 'inventory' ? '- Stock level monitoring\n- Supplier relationship tracking\n- Cost and pricing optimization' : ''}
1221
+
1222
+ **Recommendations**:
1223
+ - Optimal field types and relationships
1224
+ - Indexing and performance suggestions
1225
+ - Data validation and integrity rules
1226
+ - Automation and workflow triggers
1227
+ - Scaling and maintenance considerations
1228
+
1229
+ Please analyze the current schema and provide ${use_case}-optimized recommendations.`
1230
+ }
1231
+ }
1232
+ ];
1233
+ break;
1234
+
1235
+ case 'data_quality_audit':
1236
+ const { tables: auditTables, quality_dimensions = 'completeness,accuracy,consistency', severity_threshold = 'medium', auto_fix_suggestions = 'true' } = promptArgs;
1237
+ messages = [
1238
+ {
1239
+ role: 'user',
1240
+ content: {
1241
+ type: 'text',
1242
+ text: `🔍 COMPREHENSIVE DATA QUALITY AUDIT
1243
+
1244
+ **Tables to Audit**: ${auditTables}
1245
+ **Quality Dimensions**: ${quality_dimensions}
1246
+ **Severity Threshold**: ${severity_threshold}
1247
+ **Auto-Fix Suggestions**: ${auto_fix_suggestions}
1248
+
1249
+ **Audit Framework**:
1250
+ 1. Data completeness analysis (missing values, empty fields)
1251
+ 2. Accuracy assessment (format validation, range checks)
1252
+ 3. Consistency evaluation (cross-field validation, duplicates)
1253
+ 4. Validity verification (data type compliance, constraints)
1254
+ 5. Uniqueness analysis (duplicate detection, key integrity)
1255
+ 6. Timeliness review (data freshness, update patterns)
1256
+
1257
+ **Quality Assessment Process**:
1258
+ - Statistical analysis of data distribution
1259
+ - Pattern recognition for anomalies
1260
+ - Cross-table consistency validation
1261
+ - Historical trend analysis
1262
+ - Business rule compliance checking
1263
+
1264
+ **Deliverables**:
1265
+ - Quality score by dimension and table
1266
+ - Detailed issue identification and classification
1267
+ - Impact assessment and prioritization
1268
+ ${auto_fix_suggestions === 'true' ? '- Automated fix suggestions and scripts' : ''}
1269
+ - Data governance recommendations
1270
+ - Monitoring and maintenance strategies
1271
+
1272
+ Please conduct a thorough data quality audit focusing on ${quality_dimensions} dimensions.`
1273
+ }
1274
+ }
1275
+ ];
1276
+ break;
1277
+
1278
+ case 'predictive_analytics':
1279
+ const { table: predTable, target_field, prediction_horizon = 'next_month', model_type = 'trend_analysis', feature_fields } = promptArgs;
1280
+ messages = [
1281
+ {
1282
+ role: 'user',
1283
+ content: {
1284
+ type: 'text',
1285
+ text: `🔮 ADVANCED PREDICTIVE ANALYTICS
1286
+
1287
+ **Source Table**: ${predTable}
1288
+ **Target Field**: ${target_field}
1289
+ **Prediction Horizon**: ${prediction_horizon}
1290
+ **Model Type**: ${model_type}
1291
+ ${feature_fields ? `**Feature Fields**: ${feature_fields}` : ''}
1292
+
1293
+ **Predictive Modeling Process**:
1294
+ 1. Historical data analysis and trend identification
1295
+ 2. Feature engineering and variable selection
1296
+ 3. Model development using ${model_type} approach
1297
+ 4. Validation and accuracy assessment
1298
+ 5. Forecast generation for ${prediction_horizon}
1299
+ 6. Confidence intervals and uncertainty quantification
1300
+
1301
+ **${model_type.toUpperCase()} ANALYSIS**:
1302
+ ${model_type === 'time_series' ? '- Seasonal pattern detection\n- Trend decomposition\n- Cyclical behavior analysis' : ''}
1303
+ ${model_type === 'regression' ? '- Variable relationship modeling\n- Predictive factor identification\n- Statistical significance testing' : ''}
1304
+ ${model_type === 'classification' ? '- Category prediction modeling\n- Feature importance analysis\n- Classification accuracy metrics' : ''}
1305
+
1306
+ **Outputs**:
1307
+ - Historical pattern analysis
1308
+ - Predictive model performance metrics
1309
+ - Forecast values with confidence intervals
1310
+ - Key influencing factors identification
1311
+ - Model limitations and assumptions
1312
+ - Actionable insights and recommendations
1313
+
1314
+ Please develop a ${model_type} model to predict ${target_field} over ${prediction_horizon}.`
1315
+ }
1316
+ }
1317
+ ];
1318
+ break;
1319
+
1320
+ case 'natural_language_query':
1321
+ const { question, context_tables, response_format = 'narrative', include_confidence = 'true' } = promptArgs;
856
1322
  messages = [
857
1323
  {
858
1324
  role: 'user',
859
1325
  content: {
860
1326
  type: 'text',
861
- text: `Analyze the current Airtable setup and suggest ${optimization_focus} optimizations.
862
- ${base_overview ? `Base overview: ${base_overview}` : ''}
863
-
864
- Please review the table structures, field types, and relationships to recommend:
865
- - ${optimization_focus} improvements
866
- - Best practice implementations
867
- - Performance enhancements
868
- - Workflow streamlining opportunities`
1327
+ text: `🗣️ NATURAL LANGUAGE DATA QUERY
1328
+
1329
+ **Question**: "${question}"
1330
+ ${context_tables ? `**Context Tables**: ${context_tables}` : ''}
1331
+ **Response Format**: ${response_format}
1332
+ **Include Confidence**: ${include_confidence}
1333
+
1334
+ **Query Processing Framework**:
1335
+ 1. Question analysis and intent recognition
1336
+ 2. Relevant table and field identification
1337
+ 3. Data retrieval strategy formulation
1338
+ 4. Analysis execution and result compilation
1339
+ 5. Natural language response generation
1340
+
1341
+ **Analysis Approach**:
1342
+ - Semantic understanding of the question
1343
+ - Automatic table and field mapping
1344
+ - Intelligent data filtering and aggregation
1345
+ - Statistical analysis where appropriate
1346
+ - Context-aware interpretation
1347
+
1348
+ **Response Requirements**:
1349
+ ${response_format === 'narrative' ? '- Conversational, easy-to-understand explanation\n- Supporting data and evidence\n- Contextual insights and implications' : ''}
1350
+ ${response_format === 'data_summary' ? '- Structured data summary\n- Key metrics and statistics\n- Trend identification' : ''}
1351
+ ${response_format === 'visualization_suggestion' ? '- Chart and graph recommendations\n- Data visualization best practices\n- Tool-specific guidance' : ''}
1352
+ ${include_confidence === 'true' ? '\n- Confidence scores for answers\n- Data quality indicators\n- Uncertainty acknowledgment' : ''}
1353
+
1354
+ Please analyze the available data and provide a comprehensive answer to: "${question}"`
1355
+ }
1356
+ }
1357
+ ];
1358
+ break;
1359
+
1360
+ case 'smart_data_transformation':
1361
+ const { source_table, transformation_goal, target_format, quality_rules, preserve_history = 'true' } = promptArgs;
1362
+ messages = [
1363
+ {
1364
+ role: 'user',
1365
+ content: {
1366
+ type: 'text',
1367
+ text: `🔄 INTELLIGENT DATA TRANSFORMATION
1368
+
1369
+ **Source Table**: ${source_table}
1370
+ **Transformation Goal**: ${transformation_goal}
1371
+ ${target_format ? `**Target Format**: ${target_format}` : ''}
1372
+ ${quality_rules ? `**Quality Rules**: ${quality_rules}` : ''}
1373
+ **Preserve History**: ${preserve_history}
1374
+
1375
+ **Transformation Framework**:
1376
+ 1. Source data analysis and quality assessment
1377
+ 2. Transformation strategy development
1378
+ 3. Data mapping and conversion rules
1379
+ 4. Quality validation and error handling
1380
+ 5. Output optimization and validation
1381
+
1382
+ **${transformation_goal.toUpperCase()} PROCESS**:
1383
+ ${transformation_goal === 'normalize' ? '- Database normalization principles\n- Redundancy elimination\n- Relationship optimization' : ''}
1384
+ ${transformation_goal === 'standardize' ? '- Format standardization\n- Value normalization\n- Consistency enforcement' : ''}
1385
+ ${transformation_goal === 'enrich' ? '- Data augmentation strategies\n- External data integration\n- Value-added field creation' : ''}
1386
+ ${transformation_goal === 'cleanse' ? '- Data validation and correction\n- Duplicate removal\n- Missing value handling' : ''}
1387
+
1388
+ **Deliverables**:
1389
+ - Transformation execution plan
1390
+ - Data mapping specifications
1391
+ - Quality validation results
1392
+ - Performance optimization recommendations
1393
+ ${preserve_history === 'true' ? '- Change audit trail and versioning' : ''}
1394
+ - Post-transformation validation
1395
+
1396
+ Please analyze the source data and execute ${transformation_goal} transformation with intelligent optimization.`
1397
+ }
1398
+ }
1399
+ ];
1400
+ break;
1401
+
1402
+ case 'automation_recommendations':
1403
+ const { workflow_description, automation_scope = 'single_table', frequency_patterns, complexity_tolerance = 'moderate', integration_capabilities } = promptArgs;
1404
+ messages = [
1405
+ {
1406
+ role: 'user',
1407
+ content: {
1408
+ type: 'text',
1409
+ text: `🤖 INTELLIGENT AUTOMATION RECOMMENDATIONS
1410
+
1411
+ **Automation Scope**: ${automation_scope}
1412
+ **Complexity Tolerance**: ${complexity_tolerance}
1413
+ ${workflow_description ? `**Current Workflow**: ${workflow_description}` : ''}
1414
+ ${frequency_patterns ? `**Frequency Patterns**: ${frequency_patterns}` : ''}
1415
+ ${integration_capabilities ? `**Integration Tools**: ${integration_capabilities}` : ''}
1416
+
1417
+ **Automation Analysis Framework**:
1418
+ 1. Workflow pattern analysis and task identification
1419
+ 2. Automation opportunity assessment and prioritization
1420
+ 3. Technical feasibility and complexity evaluation
1421
+ 4. ROI calculation and benefit quantification
1422
+ 5. Implementation roadmap development
1423
+
1424
+ **${automation_scope.toUpperCase()} AUTOMATION**:
1425
+ ${automation_scope === 'single_table' ? '- Field auto-population rules\n- Data validation automation\n- Notification triggers' : ''}
1426
+ ${automation_scope === 'multi_table' ? '- Cross-table data synchronization\n- Workflow orchestration\n- Complex business logic automation' : ''}
1427
+ ${automation_scope === 'external_integration' ? '- API integration strategies\n- Data pipeline automation\n- Third-party tool connectivity' : ''}
1428
+
1429
+ **Recommendations**:
1430
+ - High-impact automation opportunities
1431
+ - Implementation complexity assessment
1432
+ - Cost-benefit analysis with ROI projections
1433
+ - Technical requirements and dependencies
1434
+ - Risk assessment and mitigation strategies
1435
+ - Success metrics and monitoring approach
1436
+
1437
+ Please analyze the workflow patterns and provide ${complexity_tolerance}-level automation recommendations for ${automation_scope} scope.`
869
1438
  }
870
1439
  }
871
1440
  ];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rashidazarang/airtable-mcp",
3
- "version": "2.2.1",
4
- "description": "Airtable MCP server for Claude Desktop - Connect directly to Airtable using natural language",
3
+ "version": "3.0.0",
4
+ "description": "Advanced AI-powered Airtable MCP server with intelligent analytics, predictive modeling, and enterprise automation capabilities",
5
5
  "main": "airtable_simple_production.js",
6
6
  "bin": {
7
7
  "airtable-mcp": "./airtable_simple_production.js"