@berthojoris/mcp-mysql-server 1.2.5 → 1.4.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/LICENSE +21 -21
- package/README.md +290 -81
- package/dist/auth/authService.d.ts +29 -0
- package/dist/auth/authService.js +114 -0
- package/dist/config/featureConfig.d.ts +5 -0
- package/dist/config/featureConfig.js +59 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +18 -1
- package/dist/mcp-server.js +95 -1
- package/dist/tools/dataExportTools.d.ts +33 -0
- package/dist/tools/dataExportTools.js +240 -0
- package/dist/tools/databaseTools.js +14 -14
- package/dist/tools/utilityTools.js +25 -25
- package/dist/validation/schemas.d.ts +87 -0
- package/dist/validation/schemas.js +62 -2
- package/manifest.json +247 -247
- package/package.json +2 -2
|
@@ -512,6 +512,87 @@ export declare const showCreateProcedureSchema: {
|
|
|
512
512
|
};
|
|
513
513
|
additionalProperties: boolean;
|
|
514
514
|
};
|
|
515
|
+
export declare const exportTableToCsvSchema: {
|
|
516
|
+
type: string;
|
|
517
|
+
required: string[];
|
|
518
|
+
properties: {
|
|
519
|
+
table_name: {
|
|
520
|
+
type: string;
|
|
521
|
+
};
|
|
522
|
+
filters: {
|
|
523
|
+
type: string;
|
|
524
|
+
items: {
|
|
525
|
+
type: string;
|
|
526
|
+
required: string[];
|
|
527
|
+
properties: {
|
|
528
|
+
field: {
|
|
529
|
+
type: string;
|
|
530
|
+
};
|
|
531
|
+
operator: {
|
|
532
|
+
type: string;
|
|
533
|
+
enum: string[];
|
|
534
|
+
};
|
|
535
|
+
value: {};
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
nullable: boolean;
|
|
539
|
+
};
|
|
540
|
+
pagination: {
|
|
541
|
+
type: string;
|
|
542
|
+
properties: {
|
|
543
|
+
page: {
|
|
544
|
+
type: string;
|
|
545
|
+
minimum: number;
|
|
546
|
+
};
|
|
547
|
+
limit: {
|
|
548
|
+
type: string;
|
|
549
|
+
minimum: number;
|
|
550
|
+
maximum: number;
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
required: string[];
|
|
554
|
+
nullable: boolean;
|
|
555
|
+
};
|
|
556
|
+
sorting: {
|
|
557
|
+
type: string;
|
|
558
|
+
properties: {
|
|
559
|
+
field: {
|
|
560
|
+
type: string;
|
|
561
|
+
};
|
|
562
|
+
direction: {
|
|
563
|
+
type: string;
|
|
564
|
+
enum: string[];
|
|
565
|
+
};
|
|
566
|
+
};
|
|
567
|
+
required: string[];
|
|
568
|
+
nullable: boolean;
|
|
569
|
+
};
|
|
570
|
+
include_headers: {
|
|
571
|
+
type: string;
|
|
572
|
+
nullable: boolean;
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
additionalProperties: boolean;
|
|
576
|
+
};
|
|
577
|
+
export declare const exportQueryToCsvSchema: {
|
|
578
|
+
type: string;
|
|
579
|
+
required: string[];
|
|
580
|
+
properties: {
|
|
581
|
+
query: {
|
|
582
|
+
type: string;
|
|
583
|
+
};
|
|
584
|
+
params: {
|
|
585
|
+
type: string;
|
|
586
|
+
items: {};
|
|
587
|
+
nullable: boolean;
|
|
588
|
+
};
|
|
589
|
+
include_headers: {
|
|
590
|
+
type: string;
|
|
591
|
+
nullable: boolean;
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
additionalProperties: boolean;
|
|
595
|
+
};
|
|
515
596
|
export declare const validateListTables: import("ajv").ValidateFunction<{
|
|
516
597
|
database: unknown;
|
|
517
598
|
} & {}>;
|
|
@@ -596,3 +677,9 @@ export declare const validateStoredProcedureCreation: import("ajv").ValidateFunc
|
|
|
596
677
|
export declare const validateGetTableRelationships: import("ajv").ValidateFunction<{
|
|
597
678
|
[x: string]: {};
|
|
598
679
|
}>;
|
|
680
|
+
export declare const validateExportTableToCsv: import("ajv").ValidateFunction<{
|
|
681
|
+
[x: string]: {};
|
|
682
|
+
}>;
|
|
683
|
+
export declare const validateExportQueryToCsv: import("ajv").ValidateFunction<{
|
|
684
|
+
[x: string]: {};
|
|
685
|
+
}>;
|
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.validateGetTableRelationships = exports.validateStoredProcedureCreation = void 0;
|
|
6
|
+
exports.validateDropStoredProcedure = exports.validateCreateStoredProcedure = exports.validateExecuteStoredProcedure = exports.validateGetStoredProcedureInfo = exports.validateListStoredProcedures = exports.validateExecuteInTransaction = exports.validateRollbackTransaction = exports.validateCommitTransaction = exports.validateBeginTransaction = exports.validateExecuteDdl = exports.validateDropTable = exports.validateAlterTable = exports.validateCreateTable = exports.validateExecuteSql = exports.validateRunQuery = exports.validateBulkDelete = exports.validateBulkUpdate = exports.validateBulkInsert = exports.validateDeleteRecord = exports.validateUpdateRecord = exports.validateReadRecords = exports.validateCreateRecord = exports.validateReadTableSchema = exports.validateListTables = exports.exportQueryToCsvSchema = exports.exportTableToCsvSchema = exports.showCreateProcedureSchema = exports.dropStoredProcedureSchema = exports.createStoredProcedureSchema = exports.executeStoredProcedureSchema = exports.getStoredProcedureInfoSchema = exports.listStoredProceduresSchema = exports.executeInTransactionSchema = exports.getTransactionStatusSchema = exports.rollbackTransactionSchema = exports.commitTransactionSchema = exports.beginTransactionSchema = exports.getTableRelationshipsSchema = exports.executeDdlSchema = exports.dropTableSchema = exports.alterTableSchema = exports.createTableSchema = exports.executeSqlSchema = exports.runQuerySchema = exports.deleteRecordSchema = exports.updateRecordSchema = exports.readRecordsSchema = exports.createRecordSchema = exports.readTableSchemaSchema = exports.listTablesSchema = void 0;
|
|
7
|
+
exports.validateExportQueryToCsv = exports.validateExportTableToCsv = exports.validateGetTableRelationships = exports.validateStoredProcedureCreation = exports.validateStoredProcedureExecution = exports.validateShowCreateProcedure = void 0;
|
|
8
8
|
const ajv_1 = __importDefault(require("ajv"));
|
|
9
9
|
const ajv = new ajv_1.default();
|
|
10
10
|
// Schema definitions
|
|
@@ -442,6 +442,64 @@ const bulkDeleteSchema = {
|
|
|
442
442
|
required: ['table_name', 'condition_sets'],
|
|
443
443
|
additionalProperties: false
|
|
444
444
|
};
|
|
445
|
+
// Data Export schemas
|
|
446
|
+
exports.exportTableToCsvSchema = {
|
|
447
|
+
type: 'object',
|
|
448
|
+
required: ['table_name'],
|
|
449
|
+
properties: {
|
|
450
|
+
table_name: { type: 'string' },
|
|
451
|
+
filters: {
|
|
452
|
+
type: 'array',
|
|
453
|
+
items: {
|
|
454
|
+
type: 'object',
|
|
455
|
+
required: ['field', 'operator', 'value'],
|
|
456
|
+
properties: {
|
|
457
|
+
field: { type: 'string' },
|
|
458
|
+
operator: {
|
|
459
|
+
type: 'string',
|
|
460
|
+
enum: ['eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'like', 'in']
|
|
461
|
+
},
|
|
462
|
+
value: {}
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
nullable: true
|
|
466
|
+
},
|
|
467
|
+
pagination: {
|
|
468
|
+
type: 'object',
|
|
469
|
+
properties: {
|
|
470
|
+
page: { type: 'integer', minimum: 1 },
|
|
471
|
+
limit: { type: 'integer', minimum: 1, maximum: 10000 }
|
|
472
|
+
},
|
|
473
|
+
required: ['page', 'limit'],
|
|
474
|
+
nullable: true
|
|
475
|
+
},
|
|
476
|
+
sorting: {
|
|
477
|
+
type: 'object',
|
|
478
|
+
properties: {
|
|
479
|
+
field: { type: 'string' },
|
|
480
|
+
direction: { type: 'string', enum: ['asc', 'desc'] }
|
|
481
|
+
},
|
|
482
|
+
required: ['field', 'direction'],
|
|
483
|
+
nullable: true
|
|
484
|
+
},
|
|
485
|
+
include_headers: { type: 'boolean', nullable: true }
|
|
486
|
+
},
|
|
487
|
+
additionalProperties: false
|
|
488
|
+
};
|
|
489
|
+
exports.exportQueryToCsvSchema = {
|
|
490
|
+
type: 'object',
|
|
491
|
+
required: ['query'],
|
|
492
|
+
properties: {
|
|
493
|
+
query: { type: 'string' },
|
|
494
|
+
params: {
|
|
495
|
+
type: 'array',
|
|
496
|
+
items: {},
|
|
497
|
+
nullable: true
|
|
498
|
+
},
|
|
499
|
+
include_headers: { type: 'boolean', nullable: true }
|
|
500
|
+
},
|
|
501
|
+
additionalProperties: false
|
|
502
|
+
};
|
|
445
503
|
// Compile validators
|
|
446
504
|
exports.validateListTables = ajv.compile(exports.listTablesSchema);
|
|
447
505
|
exports.validateReadTableSchema = ajv.compile(exports.readTableSchemaSchema);
|
|
@@ -471,3 +529,5 @@ exports.validateShowCreateProcedure = ajv.compile(exports.showCreateProcedureSch
|
|
|
471
529
|
exports.validateStoredProcedureExecution = ajv.compile(exports.executeStoredProcedureSchema);
|
|
472
530
|
exports.validateStoredProcedureCreation = ajv.compile(exports.createStoredProcedureSchema);
|
|
473
531
|
exports.validateGetTableRelationships = ajv.compile(exports.getTableRelationshipsSchema);
|
|
532
|
+
exports.validateExportTableToCsv = ajv.compile(exports.exportTableToCsvSchema);
|
|
533
|
+
exports.validateExportQueryToCsv = ajv.compile(exports.exportQueryToCsvSchema);
|