@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
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWebhookTools = registerWebhookTools;
4
+ const handleError_1 = require("./handleError");
5
+ const response_1 = require("./response");
6
+ function registerWebhookTools(server, ctx) {
7
+ server.registerTool('list_webhooks', { description: 'List Airtable webhooks for the default base.' }, async (_args) => {
8
+ try {
9
+ const baseId = ctx.config.auth.defaultBaseId || ctx.config.auth.allowedBases[0];
10
+ if (!baseId)
11
+ throw new Error('No base configured');
12
+ const body = await ctx.airtable.queryRecords(baseId, 'meta/webhooks');
13
+ return (0, response_1.createToolResponse)({ webhooks: body });
14
+ }
15
+ catch (error) {
16
+ return (0, handleError_1.handleToolError)('list_webhooks', error, ctx);
17
+ }
18
+ });
19
+ server.registerTool('create_webhook', { description: 'Create a new webhook for a base.' }, async (args) => {
20
+ try {
21
+ const baseId = args.baseId || ctx.config.auth.defaultBaseId || ctx.config.auth.allowedBases[0];
22
+ if (!baseId)
23
+ throw new Error('No base configured');
24
+ const payload = { notificationUrl: String(args.notificationUrl || '') };
25
+ const result = await ctx.airtable.createRecords(baseId, 'meta/webhooks', payload);
26
+ return (0, response_1.createToolResponse)({ webhook: result });
27
+ }
28
+ catch (error) {
29
+ return (0, handleError_1.handleToolError)('create_webhook', error, ctx);
30
+ }
31
+ });
32
+ server.registerTool('refresh_webhook', { description: 'Refresh webhook expiration.' }, async (args) => {
33
+ try {
34
+ const baseId = args.baseId || ctx.config.auth.defaultBaseId || ctx.config.auth.allowedBases[0];
35
+ if (!baseId)
36
+ throw new Error('No base configured');
37
+ const result = await ctx.airtable.updateRecords(baseId, `meta/webhooks/${String(args.webhookId)}/refresh`, {});
38
+ return (0, response_1.createToolResponse)({ webhook: result });
39
+ }
40
+ catch (error) {
41
+ return (0, handleError_1.handleToolError)('refresh_webhook', error, ctx);
42
+ }
43
+ });
44
+ }
45
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../../src/typescript/app/tools/webhooks.ts"],"names":[],"mappings":";;AAKA,oDA8CC;AAjDD,+CAAgD;AAChD,yCAAgD;AAEhD,SAAgB,oBAAoB,CAAC,MAAiB,EAAE,GAAe;IACrE,MAAM,CAAC,YAAY,CACjB,eAAe,EACf,EAAE,WAAW,EAAE,8CA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EAAE,MAAiC,EAAE,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAA,6BAAe,EAAC,gBAAgB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB,EAAE,WAAW,EAAE,6BAA6B,EAAE,EAC9C,KAAK,EAAE,IAA6B,EAAE,EAAE;QACtC,IAAI,CAAC;YACH,MAAM,MAAM,GAAI,IAAI,CAAC,MAAiB,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC3G,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,iBAAiB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,EAAS,CAAC,CAAC;YACtH,OAAO,IAAA,6BAAkB,EAAC,EAAE,OAAO,EAAE,MAAiC,EAAE,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAA,6BAAe,EAAC,iBAAiB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACxD,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,291 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.governanceOutputSchema = exports.listExceptionsOutputSchema = exports.exceptionItemSchema = exports.listExceptionsInputSchema = exports.upsertOutputSchema = exports.upsertInputSchema = exports.updateInputSchema = exports.updateOutputSchema = exports.createOutputSchema = exports.createInputSchema = exports.queryOutputSchema = exports.queryInputShape = exports.queryInputSchema = exports.describeOutputSchema = exports.describeInputShape = exports.describeInputSchema = exports.detailLevelSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Shared Zod schemas and TypeScript types for Airtable Brain tools.
7
+ * Keep these aligned with the JSON Schemas under docs/prd/schemas.
8
+ */
9
+ /**
10
+ * Detail level for schema operations to optimize LLM context usage.
11
+ * - tableIdentifiersOnly: Only table IDs and names
12
+ * - identifiersOnly: Table, field, and view IDs and names
13
+ * - full: Complete details including field types, options, descriptions
14
+ */
15
+ exports.detailLevelSchema = zod_1.z.enum(['tableIdentifiersOnly', 'identifiersOnly', 'full']);
16
+ const describeInputBase = zod_1.z
17
+ .object({
18
+ scope: zod_1.z.enum(['base', 'table']),
19
+ baseId: zod_1.z.string().min(1, 'baseId is required'),
20
+ table: zod_1.z
21
+ .string()
22
+ .min(1, 'table is required when scope=table')
23
+ .optional(),
24
+ detailLevel: exports.detailLevelSchema.optional().default('full'),
25
+ // Deprecated: use detailLevel instead
26
+ includeFields: zod_1.z.boolean().optional().default(true),
27
+ includeViews: zod_1.z.boolean().optional().default(false)
28
+ })
29
+ .strict();
30
+ exports.describeInputSchema = describeInputBase.superRefine((data, ctx) => {
31
+ if (data.scope === 'table' && !data.table) {
32
+ ctx.addIssue({
33
+ code: zod_1.z.ZodIssueCode.custom,
34
+ path: ['table'],
35
+ message: 'table is required when scope is "table"'
36
+ });
37
+ }
38
+ });
39
+ exports.describeInputShape = describeInputBase.shape;
40
+ const describeFieldSchema = zod_1.z
41
+ .object({
42
+ id: zod_1.z.string(),
43
+ name: zod_1.z.string(),
44
+ type: zod_1.z.string(),
45
+ options: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional()
46
+ })
47
+ .passthrough();
48
+ const describeTableSchema = zod_1.z
49
+ .object({
50
+ id: zod_1.z.string(),
51
+ name: zod_1.z.string(),
52
+ description: zod_1.z.string().optional(),
53
+ primaryFieldId: zod_1.z.string().optional(),
54
+ fields: zod_1.z.array(describeFieldSchema).optional(),
55
+ views: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())).optional()
56
+ })
57
+ .passthrough();
58
+ exports.describeOutputSchema = zod_1.z
59
+ .object({
60
+ base: zod_1.z
61
+ .object({
62
+ id: zod_1.z.string(),
63
+ name: zod_1.z.string()
64
+ })
65
+ .passthrough(),
66
+ tables: zod_1.z.array(describeTableSchema).optional(),
67
+ views: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())).optional()
68
+ })
69
+ .strict();
70
+ const sortDirectionSchema = zod_1.z.enum(['asc', 'desc']);
71
+ const queryInputBase = zod_1.z
72
+ .object({
73
+ baseId: zod_1.z.string().min(1, 'baseId is required'),
74
+ table: zod_1.z.string().min(1, 'table is required'),
75
+ fields: zod_1.z.array(zod_1.z.string().min(1)).optional(),
76
+ filterByFormula: zod_1.z.string().optional(),
77
+ view: zod_1.z.string().optional(),
78
+ sorts: zod_1.z
79
+ .array(zod_1.z
80
+ .object({
81
+ field: zod_1.z.string().min(1),
82
+ direction: sortDirectionSchema.optional().default('asc')
83
+ })
84
+ .strict())
85
+ .optional(),
86
+ pageSize: zod_1.z
87
+ .number()
88
+ .int()
89
+ .min(1)
90
+ .max(100)
91
+ .optional(),
92
+ maxRecords: zod_1.z
93
+ .number()
94
+ .int()
95
+ .min(1)
96
+ .optional(),
97
+ offset: zod_1.z.string().optional(),
98
+ returnFieldsByFieldId: zod_1.z.boolean().optional().default(false)
99
+ })
100
+ .strict();
101
+ exports.queryInputSchema = queryInputBase;
102
+ exports.queryInputShape = queryInputBase.shape;
103
+ const recordSchema = zod_1.z
104
+ .object({
105
+ id: zod_1.z.string(),
106
+ createdTime: zod_1.z.string().optional(),
107
+ fields: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())
108
+ })
109
+ .strict();
110
+ exports.queryOutputSchema = zod_1.z
111
+ .object({
112
+ records: zod_1.z.array(recordSchema),
113
+ offset: zod_1.z.string().optional(),
114
+ summary: zod_1.z
115
+ .object({
116
+ returned: zod_1.z.number().int().nonnegative(),
117
+ hasMore: zod_1.z.boolean()
118
+ })
119
+ .strict()
120
+ .optional()
121
+ })
122
+ .strict();
123
+ exports.createInputSchema = zod_1.z
124
+ .object({
125
+ baseId: zod_1.z.string().min(1),
126
+ table: zod_1.z.string().min(1),
127
+ records: zod_1.z
128
+ .array(zod_1.z
129
+ .object({
130
+ fields: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())
131
+ })
132
+ .strict())
133
+ .min(1),
134
+ typecast: zod_1.z.boolean().optional().default(false),
135
+ idempotencyKey: zod_1.z.string().min(1).optional(),
136
+ dryRun: zod_1.z.boolean().optional().default(false)
137
+ })
138
+ .strict();
139
+ const createDiffSchema = zod_1.z
140
+ .object({
141
+ added: zod_1.z.number().int().nonnegative(),
142
+ updated: zod_1.z.number().int().nonnegative(),
143
+ unchanged: zod_1.z.number().int().nonnegative()
144
+ })
145
+ .strict();
146
+ exports.createOutputSchema = zod_1.z
147
+ .object({
148
+ diff: createDiffSchema,
149
+ records: zod_1.z.array(recordSchema).optional(),
150
+ dryRun: zod_1.z.boolean(),
151
+ warnings: zod_1.z.array(zod_1.z.string()).optional()
152
+ })
153
+ .strict();
154
+ const conflictSchema = zod_1.z
155
+ .object({
156
+ id: zod_1.z.string(),
157
+ field: zod_1.z.string(),
158
+ before: zod_1.z.unknown().optional(),
159
+ after: zod_1.z.unknown().optional(),
160
+ current: zod_1.z.unknown()
161
+ })
162
+ .strict();
163
+ const mutationDiffSchema = zod_1.z
164
+ .object({
165
+ added: zod_1.z.number().int().nonnegative(),
166
+ updated: zod_1.z.number().int().nonnegative(),
167
+ unchanged: zod_1.z.number().int().nonnegative(),
168
+ conflicts: zod_1.z.number().int().nonnegative()
169
+ })
170
+ .strict();
171
+ exports.updateOutputSchema = zod_1.z
172
+ .object({
173
+ diff: mutationDiffSchema,
174
+ records: zod_1.z.array(recordSchema).optional(),
175
+ dryRun: zod_1.z.boolean(),
176
+ conflicts: zod_1.z.array(conflictSchema).optional()
177
+ })
178
+ .strict();
179
+ exports.updateInputSchema = zod_1.z
180
+ .object({
181
+ baseId: zod_1.z.string().min(1),
182
+ table: zod_1.z.string().min(1),
183
+ records: zod_1.z
184
+ .array(zod_1.z
185
+ .object({
186
+ id: zod_1.z.string(),
187
+ fields: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())
188
+ })
189
+ .strict())
190
+ .min(1),
191
+ typecast: zod_1.z.boolean().optional().default(false),
192
+ idempotencyKey: zod_1.z.string().min(1).optional(),
193
+ dryRun: zod_1.z.boolean().optional().default(false),
194
+ conflictStrategy: zod_1.z
195
+ .enum(['fail_on_conflict', 'server_merge', 'client_merge'])
196
+ .optional()
197
+ .default('fail_on_conflict'),
198
+ ifUnchangedHash: zod_1.z.string().optional()
199
+ })
200
+ .strict();
201
+ exports.upsertInputSchema = zod_1.z
202
+ .object({
203
+ baseId: zod_1.z.string().min(1),
204
+ table: zod_1.z.string().min(1),
205
+ records: zod_1.z
206
+ .array(zod_1.z
207
+ .object({
208
+ fields: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())
209
+ })
210
+ .strict())
211
+ .min(1),
212
+ performUpsert: zod_1.z
213
+ .object({
214
+ fieldsToMergeOn: zod_1.z.array(zod_1.z.string().min(1)).min(1)
215
+ })
216
+ .strict(),
217
+ typecast: zod_1.z.boolean().optional().default(false),
218
+ idempotencyKey: zod_1.z.string().min(1).optional(),
219
+ dryRun: zod_1.z.boolean().optional().default(false),
220
+ conflictStrategy: zod_1.z
221
+ .enum(['fail_on_conflict', 'server_merge', 'client_merge'])
222
+ .optional()
223
+ .default('fail_on_conflict')
224
+ })
225
+ .strict();
226
+ exports.upsertOutputSchema = zod_1.z
227
+ .object({
228
+ diff: mutationDiffSchema,
229
+ records: zod_1.z.array(recordSchema).optional(),
230
+ dryRun: zod_1.z.boolean(),
231
+ conflicts: zod_1.z.array(conflictSchema).optional()
232
+ })
233
+ .strict();
234
+ exports.listExceptionsInputSchema = zod_1.z
235
+ .object({
236
+ since: zod_1.z.string().optional(),
237
+ severity: zod_1.z.enum(['info', 'warning', 'error']).optional(),
238
+ limit: zod_1.z.number().int().min(1).max(500).optional().default(100),
239
+ cursor: zod_1.z.string().optional()
240
+ })
241
+ .strict();
242
+ exports.exceptionItemSchema = zod_1.z
243
+ .object({
244
+ id: zod_1.z.string(),
245
+ timestamp: zod_1.z.string(),
246
+ severity: zod_1.z.enum(['info', 'warning', 'error']),
247
+ category: zod_1.z.enum(['rate_limit', 'validation', 'auth', 'conflict', 'schema_drift', 'other']),
248
+ summary: zod_1.z.string(),
249
+ details: zod_1.z.string().optional(),
250
+ proposedFix: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional()
251
+ })
252
+ .strict();
253
+ exports.listExceptionsOutputSchema = zod_1.z
254
+ .object({
255
+ items: zod_1.z.array(exports.exceptionItemSchema),
256
+ cursor: zod_1.z.string().optional()
257
+ })
258
+ .strict();
259
+ const allowedOperations = ['describe', 'query', 'create', 'update', 'upsert'];
260
+ exports.governanceOutputSchema = zod_1.z
261
+ .object({
262
+ allowedBases: zod_1.z.array(zod_1.z.string()),
263
+ allowedTables: zod_1.z
264
+ .array(zod_1.z
265
+ .object({
266
+ baseId: zod_1.z.string(),
267
+ table: zod_1.z.string()
268
+ })
269
+ .strict())
270
+ .optional()
271
+ .default([]),
272
+ allowedOperations: zod_1.z
273
+ .array(zod_1.z.enum(allowedOperations))
274
+ .default([...allowedOperations]),
275
+ piiFields: zod_1.z
276
+ .array(zod_1.z
277
+ .object({
278
+ baseId: zod_1.z.string(),
279
+ table: zod_1.z.string(),
280
+ field: zod_1.z.string(),
281
+ policy: zod_1.z.enum(['mask', 'hash', 'drop'])
282
+ })
283
+ .strict())
284
+ .optional()
285
+ .default([]),
286
+ redactionPolicy: zod_1.z.enum(['mask_all_pii', 'mask_on_inline', 'none']).default('mask_on_inline'),
287
+ loggingPolicy: zod_1.z.enum(['errors_only', 'minimal', 'verbose']).default('minimal'),
288
+ retentionDays: zod_1.z.number().int().min(0).default(7)
289
+ })
290
+ .strict();
291
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/typescript/app/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB;;;GAGG;AAEH;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC;AAG7F,MAAM,iBAAiB,GAAG,OAAC;KACxB,MAAM,CAAC;IACN,KAAK,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CAAC;IAC/C,KAAK,EAAE,OAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,oCAAoC,CAAC;SAC5C,QAAQ,EAAE;IACb,WAAW,EAAE,yBAAiB,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IACzD,sCAAsC;IACtC,aAAa,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACnD,YAAY,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACpD,CAAC;KACD,MAAM,EAAE,CAAC;AAEC,QAAA,mBAAmB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IAC3E,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1C,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,IAAI,EAAE,CAAC,OAAO,CAAC;YACf,OAAO,EAAE,yCAAyC;S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ACN,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;QAClB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;KAClB,CAAC;SACD,MAAM,EAAE,CACZ;SACA,QAAQ,EAAE;SACV,OAAO,CAAC,EAAE,CAAC;IACd,iBAAiB,EAAE,OAAC;SACjB,KAAK,CAAC,OAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SAChC,OAAO,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC;IAClC,SAAS,EAAE,OAAC;SACT,KAAK,CACJ,OAAC;SACE,MAAM,CAAC;QACN,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;QAClB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;QACjB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;QACjB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;KACzC,CAAC;SACD,MAAM,EAAE,CACZ;SACA,QAAQ,EAAE;SACV,OAAO,CAAC,EAAE,CAAC;IACd,eAAe,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAC7F,aAAa,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC/E,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CAClD,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /**
3
+ * API key format validation for Airtable Personal Access Tokens.
4
+ *
5
+ * Provides helpful warnings when token format appears incorrect,
6
+ * without blocking startup (token might still work in edge cases).
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.validateApiKey = validateApiKey;
10
+ exports.getTokenFormatWarnings = getTokenFormatWarnings;
11
+ /**
12
+ * Validates Airtable API key format and returns warnings for common issues.
13
+ *
14
+ * @param apiKey - The API key to validate
15
+ * @returns Validation result with warnings array
16
+ */
17
+ function validateApiKey(apiKey) {
18
+ const warnings = [];
19
+ if (!apiKey || apiKey.trim().length === 0) {
20
+ return {
21
+ isValid: false,
22
+ warnings: ['No API key provided. Set AIRTABLE_PAT environment variable.']
23
+ };
24
+ }
25
+ const trimmedKey = apiKey.trim();
26
+ // Check for whitespace
27
+ if (apiKey !== trimmedKey) {
28
+ warnings.push('API key contains leading or trailing whitespace. This has been trimmed.');
29
+ }
30
+ // Check dot count (PATs have exactly one dot separating prefix from secret)
31
+ const dotCount = (trimmedKey.match(/\./g) || []).length;
32
+ if (dotCount === 0) {
33
+ warnings.push(`Expected one dot (.) in API key, found ${dotCount}. ` +
34
+ 'Ensure you copied the entire token, not just the token ID.');
35
+ }
36
+ else if (dotCount > 1) {
37
+ warnings.push(`Expected one dot (.) in API key, found ${dotCount}. ` +
38
+ 'Ensure you copied the API key correctly.');
39
+ }
40
+ // Check length (typical PAT is around 82 characters)
41
+ if (trimmedKey.length < 70) {
42
+ warnings.push(`API key seems too short (${trimmedKey.length} characters). ` +
43
+ 'Personal Access Tokens are typically around 82 characters.');
44
+ }
45
+ else if (trimmedKey.length > 100) {
46
+ warnings.push(`API key seems too long (${trimmedKey.length} characters). ` +
47
+ 'Personal Access Tokens are typically around 82 characters.');
48
+ }
49
+ // Check for legacy API key format (starts with 'key')
50
+ if (trimmedKey.startsWith('key')) {
51
+ warnings.push('This appears to be an old-style API key (starts with "key"). ' +
52
+ 'Please create a Personal Access Token at https://airtable.com/create/tokens instead.');
53
+ }
54
+ // Check for valid PAT prefix
55
+ if (!trimmedKey.startsWith('pat') && !trimmedKey.startsWith('key')) {
56
+ warnings.push('API key does not start with expected prefix ("pat" for Personal Access Token). ' +
57
+ 'Verify you copied the correct token.');
58
+ }
59
+ return {
60
+ isValid: warnings.length === 0,
61
+ warnings
62
+ };
63
+ }
64
+ /**
65
+ * Get token format warnings for inclusion in error messages.
66
+ * Only returns warnings if issues are detected.
67
+ *
68
+ * @param apiKey - The API key to check
69
+ * @returns Array of warning strings, empty if token format looks valid
70
+ */
71
+ function getTokenFormatWarnings(apiKey) {
72
+ const result = validateApiKey(apiKey);
73
+ return result.warnings;
74
+ }
75
+ //# sourceMappingURL=validateApiKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateApiKey.js","sourceRoot":"","sources":["../../../src/typescript/app/validateApiKey.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAaH,wCAgEC;AASD,wDAGC;AAlFD;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,MAAc;IAC3C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1C,OAAO;YACL,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,CAAC,6DAA6D,CAAC;SAC1E,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAEjC,uBAAuB;IACvB,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;QAC1B,QAAQ,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;IAC3F,CAAC;IAED,4EAA4E;IAC5E,MAAM,QAAQ,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IACxD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CACX,0CAA0C,QAAQ,IAAI;YACtD,4DAA4D,CAC7D,CAAC;IACJ,CAAC;SAAM,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACxB,QAAQ,CAAC,IAAI,CACX,0CAA0C,QAAQ,IAAI;YACtD,0CAA0C,CAC3C,CAAC;IACJ,CAAC;IAED,qDAAqD;IACrD,IAAI,UAAU,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAC3B,QAAQ,CAAC,IAAI,CACX,4BAA4B,UAAU,CAAC,MAAM,gBAAgB;YAC7D,4DAA4D,CAC7D,CAAC;IACJ,CAAC;SAAM,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACnC,QAAQ,CAAC,IAAI,CACX,2BAA2B,UAAU,CAAC,MAAM,gBAAgB;YAC5D,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IAED,sDAAsD;IACtD,IAAI,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,QAAQ,CAAC,IAAI,CACX,+DAA+D;YAC/D,sFAAsF,CACvF,CAAC;IACJ,CAAC;IAED,6BAA6B;IAC7B,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,QAAQ,CAAC,IAAI,CACX,iFAAiF;YACjF,sCAAsC,CACvC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC;QAC9B,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,sBAAsB,CAAC,MAAc;IACnD,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,QAAQ,CAAC;AACzB,CAAC"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /**
3
+ * Error taxonomy aligned with Airtable Brain guardrails.
4
+ *
5
+ * All tool errors should use these types so the LLM can reason about
6
+ * retry behaviour and user messaging. Avoid leaking raw Airtable payloads
7
+ * through error messages.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.GovernanceError = exports.InternalServerError = exports.NotFoundError = exports.ConflictError = exports.AuthError = exports.AirtableValidationError = exports.RateLimitError = exports.AirtableBrainError = void 0;
11
+ class AirtableBrainError extends Error {
12
+ constructor(code, message, options = {}) {
13
+ super(message);
14
+ this.name = code;
15
+ this.code = code;
16
+ if (options.cause !== undefined) {
17
+ this.cause = options.cause;
18
+ }
19
+ if (options.status !== undefined) {
20
+ this.status = options.status;
21
+ }
22
+ if (options.retryAfterMs !== undefined) {
23
+ this.retryAfterMs = options.retryAfterMs;
24
+ }
25
+ this.context = options.context ?? {};
26
+ }
27
+ withContext(context) {
28
+ Object.assign(this.context, context);
29
+ return this;
30
+ }
31
+ }
32
+ exports.AirtableBrainError = AirtableBrainError;
33
+ class RateLimitError extends AirtableBrainError {
34
+ constructor(message, options = {}) {
35
+ super('RateLimited', message, options);
36
+ }
37
+ }
38
+ exports.RateLimitError = RateLimitError;
39
+ class AirtableValidationError extends AirtableBrainError {
40
+ constructor(message, options = {}) {
41
+ super('ValidationError', message, options);
42
+ }
43
+ }
44
+ exports.AirtableValidationError = AirtableValidationError;
45
+ class AuthError extends AirtableBrainError {
46
+ constructor(message, options = {}) {
47
+ super('AuthError', message, options);
48
+ }
49
+ }
50
+ exports.AuthError = AuthError;
51
+ class ConflictError extends AirtableBrainError {
52
+ constructor(message, options = {}) {
53
+ super('ConflictError', message, options);
54
+ }
55
+ }
56
+ exports.ConflictError = ConflictError;
57
+ class NotFoundError extends AirtableBrainError {
58
+ constructor(message, options = {}) {
59
+ super('NotFound', message, options);
60
+ }
61
+ }
62
+ exports.NotFoundError = NotFoundError;
63
+ class InternalServerError extends AirtableBrainError {
64
+ constructor(message, options = {}) {
65
+ super('InternalError', message, options);
66
+ }
67
+ }
68
+ exports.InternalServerError = InternalServerError;
69
+ class GovernanceError extends AirtableBrainError {
70
+ constructor(message, options = {}) {
71
+ super('GovernanceError', message, options);
72
+ }
73
+ }
74
+ exports.GovernanceError = GovernanceError;
75
+ //# sourceMappingURL=errors.js.map
@@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;AAED,MAAa,SAAU,SAAQ,kBAAkB;IAC/C,YAAY,OAAe,EAAE,UAAgC,EAAE;QAC7D,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAJD,8BAIC;AAED,MAAa,aAAc,SAAQ,kBAAkB;IACnD,YAAY,OAAe,EAAE,UAAgC,EAAE;QAC7D,KAAK,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF;AAJD,sCAIC;AAED,MAAa,aAAc,SAAQ,kBAAkB;IACnD,YAAY,OAAe,EAAE,UAAgC,EAAE;QAC7D,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF;AAJD,sCAIC;AAED,MAAa,mBAAoB,SAAQ,kBAAkB;IACzD,YAAY,OAAe,EAAE,UAAgC,EAAE;QAC7D,KAAK,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF;AAJD,kDAIC;AAED,MAAa,eAAgB,SAAQ,kBAAkB;IACrD,YAAY,OAAe,EAAE,UAAgC,EAAE;QAC7D,KAAK,CAAC,iBAAiB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AAJD,0CAIC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * Airtable MCP Server - Main Export
4
+ *
5
+ * This module exports the main server functionality for programmatic use.
6
+ * For CLI usage, use the bin/airtable-mcp.js executable.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.start = void 0;
24
+ var airtable_mcp_server_1 = require("./airtable-mcp-server");
25
+ Object.defineProperty(exports, "start", { enumerable: true, get: function () { return airtable_mcp_server_1.start; } });
26
+ __exportStar(require("./errors"), exports);
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typescript/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,6DAA8C;AAArC,4GAAA,KAAK,OAAA;AACd,2CAAyB"}