@rashidazarang/airtable-mcp 3.1.0 → 3.2.8

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.
Files changed (106) hide show
  1. package/README.md +209 -334
  2. package/bin/airtable-mcp.js +12 -32
  3. package/dist/typescript/airtable-mcp-server.js +77 -0
  4. package/dist/typescript/airtable-mcp-server.js.map +1 -0
  5. package/dist/typescript/app/airtable-client.js +327 -0
  6. package/dist/typescript/app/airtable-client.js.map +1 -0
  7. package/dist/typescript/app/config.js +151 -0
  8. package/dist/typescript/app/config.js.map +1 -0
  9. package/dist/typescript/app/context.js +3 -0
  10. package/dist/typescript/app/context.js.map +1 -0
  11. package/dist/typescript/app/exceptions.js +85 -0
  12. package/dist/typescript/app/exceptions.js.map +1 -0
  13. package/dist/typescript/app/governance.js +58 -0
  14. package/dist/typescript/app/governance.js.map +1 -0
  15. package/dist/typescript/app/logger.js +47 -0
  16. package/dist/typescript/app/logger.js.map +1 -0
  17. package/dist/typescript/app/rateLimiter.js +37 -0
  18. package/dist/typescript/app/rateLimiter.js.map +1 -0
  19. package/dist/typescript/app/sanitize.js +95 -0
  20. package/dist/typescript/app/sanitize.js.map +1 -0
  21. package/dist/typescript/app/tools/create.js +55 -0
  22. package/dist/typescript/app/tools/create.js.map +1 -0
  23. package/dist/typescript/app/tools/describe.js +190 -0
  24. package/dist/typescript/app/tools/describe.js.map +1 -0
  25. package/dist/typescript/app/tools/handleError.js +205 -0
  26. package/dist/typescript/app/tools/handleError.js.map +1 -0
  27. package/dist/typescript/app/tools/index.js +24 -0
  28. package/dist/typescript/app/tools/index.js.map +1 -0
  29. package/dist/typescript/app/tools/listBases.js +47 -0
  30. package/dist/typescript/app/tools/listBases.js.map +1 -0
  31. package/dist/typescript/app/tools/listExceptions.js +16 -0
  32. package/dist/typescript/app/tools/listExceptions.js.map +1 -0
  33. package/dist/typescript/app/tools/listGovernance.js +15 -0
  34. package/dist/typescript/app/tools/listGovernance.js.map +1 -0
  35. package/dist/typescript/app/tools/query.js +133 -0
  36. package/dist/typescript/app/tools/query.js.map +1 -0
  37. package/dist/typescript/app/tools/response.js +21 -0
  38. package/dist/typescript/app/tools/response.js.map +1 -0
  39. package/dist/typescript/app/tools/update.js +57 -0
  40. package/dist/typescript/app/tools/update.js.map +1 -0
  41. package/dist/typescript/app/tools/upsert.js +66 -0
  42. package/dist/typescript/app/tools/upsert.js.map +1 -0
  43. package/dist/typescript/app/tools/webhooks.js +45 -0
  44. package/dist/typescript/app/tools/webhooks.js.map +1 -0
  45. package/dist/typescript/app/types.js +291 -0
  46. package/dist/typescript/app/types.js.map +1 -0
  47. package/dist/typescript/app/validateApiKey.js +75 -0
  48. package/dist/typescript/app/validateApiKey.js.map +1 -0
  49. package/dist/typescript/errors.js +75 -0
  50. package/dist/typescript/errors.js.map +1 -0
  51. package/dist/typescript/index.js +27 -0
  52. package/dist/typescript/index.js.map +1 -0
  53. package/package.json +49 -31
  54. package/tsconfig.json +10 -4
  55. package/types/typescript/airtable-mcp-server.d.ts +2 -0
  56. package/types/typescript/app/airtable-client.d.ts +50 -0
  57. package/types/typescript/app/config.d.ts +17 -0
  58. package/types/typescript/app/context.d.ts +12 -0
  59. package/types/typescript/app/exceptions.d.ts +12 -0
  60. package/types/typescript/app/governance.d.ts +18 -0
  61. package/types/typescript/app/logger.d.ts +13 -0
  62. package/types/typescript/app/rateLimiter.d.ts +13 -0
  63. package/types/typescript/app/sanitize.d.ts +50 -0
  64. package/types/typescript/app/tools/create.d.ts +3 -0
  65. package/types/typescript/app/tools/describe.d.ts +3 -0
  66. package/types/typescript/app/tools/handleError.d.ts +8 -0
  67. package/types/typescript/app/tools/index.d.ts +3 -0
  68. package/types/typescript/app/tools/listBases.d.ts +13 -0
  69. package/types/typescript/app/tools/listExceptions.d.ts +3 -0
  70. package/types/typescript/app/tools/listGovernance.d.ts +3 -0
  71. package/types/typescript/app/tools/query.d.ts +3 -0
  72. package/types/typescript/app/tools/response.d.ts +20 -0
  73. package/types/typescript/app/tools/update.d.ts +3 -0
  74. package/types/typescript/app/tools/upsert.d.ts +3 -0
  75. package/types/typescript/app/tools/webhooks.d.ts +3 -0
  76. package/types/typescript/app/types.d.ts +318 -0
  77. package/types/typescript/app/validateApiKey.d.ts +25 -0
  78. package/types/typescript/errors.d.ts +57 -0
  79. package/types/typescript/index.d.ts +10 -0
  80. package/types/typescript/prompt-templates.d.ts +5 -0
  81. package/types/typescript/tools-schemas.d.ts +5 -0
  82. package/airtable_simple.js +0 -1561
  83. package/airtable_simple_production.js +0 -1564
  84. package/dist/airtable-mcp-server.js +0 -660
  85. package/dist/airtable-mcp-server.js.map +0 -1
  86. package/dist/test-suite.js +0 -421
  87. package/dist/test-suite.js.map +0 -1
  88. package/examples/airtable-crud-example.js +0 -203
  89. package/examples/building-mcp.md +0 -6666
  90. package/examples/claude_config.json +0 -4
  91. package/examples/claude_simple_config.json +0 -7
  92. package/examples/env-demo.js +0 -172
  93. package/examples/example-tasks-update.json +0 -23
  94. package/examples/example-tasks.json +0 -26
  95. package/examples/example_usage.md +0 -124
  96. package/examples/python_debug_patch.txt +0 -27
  97. package/examples/sample-transform.js +0 -76
  98. package/examples/typescript/advanced-ai-prompts.ts +0 -447
  99. package/examples/typescript/basic-usage.ts +0 -174
  100. package/examples/typescript/claude-desktop-config.json +0 -29
  101. package/examples/windsurf_mcp_config.json +0 -17
  102. package/types/ai-prompts.d.ts +0 -321
  103. package/types/airtable-mcp-server.d.ts +0 -52
  104. package/types/index.d.ts +0 -357
  105. package/types/tools.d.ts +0 -514
  106. /package/types/{test-suite.d.ts → typescript/test-suite.d.ts} +0 -0
package/types/tools.d.ts DELETED
@@ -1,514 +0,0 @@
1
- /**
2
- * Tool Schema Type Definitions
3
- * Comprehensive TypeScript types for all 33 Airtable MCP tools
4
- */
5
-
6
- import { ToolSchema } from './index';
7
-
8
- // ============================================================================
9
- // Data Operation Tool Interfaces
10
- // ============================================================================
11
-
12
- export interface ListTablesInput {
13
- include_schema?: boolean;
14
- }
15
-
16
- export interface ListRecordsInput {
17
- [key: string]: unknown;
18
- table: string;
19
- maxRecords?: number;
20
- view?: string;
21
- filterByFormula?: string;
22
- sort?: Array<{ field: string; direction: 'asc' | 'desc' }>;
23
- pageSize?: number;
24
- offset?: string;
25
- }
26
-
27
- export interface GetRecordInput {
28
- table: string;
29
- recordId: string;
30
- }
31
-
32
- export interface CreateRecordInput {
33
- table: string;
34
- fields: Record<string, unknown>;
35
- typecast?: boolean;
36
- }
37
-
38
- export interface UpdateRecordInput {
39
- table: string;
40
- recordId: string;
41
- fields: Record<string, unknown>;
42
- typecast?: boolean;
43
- }
44
-
45
- export interface DeleteRecordInput {
46
- table: string;
47
- recordId: string;
48
- }
49
-
50
- export interface SearchRecordsInput {
51
- table: string;
52
- filterByFormula?: string;
53
- sort?: Array<{ field: string; direction: 'asc' | 'desc' }>;
54
- maxRecords?: number;
55
- view?: string;
56
- }
57
-
58
- // ============================================================================
59
- // Webhook Management Tool Interfaces
60
- // ============================================================================
61
-
62
- export interface ListWebhooksInput {
63
- cursor?: string;
64
- }
65
-
66
- export interface CreateWebhookInput {
67
- notificationUrl: string;
68
- specification?: {
69
- options?: {
70
- filters?: {
71
- dataTypes?: ('tableData' | 'tableSchema')[];
72
- recordChangeScope?: string;
73
- watchDataInTableIds?: string[];
74
- };
75
- };
76
- };
77
- }
78
-
79
- export interface DeleteWebhookInput {
80
- webhookId: string;
81
- }
82
-
83
- export interface GetWebhookPayloadsInput {
84
- webhookId: string;
85
- cursor?: string;
86
- limit?: number;
87
- }
88
-
89
- export interface RefreshWebhookInput {
90
- webhookId: string;
91
- }
92
-
93
- // ============================================================================
94
- // Schema Discovery Tool Interfaces
95
- // ============================================================================
96
-
97
- export interface ListBasesInput {
98
- offset?: string;
99
- }
100
-
101
- export interface GetBaseSchemaInput {
102
- baseId?: string;
103
- }
104
-
105
- export interface DescribeTableInput {
106
- table: string;
107
- include_sample_data?: boolean;
108
- }
109
-
110
- export interface ListFieldTypesInput {
111
- category?: 'basic' | 'advanced' | 'computed';
112
- }
113
-
114
- export interface GetTableViewsInput {
115
- table: string;
116
- }
117
-
118
- // ============================================================================
119
- // Table Management Tool Interfaces
120
- // ============================================================================
121
-
122
- export interface CreateTableInput {
123
- name: string;
124
- description?: string;
125
- fields: Array<{
126
- name: string;
127
- type: string;
128
- description?: string;
129
- options?: Record<string, unknown>;
130
- }>;
131
- }
132
-
133
- export interface UpdateTableInput {
134
- table: string;
135
- name?: string;
136
- description?: string;
137
- }
138
-
139
- export interface DeleteTableInput {
140
- table: string;
141
- confirmation?: string;
142
- }
143
-
144
- // ============================================================================
145
- // Field Management Tool Interfaces
146
- // ============================================================================
147
-
148
- export interface CreateFieldInput {
149
- table: string;
150
- name: string;
151
- type: string;
152
- description?: string;
153
- options?: Record<string, unknown>;
154
- }
155
-
156
- export interface UpdateFieldInput {
157
- table: string;
158
- fieldId: string;
159
- name?: string;
160
- description?: string;
161
- options?: Record<string, unknown>;
162
- }
163
-
164
- export interface DeleteFieldInput {
165
- table: string;
166
- fieldId: string;
167
- confirmation?: string;
168
- }
169
-
170
- // ============================================================================
171
- // Batch Operations Tool Interfaces
172
- // ============================================================================
173
-
174
- export interface BatchCreateRecordsInput {
175
- table: string;
176
- records: Array<{
177
- fields: Record<string, unknown>;
178
- }>;
179
- typecast?: boolean;
180
- }
181
-
182
- export interface BatchUpdateRecordsInput {
183
- table: string;
184
- records: Array<{
185
- id: string;
186
- fields: Record<string, unknown>;
187
- }>;
188
- typecast?: boolean;
189
- }
190
-
191
- export interface BatchDeleteRecordsInput {
192
- table: string;
193
- records: Array<{
194
- id: string;
195
- }>;
196
- }
197
-
198
- export interface BatchUpsertRecordsInput {
199
- table: string;
200
- records: Array<{
201
- key_field: string;
202
- key_value: string;
203
- fields: Record<string, unknown>;
204
- }>;
205
- typecast?: boolean;
206
- }
207
-
208
- // ============================================================================
209
- // Attachment Management Tool Interfaces
210
- // ============================================================================
211
-
212
- export interface UploadAttachmentInput {
213
- table: string;
214
- recordId: string;
215
- fieldName: string;
216
- url: string;
217
- filename?: string;
218
- }
219
-
220
- // ============================================================================
221
- // Advanced Views Tool Interfaces
222
- // ============================================================================
223
-
224
- export interface CreateViewInput {
225
- table: string;
226
- name: string;
227
- type: 'grid' | 'form' | 'calendar' | 'gallery' | 'kanban';
228
- visibleFieldIds?: string[];
229
- filterByFormula?: string;
230
- sort?: Array<{ field: string; direction: 'asc' | 'desc' }>;
231
- }
232
-
233
- export interface GetViewMetadataInput {
234
- table: string;
235
- viewId: string;
236
- }
237
-
238
- // ============================================================================
239
- // Base Management Tool Interfaces
240
- // ============================================================================
241
-
242
- export interface CreateBaseInput {
243
- name: string;
244
- workspaceId?: string;
245
- tables?: Array<{
246
- name: string;
247
- description?: string;
248
- fields: Array<{
249
- name: string;
250
- type: string;
251
- options?: Record<string, unknown>;
252
- }>;
253
- }>;
254
- }
255
-
256
- export interface ListCollaboratorsInput {
257
- baseId?: string;
258
- }
259
-
260
- export interface ListSharesInput {
261
- baseId?: string;
262
- }
263
-
264
- // ============================================================================
265
- // Tool Response Interfaces
266
- // ============================================================================
267
-
268
- export interface ToolResponse<T = unknown> {
269
- content: Array<{
270
- type: 'text' | 'image' | 'resource';
271
- text?: string;
272
- data?: T;
273
- mimeType?: string;
274
- }>;
275
- isError?: boolean;
276
- }
277
-
278
- export interface PaginatedResponse<T> {
279
- records?: T[];
280
- offset?: string;
281
- }
282
-
283
- export interface TableInfo {
284
- id: string;
285
- name: string;
286
- description?: string;
287
- primaryFieldId: string;
288
- fields: Array<{
289
- id: string;
290
- name: string;
291
- type: string;
292
- options?: Record<string, unknown>;
293
- description?: string;
294
- }>;
295
- views: Array<{
296
- id: string;
297
- name: string;
298
- type: string;
299
- }>;
300
- }
301
-
302
- export interface RecordInfo {
303
- id: string;
304
- fields: Record<string, unknown>;
305
- createdTime: string;
306
- commentCount?: number;
307
- }
308
-
309
- export interface WebhookInfo {
310
- id: string;
311
- macSecretBase64: string;
312
- expirationTime: string;
313
- notificationUrl: string;
314
- isHookEnabled: boolean;
315
- specification: {
316
- options: {
317
- filters: {
318
- dataTypes: string[];
319
- recordChangeScope?: string;
320
- watchDataInTableIds?: string[];
321
- };
322
- };
323
- };
324
- }
325
-
326
- export interface BaseInfo {
327
- id: string;
328
- name: string;
329
- permissionLevel: 'read' | 'comment' | 'edit' | 'create';
330
- }
331
-
332
- export interface FieldTypeInfo {
333
- type: string;
334
- name: string;
335
- description: string;
336
- supportedOptions?: string[];
337
- examples?: Record<string, unknown>[];
338
- }
339
-
340
- export interface ViewInfo {
341
- id: string;
342
- name: string;
343
- type: 'grid' | 'form' | 'calendar' | 'gallery' | 'kanban' | 'timeline' | 'block';
344
- visibleFieldIds?: string[];
345
- filterByFormula?: string;
346
- sort?: Array<{
347
- field: string;
348
- direction: 'asc' | 'desc';
349
- }>;
350
- }
351
-
352
- export interface CollaboratorInfo {
353
- type: 'user' | 'group';
354
- id: string;
355
- email?: string;
356
- name?: string;
357
- permissionLevel: 'read' | 'comment' | 'edit' | 'create';
358
- createdTime: string;
359
- }
360
-
361
- export interface ShareInfo {
362
- id: string;
363
- type: 'view' | 'base';
364
- url: string;
365
- isPasswordRequired: boolean;
366
- allowedActions: string[];
367
- restriction?: {
368
- dateRange?: {
369
- startDate?: string;
370
- endDate?: string;
371
- };
372
- allowCommenting?: boolean;
373
- allowCopyingData?: boolean;
374
- };
375
- }
376
-
377
- // ============================================================================
378
- // Complete Tool Schema Definitions
379
- // ============================================================================
380
-
381
- export const COMPLETE_TOOL_SCHEMAS: ToolSchema[] = [
382
- // Data Operations (7 tools)
383
- {
384
- name: 'list_tables',
385
- description: 'Get all tables in your base with schema information',
386
- inputSchema: {
387
- type: 'object',
388
- properties: {
389
- include_schema: { type: 'boolean', description: 'Include field schema information', default: false }
390
- }
391
- }
392
- },
393
- {
394
- name: 'list_records',
395
- description: 'Query records with optional filtering and pagination',
396
- inputSchema: {
397
- type: 'object',
398
- properties: {
399
- table: { type: 'string', description: 'Table name or ID' },
400
- maxRecords: { type: 'number', description: 'Maximum number of records to return' },
401
- view: { type: 'string', description: 'View name or ID' },
402
- filterByFormula: { type: 'string', description: 'Airtable formula to filter records' },
403
- sort: { type: 'array', description: 'Sort configuration' },
404
- pageSize: { type: 'number', description: 'Number of records per page' },
405
- offset: { type: 'string', description: 'Pagination offset' }
406
- },
407
- required: ['table']
408
- }
409
- },
410
- {
411
- name: 'get_record',
412
- description: 'Retrieve a single record by ID',
413
- inputSchema: {
414
- type: 'object',
415
- properties: {
416
- table: { type: 'string', description: 'Table name or ID' },
417
- recordId: { type: 'string', description: 'Record ID' }
418
- },
419
- required: ['table', 'recordId']
420
- }
421
- },
422
- {
423
- name: 'create_record',
424
- description: 'Add new records to any table',
425
- inputSchema: {
426
- type: 'object',
427
- properties: {
428
- table: { type: 'string', description: 'Table name or ID' },
429
- fields: { type: 'object', description: 'Field values for the new record' },
430
- typecast: { type: 'boolean', description: 'Automatically typecast field values' }
431
- },
432
- required: ['table', 'fields']
433
- }
434
- },
435
- {
436
- name: 'update_record',
437
- description: 'Modify existing record fields',
438
- inputSchema: {
439
- type: 'object',
440
- properties: {
441
- table: { type: 'string', description: 'Table name or ID' },
442
- recordId: { type: 'string', description: 'Record ID to update' },
443
- fields: { type: 'object', description: 'Fields to update' },
444
- typecast: { type: 'boolean', description: 'Automatically typecast field values' }
445
- },
446
- required: ['table', 'recordId', 'fields']
447
- }
448
- },
449
- {
450
- name: 'delete_record',
451
- description: 'Remove records from a table',
452
- inputSchema: {
453
- type: 'object',
454
- properties: {
455
- table: { type: 'string', description: 'Table name or ID' },
456
- recordId: { type: 'string', description: 'Record ID to delete' }
457
- },
458
- required: ['table', 'recordId']
459
- }
460
- },
461
- {
462
- name: 'search_records',
463
- description: 'Advanced search with Airtable formulas and sorting',
464
- inputSchema: {
465
- type: 'object',
466
- properties: {
467
- table: { type: 'string', description: 'Table name or ID' },
468
- filterByFormula: { type: 'string', description: 'Search formula' },
469
- sort: { type: 'array', description: 'Sort configuration' },
470
- maxRecords: { type: 'number', description: 'Maximum records to return' },
471
- view: { type: 'string', description: 'View to search within' }
472
- },
473
- required: ['table']
474
- }
475
- }
476
- // Note: Additional tool schemas would continue here for all 33 tools
477
- // This is a representative sample showing the structure
478
- ];
479
-
480
- // ============================================================================
481
- // Export All Tool Types
482
- // ============================================================================
483
-
484
- export {
485
- ListTablesInput,
486
- ListRecordsInput,
487
- GetRecordInput,
488
- CreateRecordInput,
489
- UpdateRecordInput,
490
- DeleteRecordInput,
491
- SearchRecordsInput,
492
-
493
- ListWebhooksInput,
494
- CreateWebhookInput,
495
- DeleteWebhookInput,
496
- GetWebhookPayloadsInput,
497
- RefreshWebhookInput,
498
-
499
- BatchCreateRecordsInput,
500
- BatchUpdateRecordsInput,
501
- BatchDeleteRecordsInput,
502
- BatchUpsertRecordsInput,
503
-
504
- ToolResponse,
505
- PaginatedResponse,
506
- TableInfo,
507
- RecordInfo,
508
- WebhookInfo,
509
- BaseInfo,
510
- FieldTypeInfo,
511
- ViewInfo,
512
- CollaboratorInfo,
513
- ShareInfo
514
- };