@rashidazarang/airtable-mcp 3.0.0 → 3.2.5

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 (89) hide show
  1. package/README.md +210 -43
  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 +325 -0
  6. package/dist/typescript/app/airtable-client.js.map +1 -0
  7. package/dist/typescript/app/config.js +141 -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/tools/create.js +54 -0
  20. package/dist/typescript/app/tools/create.js.map +1 -0
  21. package/dist/typescript/app/tools/describe.js +146 -0
  22. package/dist/typescript/app/tools/describe.js.map +1 -0
  23. package/dist/typescript/app/tools/handleError.js +54 -0
  24. package/dist/typescript/app/tools/handleError.js.map +1 -0
  25. package/dist/typescript/app/tools/index.js +24 -0
  26. package/dist/typescript/app/tools/index.js.map +1 -0
  27. package/dist/typescript/app/tools/listBases.js +52 -0
  28. package/dist/typescript/app/tools/listBases.js.map +1 -0
  29. package/dist/typescript/app/tools/listExceptions.js +18 -0
  30. package/dist/typescript/app/tools/listExceptions.js.map +1 -0
  31. package/dist/typescript/app/tools/listGovernance.js +17 -0
  32. package/dist/typescript/app/tools/listGovernance.js.map +1 -0
  33. package/dist/typescript/app/tools/query.js +126 -0
  34. package/dist/typescript/app/tools/query.js.map +1 -0
  35. package/dist/typescript/app/tools/update.js +56 -0
  36. package/dist/typescript/app/tools/update.js.map +1 -0
  37. package/dist/typescript/app/tools/upsert.js +65 -0
  38. package/dist/typescript/app/tools/upsert.js.map +1 -0
  39. package/dist/typescript/app/tools/webhooks.js +44 -0
  40. package/dist/typescript/app/tools/webhooks.js.map +1 -0
  41. package/dist/typescript/app/types.js +282 -0
  42. package/dist/typescript/app/types.js.map +1 -0
  43. package/dist/typescript/apps-sdk/mappers.js +70 -0
  44. package/dist/typescript/apps-sdk/mappers.js.map +1 -0
  45. package/dist/typescript/errors.js +75 -0
  46. package/dist/typescript/errors.js.map +1 -0
  47. package/dist/typescript/index.js +27 -0
  48. package/dist/typescript/index.js.map +1 -0
  49. package/package.json +63 -17
  50. package/tsconfig.json +44 -0
  51. package/types/typescript/airtable-mcp-server.d.ts +2 -0
  52. package/types/typescript/app/airtable-client.d.ts +49 -0
  53. package/types/typescript/app/config.d.ts +16 -0
  54. package/types/typescript/app/context.d.ts +12 -0
  55. package/types/typescript/app/exceptions.d.ts +12 -0
  56. package/types/typescript/app/governance.d.ts +18 -0
  57. package/types/typescript/app/logger.d.ts +13 -0
  58. package/types/typescript/app/rateLimiter.d.ts +13 -0
  59. package/types/typescript/app/tools/create.d.ts +3 -0
  60. package/types/typescript/app/tools/describe.d.ts +3 -0
  61. package/types/typescript/app/tools/handleError.d.ts +8 -0
  62. package/types/typescript/app/tools/index.d.ts +3 -0
  63. package/types/typescript/app/tools/listBases.d.ts +33 -0
  64. package/types/typescript/app/tools/listExceptions.d.ts +3 -0
  65. package/types/typescript/app/tools/listGovernance.d.ts +3 -0
  66. package/types/typescript/app/tools/query.d.ts +3 -0
  67. package/types/typescript/app/tools/update.d.ts +3 -0
  68. package/types/typescript/app/tools/upsert.d.ts +3 -0
  69. package/types/typescript/app/tools/webhooks.d.ts +3 -0
  70. package/types/typescript/app/types.d.ts +830 -0
  71. package/types/typescript/apps-sdk/mappers.d.ts +53 -0
  72. package/types/typescript/errors.d.ts +55 -0
  73. package/types/typescript/index.d.ts +10 -0
  74. package/types/typescript/prompt-templates.d.ts +5 -0
  75. package/types/typescript/test-suite.d.ts +33 -0
  76. package/types/typescript/tools-schemas.d.ts +5 -0
  77. package/airtable_simple.js +0 -1561
  78. package/airtable_simple_production.js +0 -1564
  79. package/examples/airtable-crud-example.js +0 -203
  80. package/examples/building-mcp.md +0 -6666
  81. package/examples/claude_config.json +0 -4
  82. package/examples/claude_simple_config.json +0 -7
  83. package/examples/env-demo.js +0 -172
  84. package/examples/example-tasks-update.json +0 -23
  85. package/examples/example-tasks.json +0 -26
  86. package/examples/example_usage.md +0 -124
  87. package/examples/python_debug_patch.txt +0 -27
  88. package/examples/sample-transform.js +0 -76
  89. package/examples/windsurf_mcp_config.json +0 -17
@@ -0,0 +1,53 @@
1
+ import type { QueryOutput, CreateOutput, UpdateOutput } from '../app/types';
2
+ export declare function toInlineResultCard(table: string, result: QueryOutput): {
3
+ title: string;
4
+ subtitle: string | undefined;
5
+ columns: {
6
+ key: string;
7
+ label: string;
8
+ }[];
9
+ rows: {
10
+ id: string;
11
+ }[];
12
+ pagination: {
13
+ hasMore: boolean;
14
+ nextOffset: string | undefined;
15
+ };
16
+ actions: string[];
17
+ state: string;
18
+ };
19
+ export declare function toFullscreenGrid(_table: string, result: QueryOutput, selection?: string[]): {
20
+ columns: {
21
+ key: string;
22
+ label: string;
23
+ }[];
24
+ rows: {
25
+ id: string;
26
+ }[];
27
+ filters: {};
28
+ sorts: never[];
29
+ selection: string[];
30
+ toolbarActions: string[];
31
+ state: string;
32
+ };
33
+ type DiffChange = {
34
+ recordId: string;
35
+ field: string;
36
+ before?: unknown;
37
+ after?: unknown;
38
+ status: 'add' | 'update' | 'unchanged' | 'conflict';
39
+ warning?: string;
40
+ };
41
+ export declare function buildDiffModalForCreate(output: CreateOutput, idempotencyKey?: string): {
42
+ changes: DiffChange[];
43
+ idempotencyKey: string | undefined;
44
+ confirmAction: "create";
45
+ cancelAction: "close";
46
+ };
47
+ export declare function buildDiffModalForUpdate(output: UpdateOutput, idempotencyKey?: string): {
48
+ changes: DiffChange[];
49
+ idempotencyKey: string | undefined;
50
+ confirmAction: "update";
51
+ cancelAction: "close";
52
+ };
53
+ export {};
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Error taxonomy aligned with Airtable Brain guardrails.
3
+ *
4
+ * All tool errors should use these types so the LLM can reason about
5
+ * retry behaviour and user messaging. Avoid leaking raw Airtable payloads
6
+ * through error messages.
7
+ */
8
+ export type AirtableErrorCode = 'RateLimited' | 'ValidationError' | 'AuthError' | 'ConflictError' | 'NotFound' | 'InternalError' | 'GovernanceError';
9
+ export interface ErrorContext {
10
+ baseId?: string;
11
+ table?: string;
12
+ retryAfterMs?: number;
13
+ attempt?: number;
14
+ totalAttempts?: number;
15
+ upstreamErrorType?: string;
16
+ upstreamRequestId?: string;
17
+ governanceRule?: string;
18
+ endpoint?: string;
19
+ }
20
+ interface AirtableErrorOptions {
21
+ status?: number;
22
+ retryAfterMs?: number;
23
+ context?: ErrorContext;
24
+ cause?: unknown;
25
+ }
26
+ export declare class AirtableBrainError extends Error {
27
+ readonly code: AirtableErrorCode;
28
+ readonly status?: number;
29
+ readonly retryAfterMs?: number;
30
+ readonly context: ErrorContext;
31
+ constructor(code: AirtableErrorCode, message: string, options?: AirtableErrorOptions);
32
+ withContext(context: Partial<ErrorContext>): this;
33
+ }
34
+ export declare class RateLimitError extends AirtableBrainError {
35
+ constructor(message: string, options?: AirtableErrorOptions);
36
+ }
37
+ export declare class AirtableValidationError extends AirtableBrainError {
38
+ constructor(message: string, options?: AirtableErrorOptions);
39
+ }
40
+ export declare class AuthError extends AirtableBrainError {
41
+ constructor(message: string, options?: AirtableErrorOptions);
42
+ }
43
+ export declare class ConflictError extends AirtableBrainError {
44
+ constructor(message: string, options?: AirtableErrorOptions);
45
+ }
46
+ export declare class NotFoundError extends AirtableBrainError {
47
+ constructor(message: string, options?: AirtableErrorOptions);
48
+ }
49
+ export declare class InternalServerError extends AirtableBrainError {
50
+ constructor(message: string, options?: AirtableErrorOptions);
51
+ }
52
+ export declare class GovernanceError extends AirtableBrainError {
53
+ constructor(message: string, options?: AirtableErrorOptions);
54
+ }
55
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Airtable MCP Server - Main Export
3
+ *
4
+ * This module exports the main server functionality for programmatic use.
5
+ * For CLI usage, use the bin/airtable-mcp.js executable.
6
+ */
7
+ export { start } from './airtable-mcp-server';
8
+ export * from './errors';
9
+ export type { AppConfig, AirtableAuthConfig, LogLevel } from './app/config';
10
+ export type { AppContext } from './app/context';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Runtime AI prompt templates for Airtable MCP Server
3
+ */
4
+ import type { PromptSchema } from './index';
5
+ export declare const AI_PROMPT_TEMPLATES: Record<string, PromptSchema>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * TypeScript Test Suite for Airtable MCP Server
3
+ * Comprehensive type-safe testing with enterprise validation
4
+ */
5
+ interface TestResult {
6
+ name: string;
7
+ passed: boolean;
8
+ error?: string;
9
+ duration: number;
10
+ }
11
+ interface TestSuite {
12
+ name: string;
13
+ tests: TestResult[];
14
+ totalPassed: number;
15
+ totalFailed: number;
16
+ totalDuration: number;
17
+ }
18
+ declare class TypeScriptTestRunner {
19
+ private results;
20
+ runTest(name: string, testFn: () => Promise<void>): Promise<TestResult>;
21
+ runSuite(suiteName: string, tests: Array<{
22
+ name: string;
23
+ fn: () => Promise<void>;
24
+ }>): Promise<TestSuite>;
25
+ generateReport(): void;
26
+ }
27
+ declare class MockAirtableMCPServer {
28
+ initialize(): Promise<any>;
29
+ handleToolCall(name: string, params: Record<string, unknown>): Promise<any>;
30
+ handlePromptGet(_name: string, _args: Record<string, unknown>): Promise<any>;
31
+ }
32
+ declare function runAllTests(): Promise<void>;
33
+ export { TypeScriptTestRunner, MockAirtableMCPServer, runAllTests, TestResult, TestSuite };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Runtime tool schemas for Airtable MCP Server
3
+ */
4
+ import type { ToolSchema } from './index';
5
+ export declare const COMPLETE_TOOL_SCHEMAS: ToolSchema[];