@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/index.d.ts DELETED
@@ -1,357 +0,0 @@
1
- /**
2
- * Airtable MCP Server TypeScript Definitions
3
- * Enterprise-grade type safety for AI-powered Airtable operations
4
- */
5
-
6
- // ============================================================================
7
- // MCP Protocol Types (2024-11-05 Specification)
8
- // ============================================================================
9
-
10
- export interface MCPRequest {
11
- jsonrpc: '2.0';
12
- id: string | number;
13
- method: string;
14
- params?: Record<string, unknown>;
15
- }
16
-
17
- export interface MCPResponse {
18
- jsonrpc: '2.0';
19
- id: string | number;
20
- result?: unknown;
21
- error?: MCPError;
22
- }
23
-
24
- export interface MCPError {
25
- code: number;
26
- message: string;
27
- data?: unknown;
28
- }
29
-
30
- export interface MCPServerCapabilities {
31
- tools?: {
32
- listChanged?: boolean;
33
- };
34
- prompts?: {
35
- listChanged?: boolean;
36
- };
37
- resources?: {
38
- subscribe?: boolean;
39
- listChanged?: boolean;
40
- };
41
- roots?: {
42
- listChanged?: boolean;
43
- };
44
- sampling?: Record<string, unknown>;
45
- logging?: Record<string, unknown>;
46
- }
47
-
48
- export interface MCPServerInfo {
49
- name: string;
50
- version: string;
51
- protocolVersion: string;
52
- capabilities: MCPServerCapabilities;
53
- }
54
-
55
- // ============================================================================
56
- // Tool Schema Types
57
- // ============================================================================
58
-
59
- export interface ToolParameter {
60
- type: 'string' | 'number' | 'boolean' | 'object' | 'array';
61
- description: string;
62
- required?: boolean;
63
- default?: unknown;
64
- enum?: string[];
65
- }
66
-
67
- export interface ToolSchema {
68
- name: string;
69
- description: string;
70
- inputSchema: {
71
- type: 'object';
72
- properties: Record<string, ToolParameter>;
73
- required?: string[];
74
- };
75
- }
76
-
77
- // ============================================================================
78
- // AI Prompt Types
79
- // ============================================================================
80
-
81
- export interface PromptArgument {
82
- name: string;
83
- description: string;
84
- required: boolean;
85
- type?: 'string' | 'number' | 'boolean';
86
- enum?: string[];
87
- }
88
-
89
- export interface PromptSchema {
90
- name: string;
91
- description: string;
92
- arguments: PromptArgument[];
93
- }
94
-
95
- export type AnalysisType =
96
- | 'trends'
97
- | 'statistical'
98
- | 'patterns'
99
- | 'predictive'
100
- | 'anomaly_detection'
101
- | 'correlation_matrix';
102
-
103
- export type ConfidenceLevel = 0.90 | 0.95 | 0.99;
104
-
105
- export interface AnalysisOptions {
106
- table: string;
107
- analysis_type?: AnalysisType;
108
- field_focus?: string;
109
- time_dimension?: string;
110
- confidence_level?: ConfidenceLevel;
111
- }
112
-
113
- export interface PredictiveAnalyticsOptions {
114
- table: string;
115
- target_field: string;
116
- prediction_periods?: number;
117
- algorithm?: 'linear_regression' | 'arima' | 'exponential_smoothing' | 'random_forest';
118
- include_confidence_intervals?: boolean;
119
- historical_periods?: number;
120
- }
121
-
122
- export interface StatisticalResult {
123
- confidence_interval: [number, number];
124
- significance_level: number;
125
- p_value?: number;
126
- correlation_coefficient?: number;
127
- }
128
-
129
- // ============================================================================
130
- // Airtable API Types
131
- // ============================================================================
132
-
133
- export interface AirtableFieldType {
134
- type: 'singleLineText' | 'multilineText' | 'richText' | 'email' | 'url' | 'phoneNumber' |
135
- 'number' | 'percent' | 'currency' | 'singleSelect' | 'multipleSelects' |
136
- 'date' | 'dateTime' | 'checkbox' | 'rating' | 'formula' | 'rollup' |
137
- 'count' | 'lookup' | 'createdTime' | 'lastModifiedTime' | 'createdBy' |
138
- 'lastModifiedBy' | 'attachment' | 'barcode' | 'button';
139
- }
140
-
141
- export interface AirtableField {
142
- id: string;
143
- name: string;
144
- type: AirtableFieldType['type'];
145
- options?: Record<string, unknown>;
146
- description?: string;
147
- }
148
-
149
- export interface AirtableTable {
150
- id: string;
151
- name: string;
152
- description?: string;
153
- primaryFieldId: string;
154
- fields: AirtableField[];
155
- views: AirtableView[];
156
- }
157
-
158
- export interface AirtableView {
159
- id: string;
160
- name: string;
161
- type: 'grid' | 'form' | 'calendar' | 'gallery' | 'kanban';
162
- }
163
-
164
- export interface AirtableRecord {
165
- id: string;
166
- fields: Record<string, unknown>;
167
- createdTime: string;
168
- }
169
-
170
- export interface AirtableBase {
171
- id: string;
172
- name: string;
173
- permissionLevel: 'read' | 'comment' | 'edit' | 'create';
174
- tables: AirtableTable[];
175
- }
176
-
177
- export interface AirtableWebhook {
178
- id: string;
179
- macSecretBase64: string;
180
- expirationTime: string;
181
- notificationUrl: string;
182
- isHookEnabled: boolean;
183
- cursorForNextPayload: number;
184
- lastSuccessfulNotificationTime?: string;
185
- }
186
-
187
- export interface WebhookPayload {
188
- timestamp: string;
189
- base: {
190
- id: string;
191
- };
192
- webhook: {
193
- id: string;
194
- };
195
- changedTablesById: Record<string, {
196
- changedRecordsById: Record<string, {
197
- current?: AirtableRecord;
198
- previous?: AirtableRecord;
199
- }>;
200
- }>;
201
- }
202
-
203
- // ============================================================================
204
- // Server Configuration Types
205
- // ============================================================================
206
-
207
- export interface ServerConfig {
208
- PORT: number;
209
- HOST: string;
210
- MAX_REQUESTS_PER_MINUTE: number;
211
- LOG_LEVEL: 'ERROR' | 'WARN' | 'INFO' | 'DEBUG' | 'TRACE';
212
- }
213
-
214
- export interface AuthConfig {
215
- AIRTABLE_TOKEN: string;
216
- AIRTABLE_BASE_ID: string;
217
- }
218
-
219
- export interface OAuth2Config {
220
- client_id: string;
221
- redirect_uri: string;
222
- state: string;
223
- code_challenge?: string;
224
- code_challenge_method?: 'S256';
225
- }
226
-
227
- // ============================================================================
228
- // Batch Operation Types
229
- // ============================================================================
230
-
231
- export interface BatchCreateRecord {
232
- fields: Record<string, unknown>;
233
- }
234
-
235
- export interface BatchUpdateRecord {
236
- id: string;
237
- fields: Record<string, unknown>;
238
- }
239
-
240
- export interface BatchDeleteRecord {
241
- id: string;
242
- }
243
-
244
- export interface BatchUpsertRecord {
245
- key_field: string;
246
- key_value: string;
247
- fields: Record<string, unknown>;
248
- }
249
-
250
- // ============================================================================
251
- // Advanced Analytics Types
252
- // ============================================================================
253
-
254
- export interface DataQualityReport {
255
- total_records: number;
256
- missing_values: Record<string, number>;
257
- duplicate_records: string[];
258
- data_types: Record<string, string>;
259
- quality_score: number;
260
- recommendations: string[];
261
- }
262
-
263
- export interface WorkflowOptimization {
264
- current_efficiency: number;
265
- bottlenecks: string[];
266
- automation_opportunities: Array<{
267
- field: string;
268
- suggestion: string;
269
- impact_level: 'high' | 'medium' | 'low';
270
- implementation_complexity: 'simple' | 'moderate' | 'complex';
271
- }>;
272
- estimated_time_savings: string;
273
- }
274
-
275
- export interface SchemaOptimization {
276
- field_recommendations: Array<{
277
- field: string;
278
- current_type: string;
279
- suggested_type: string;
280
- reason: string;
281
- }>;
282
- index_suggestions: string[];
283
- normalization_opportunities: string[];
284
- compliance_notes: string[];
285
- }
286
-
287
- // ============================================================================
288
- // Root Directory Types
289
- // ============================================================================
290
-
291
- export interface RootDirectory {
292
- uri: string;
293
- name: string;
294
- description?: string;
295
- }
296
-
297
- // ============================================================================
298
- // Error Types
299
- // ============================================================================
300
-
301
- export class AirtableError extends Error {
302
- public code: string;
303
- public statusCode?: number;
304
-
305
- constructor(message: string, code: string, statusCode?: number) {
306
- super(message);
307
- this.name = 'AirtableError';
308
- this.code = code;
309
- this.statusCode = statusCode;
310
- }
311
- }
312
-
313
- export class ValidationError extends Error {
314
- public field: string;
315
-
316
- constructor(message: string, field: string) {
317
- super(message);
318
- this.name = 'ValidationError';
319
- this.field = field;
320
- }
321
- }
322
-
323
- // ============================================================================
324
- // Utility Types
325
- // ============================================================================
326
-
327
- export type DeepPartial<T> = {
328
- [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
329
- };
330
-
331
- export type RequiredFields<T, K extends keyof T> = T & Required<Pick<T, K>>;
332
-
333
- export type OptionalFields<T, K extends keyof T> = T & Partial<Pick<T, K>>;
334
-
335
- // ============================================================================
336
- // Main Server Class Type
337
- // ============================================================================
338
-
339
- export interface AirtableMCPServer {
340
- config: ServerConfig;
341
- authConfig: AuthConfig;
342
- tools: ToolSchema[];
343
- prompts: PromptSchema[];
344
-
345
- initialize(capabilities: MCPServerCapabilities): Promise<MCPServerInfo>;
346
- handleToolCall(name: string, params: Record<string, unknown>): Promise<unknown>;
347
- handlePromptGet(name: string, args: Record<string, unknown>): Promise<{ messages: Array<{ role: string; content: { type: string; text: string } }> }>;
348
- start(): Promise<void>;
349
- stop(): Promise<void>;
350
- }
351
-
352
- // ============================================================================
353
- // Export All Types
354
- // ============================================================================
355
-
356
- export * from './tools';
357
- export * from './ai-prompts';