@berthojoris/mcp-mysql-server 1.5.0 β 1.6.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/DOCUMENTATIONS.md +477 -17
- package/README.md +102 -5
- package/dist/index.d.ts +401 -0
- package/dist/index.js +311 -0
- package/dist/mcp-server.js +1067 -0
- package/dist/tools/constraintTools.d.ts +108 -0
- package/dist/tools/constraintTools.js +405 -0
- package/dist/tools/functionTools.d.ts +93 -0
- package/dist/tools/functionTools.js +351 -0
- package/dist/tools/indexTools.d.ts +81 -0
- package/dist/tools/indexTools.js +345 -0
- package/dist/tools/maintenanceTools.d.ts +111 -0
- package/dist/tools/maintenanceTools.js +371 -0
- package/dist/tools/processTools.d.ts +106 -0
- package/dist/tools/processTools.js +305 -0
- package/dist/tools/triggerTools.d.ts +76 -0
- package/dist/tools/triggerTools.js +294 -0
- package/dist/tools/viewTools.d.ts +91 -0
- package/dist/tools/viewTools.js +330 -0
- package/package.json +1 -1
package/DOCUMENTATIONS.md
CHANGED
|
@@ -10,15 +10,22 @@ This file contains detailed documentation for all features of the MySQL MCP Serv
|
|
|
10
10
|
2. [Data Export Tools](#π€-data-export-tools)
|
|
11
11
|
3. [Transaction Management](#π°-transaction-management)
|
|
12
12
|
4. [Stored Procedures](#π§-stored-procedures)
|
|
13
|
-
5. [
|
|
14
|
-
6. [
|
|
15
|
-
7. [
|
|
16
|
-
8. [
|
|
17
|
-
9. [
|
|
18
|
-
10. [
|
|
19
|
-
11. [
|
|
20
|
-
12. [
|
|
21
|
-
13. [
|
|
13
|
+
5. [Views Management](#ποΈ-views-management) - NEW!
|
|
14
|
+
6. [Triggers Management](#β‘-triggers-management) - NEW!
|
|
15
|
+
7. [Functions Management](#π’-functions-management) - NEW!
|
|
16
|
+
8. [Index Management](#π-index-management) - NEW!
|
|
17
|
+
9. [Constraint Management](#π-constraint-management) - NEW!
|
|
18
|
+
10. [Table Maintenance](#π§-table-maintenance) - NEW!
|
|
19
|
+
11. [Process & Server Management](#π-process--server-management) - NEW!
|
|
20
|
+
12. [Usage Examples](#π-usage-examples)
|
|
21
|
+
13. [Query Logging & Automatic SQL Display](#π-query-logging--automatic-sql-display)
|
|
22
|
+
14. [Security Features](#π-security-features)
|
|
23
|
+
15. [Query Result Caching](#πΎ-query-result-caching)
|
|
24
|
+
16. [Query Optimization Hints](#π―-query-optimization-hints)
|
|
25
|
+
17. [Bulk Operations](#π-bulk-operations)
|
|
26
|
+
18. [Troubleshooting](#π οΈ-troubleshooting)
|
|
27
|
+
19. [License](#π-license)
|
|
28
|
+
20. [Roadmap](#πΊοΈ-roadmap)
|
|
22
29
|
|
|
23
30
|
---
|
|
24
31
|
|
|
@@ -526,6 +533,442 @@ END IF;
|
|
|
526
533
|
|
|
527
534
|
---
|
|
528
535
|
|
|
536
|
+
## ποΈ Views Management
|
|
537
|
+
|
|
538
|
+
Views allow you to create virtual tables based on SQL SELECT statements. The MySQL MCP Server provides comprehensive view management tools.
|
|
539
|
+
|
|
540
|
+
### View Tools Overview
|
|
541
|
+
|
|
542
|
+
- **`list_views`** - List all views in the database
|
|
543
|
+
- **`get_view_info`** - Get detailed information about a view including columns
|
|
544
|
+
- **`create_view`** - Create a new view with SELECT definition
|
|
545
|
+
- **`alter_view`** - Alter an existing view definition
|
|
546
|
+
- **`drop_view`** - Drop a view
|
|
547
|
+
- **`show_create_view`** - Show the CREATE statement for a view
|
|
548
|
+
|
|
549
|
+
### Creating Views
|
|
550
|
+
|
|
551
|
+
**User:** *"Create a view that shows active users with their order count"*
|
|
552
|
+
|
|
553
|
+
**AI will execute:**
|
|
554
|
+
```json
|
|
555
|
+
{
|
|
556
|
+
"tool": "create_view",
|
|
557
|
+
"arguments": {
|
|
558
|
+
"view_name": "active_users_orders",
|
|
559
|
+
"definition": "SELECT u.id, u.name, u.email, COUNT(o.id) as order_count FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE u.status = 'active' GROUP BY u.id",
|
|
560
|
+
"or_replace": true
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### View Options
|
|
566
|
+
|
|
567
|
+
| Option | Description |
|
|
568
|
+
|--------|-------------|
|
|
569
|
+
| `or_replace` | If true, replaces existing view with same name |
|
|
570
|
+
| `algorithm` | UNDEFINED, MERGE, or TEMPTABLE |
|
|
571
|
+
| `security` | DEFINER or INVOKER |
|
|
572
|
+
| `check_option` | CASCADED or LOCAL for updatable views |
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
## β‘ Triggers Management
|
|
577
|
+
|
|
578
|
+
Triggers are database callbacks that automatically execute when specific events occur on a table.
|
|
579
|
+
|
|
580
|
+
### Trigger Tools Overview
|
|
581
|
+
|
|
582
|
+
- **`list_triggers`** - List all triggers, optionally filtered by table
|
|
583
|
+
- **`get_trigger_info`** - Get detailed information about a trigger
|
|
584
|
+
- **`create_trigger`** - Create a new trigger
|
|
585
|
+
- **`drop_trigger`** - Drop a trigger
|
|
586
|
+
- **`show_create_trigger`** - Show the CREATE statement for a trigger
|
|
587
|
+
|
|
588
|
+
### Creating Triggers
|
|
589
|
+
|
|
590
|
+
**User:** *"Create a trigger that logs all updates to the users table"*
|
|
591
|
+
|
|
592
|
+
**AI will execute:**
|
|
593
|
+
```json
|
|
594
|
+
{
|
|
595
|
+
"tool": "create_trigger",
|
|
596
|
+
"arguments": {
|
|
597
|
+
"trigger_name": "users_update_log",
|
|
598
|
+
"table_name": "users",
|
|
599
|
+
"timing": "AFTER",
|
|
600
|
+
"event": "UPDATE",
|
|
601
|
+
"body": "INSERT INTO audit_log (table_name, action, record_id, changed_at) VALUES ('users', 'UPDATE', NEW.id, NOW());"
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
### Trigger Timing and Events
|
|
607
|
+
|
|
608
|
+
| Timing | Events | Description |
|
|
609
|
+
|--------|--------|-------------|
|
|
610
|
+
| BEFORE | INSERT, UPDATE, DELETE | Execute before the operation |
|
|
611
|
+
| AFTER | INSERT, UPDATE, DELETE | Execute after the operation |
|
|
612
|
+
|
|
613
|
+
---
|
|
614
|
+
|
|
615
|
+
## π’ Functions Management
|
|
616
|
+
|
|
617
|
+
User-defined functions (UDFs) allow you to create reusable SQL functions that can be called in queries.
|
|
618
|
+
|
|
619
|
+
### Function Tools Overview
|
|
620
|
+
|
|
621
|
+
- **`list_functions`** - List all user-defined functions
|
|
622
|
+
- **`get_function_info`** - Get detailed information about a function
|
|
623
|
+
- **`create_function`** - Create a new function
|
|
624
|
+
- **`drop_function`** - Drop a function
|
|
625
|
+
- **`show_create_function`** - Show the CREATE statement
|
|
626
|
+
- **`execute_function`** - Execute a function and return its result
|
|
627
|
+
|
|
628
|
+
### Creating Functions
|
|
629
|
+
|
|
630
|
+
**User:** *"Create a function that calculates the discount price"*
|
|
631
|
+
|
|
632
|
+
**AI will execute:**
|
|
633
|
+
```json
|
|
634
|
+
{
|
|
635
|
+
"tool": "create_function",
|
|
636
|
+
"arguments": {
|
|
637
|
+
"function_name": "calculate_discount",
|
|
638
|
+
"parameters": [
|
|
639
|
+
{"name": "price", "data_type": "DECIMAL(10,2)"},
|
|
640
|
+
{"name": "discount_percent", "data_type": "INT"}
|
|
641
|
+
],
|
|
642
|
+
"returns": "DECIMAL(10,2)",
|
|
643
|
+
"body": "RETURN price - (price * discount_percent / 100);",
|
|
644
|
+
"deterministic": true,
|
|
645
|
+
"comment": "Calculate discounted price"
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
### Executing Functions
|
|
651
|
+
|
|
652
|
+
```json
|
|
653
|
+
{
|
|
654
|
+
"tool": "execute_function",
|
|
655
|
+
"arguments": {
|
|
656
|
+
"function_name": "calculate_discount",
|
|
657
|
+
"parameters": [100.00, 15]
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
**Returns:** `{"result": 85.00}`
|
|
663
|
+
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
## π Index Management
|
|
667
|
+
|
|
668
|
+
Indexes improve query performance by allowing MySQL to find rows faster.
|
|
669
|
+
|
|
670
|
+
### Index Tools Overview
|
|
671
|
+
|
|
672
|
+
- **`list_indexes`** - List all indexes for a table
|
|
673
|
+
- **`get_index_info`** - Get detailed information about an index
|
|
674
|
+
- **`create_index`** - Create a new index
|
|
675
|
+
- **`drop_index`** - Drop an index
|
|
676
|
+
- **`analyze_index`** - Update index statistics
|
|
677
|
+
|
|
678
|
+
### Creating Indexes
|
|
679
|
+
|
|
680
|
+
**User:** *"Create an index on the email column of the users table"*
|
|
681
|
+
|
|
682
|
+
**AI will execute:**
|
|
683
|
+
```json
|
|
684
|
+
{
|
|
685
|
+
"tool": "create_index",
|
|
686
|
+
"arguments": {
|
|
687
|
+
"table_name": "users",
|
|
688
|
+
"index_name": "idx_users_email",
|
|
689
|
+
"columns": ["email"],
|
|
690
|
+
"unique": true
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
### Index Types
|
|
696
|
+
|
|
697
|
+
| Type | Description | Use Case |
|
|
698
|
+
|------|-------------|----------|
|
|
699
|
+
| BTREE | Default B-tree index | General purpose, range queries |
|
|
700
|
+
| HASH | Hash index | Equality comparisons only |
|
|
701
|
+
| FULLTEXT | Full-text search index | Text search in CHAR, VARCHAR, TEXT columns |
|
|
702
|
+
| SPATIAL | Spatial index | Geographic data (GEOMETRY types) |
|
|
703
|
+
|
|
704
|
+
### Composite Indexes
|
|
705
|
+
|
|
706
|
+
```json
|
|
707
|
+
{
|
|
708
|
+
"tool": "create_index",
|
|
709
|
+
"arguments": {
|
|
710
|
+
"table_name": "orders",
|
|
711
|
+
"index_name": "idx_orders_user_date",
|
|
712
|
+
"columns": [
|
|
713
|
+
{"column": "user_id"},
|
|
714
|
+
{"column": "created_at", "order": "DESC"}
|
|
715
|
+
]
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
---
|
|
721
|
+
|
|
722
|
+
## π Constraint Management
|
|
723
|
+
|
|
724
|
+
Constraints enforce data integrity rules on tables.
|
|
725
|
+
|
|
726
|
+
### Constraint Tools Overview
|
|
727
|
+
|
|
728
|
+
- **`list_foreign_keys`** - List all foreign keys for a table
|
|
729
|
+
- **`list_constraints`** - List all constraints (PK, FK, UNIQUE, CHECK)
|
|
730
|
+
- **`add_foreign_key`** - Add a foreign key constraint
|
|
731
|
+
- **`drop_foreign_key`** - Drop a foreign key constraint
|
|
732
|
+
- **`add_unique_constraint`** - Add a unique constraint
|
|
733
|
+
- **`drop_constraint`** - Drop a UNIQUE or CHECK constraint
|
|
734
|
+
- **`add_check_constraint`** - Add a CHECK constraint (MySQL 8.0.16+)
|
|
735
|
+
|
|
736
|
+
### Adding Foreign Keys
|
|
737
|
+
|
|
738
|
+
**User:** *"Add a foreign key from orders.user_id to users.id"*
|
|
739
|
+
|
|
740
|
+
**AI will execute:**
|
|
741
|
+
```json
|
|
742
|
+
{
|
|
743
|
+
"tool": "add_foreign_key",
|
|
744
|
+
"arguments": {
|
|
745
|
+
"table_name": "orders",
|
|
746
|
+
"constraint_name": "fk_orders_user",
|
|
747
|
+
"columns": ["user_id"],
|
|
748
|
+
"referenced_table": "users",
|
|
749
|
+
"referenced_columns": ["id"],
|
|
750
|
+
"on_delete": "CASCADE",
|
|
751
|
+
"on_update": "CASCADE"
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
### Referential Actions
|
|
757
|
+
|
|
758
|
+
| Action | Description |
|
|
759
|
+
|--------|-------------|
|
|
760
|
+
| CASCADE | Delete/update child rows when parent changes |
|
|
761
|
+
| SET NULL | Set child foreign key to NULL |
|
|
762
|
+
| RESTRICT | Prevent parent delete/update if children exist |
|
|
763
|
+
| NO ACTION | Same as RESTRICT |
|
|
764
|
+
| SET DEFAULT | Set to default value (not widely supported) |
|
|
765
|
+
|
|
766
|
+
### Adding CHECK Constraints (MySQL 8.0.16+)
|
|
767
|
+
|
|
768
|
+
```json
|
|
769
|
+
{
|
|
770
|
+
"tool": "add_check_constraint",
|
|
771
|
+
"arguments": {
|
|
772
|
+
"table_name": "products",
|
|
773
|
+
"constraint_name": "chk_positive_price",
|
|
774
|
+
"expression": "price > 0"
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
---
|
|
780
|
+
|
|
781
|
+
## π§ Table Maintenance
|
|
782
|
+
|
|
783
|
+
Table maintenance tools help optimize performance and fix issues.
|
|
784
|
+
|
|
785
|
+
### Maintenance Tools Overview
|
|
786
|
+
|
|
787
|
+
- **`analyze_table`** - Update index statistics for query optimizer
|
|
788
|
+
- **`optimize_table`** - Reclaim unused space and defragment
|
|
789
|
+
- **`check_table`** - Check table for errors
|
|
790
|
+
- **`repair_table`** - Repair corrupted tables (MyISAM, ARCHIVE, CSV)
|
|
791
|
+
- **`truncate_table`** - Remove all rows quickly
|
|
792
|
+
- **`get_table_status`** - Get detailed table statistics
|
|
793
|
+
- **`flush_table`** - Close and reopen tables
|
|
794
|
+
- **`get_table_size`** - Get size information for tables
|
|
795
|
+
|
|
796
|
+
### Analyzing Tables
|
|
797
|
+
|
|
798
|
+
**User:** *"Analyze the orders table to update statistics"*
|
|
799
|
+
|
|
800
|
+
```json
|
|
801
|
+
{
|
|
802
|
+
"tool": "analyze_table",
|
|
803
|
+
"arguments": {
|
|
804
|
+
"table_name": "orders"
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
### Optimizing Tables
|
|
810
|
+
|
|
811
|
+
```json
|
|
812
|
+
{
|
|
813
|
+
"tool": "optimize_table",
|
|
814
|
+
"arguments": {
|
|
815
|
+
"table_name": "orders"
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
### Checking Tables for Errors
|
|
821
|
+
|
|
822
|
+
```json
|
|
823
|
+
{
|
|
824
|
+
"tool": "check_table",
|
|
825
|
+
"arguments": {
|
|
826
|
+
"table_name": "orders",
|
|
827
|
+
"check_type": "MEDIUM"
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
**Check Types:**
|
|
833
|
+
- `QUICK` - Don't scan rows for incorrect links
|
|
834
|
+
- `FAST` - Only check tables that haven't been closed properly
|
|
835
|
+
- `MEDIUM` - Scan rows to verify links are correct (default)
|
|
836
|
+
- `EXTENDED` - Full key lookup for each row
|
|
837
|
+
- `CHANGED` - Only check tables changed since last check
|
|
838
|
+
|
|
839
|
+
### Getting Table Size Information
|
|
840
|
+
|
|
841
|
+
```json
|
|
842
|
+
{
|
|
843
|
+
"tool": "get_table_size",
|
|
844
|
+
"arguments": {}
|
|
845
|
+
}
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
**Returns:**
|
|
849
|
+
```json
|
|
850
|
+
{
|
|
851
|
+
"tables": [
|
|
852
|
+
{
|
|
853
|
+
"table_name": "orders",
|
|
854
|
+
"row_count": 150000,
|
|
855
|
+
"data_size_bytes": 15728640,
|
|
856
|
+
"index_size_bytes": 5242880,
|
|
857
|
+
"total_size_mb": "20.00"
|
|
858
|
+
}
|
|
859
|
+
],
|
|
860
|
+
"summary": {
|
|
861
|
+
"total_tables": 25,
|
|
862
|
+
"total_size_mb": "150.50"
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
```
|
|
866
|
+
|
|
867
|
+
---
|
|
868
|
+
|
|
869
|
+
## π Process & Server Management
|
|
870
|
+
|
|
871
|
+
Monitor and manage MySQL server processes and configuration.
|
|
872
|
+
|
|
873
|
+
### Process Tools Overview
|
|
874
|
+
|
|
875
|
+
- **`show_process_list`** - Show all running processes/connections
|
|
876
|
+
- **`kill_process`** - Kill a process or query
|
|
877
|
+
- **`show_status`** - Show server status variables
|
|
878
|
+
- **`show_variables`** - Show server configuration variables
|
|
879
|
+
- **`explain_query`** - Show query execution plan
|
|
880
|
+
- **`show_engine_status`** - Show storage engine status
|
|
881
|
+
- **`get_server_info`** - Get comprehensive server information
|
|
882
|
+
- **`show_binary_logs`** - Show binary log files
|
|
883
|
+
- **`show_replication_status`** - Show replication status
|
|
884
|
+
|
|
885
|
+
### Showing Process List
|
|
886
|
+
|
|
887
|
+
**User:** *"Show me all running MySQL processes"*
|
|
888
|
+
|
|
889
|
+
```json
|
|
890
|
+
{
|
|
891
|
+
"tool": "show_process_list",
|
|
892
|
+
"arguments": {
|
|
893
|
+
"full": true
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
### Killing a Process
|
|
899
|
+
|
|
900
|
+
```json
|
|
901
|
+
{
|
|
902
|
+
"tool": "kill_process",
|
|
903
|
+
"arguments": {
|
|
904
|
+
"process_id": 12345,
|
|
905
|
+
"type": "QUERY"
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
```
|
|
909
|
+
|
|
910
|
+
**Types:**
|
|
911
|
+
- `CONNECTION` - Kill the entire connection
|
|
912
|
+
- `QUERY` - Kill only the current query, keep connection
|
|
913
|
+
|
|
914
|
+
### Explaining Queries
|
|
915
|
+
|
|
916
|
+
**User:** *"Explain this query to see its execution plan"*
|
|
917
|
+
|
|
918
|
+
```json
|
|
919
|
+
{
|
|
920
|
+
"tool": "explain_query",
|
|
921
|
+
"arguments": {
|
|
922
|
+
"query": "SELECT * FROM orders WHERE user_id = 5 ORDER BY created_at DESC",
|
|
923
|
+
"format": "JSON",
|
|
924
|
+
"analyze": true
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
**Formats:**
|
|
930
|
+
- `TRADITIONAL` - Tabular output (default)
|
|
931
|
+
- `JSON` - JSON format with detailed information
|
|
932
|
+
- `TREE` - Tree-like output showing query plan
|
|
933
|
+
|
|
934
|
+
### Getting Server Information
|
|
935
|
+
|
|
936
|
+
```json
|
|
937
|
+
{
|
|
938
|
+
"tool": "get_server_info",
|
|
939
|
+
"arguments": {}
|
|
940
|
+
}
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
**Returns:**
|
|
944
|
+
```json
|
|
945
|
+
{
|
|
946
|
+
"version": "8.0.32",
|
|
947
|
+
"connection_id": 12345,
|
|
948
|
+
"current_user": "app_user@localhost",
|
|
949
|
+
"database": "myapp",
|
|
950
|
+
"uptime": "86400",
|
|
951
|
+
"uptime_formatted": "1d 0h 0m",
|
|
952
|
+
"threads_connected": "5",
|
|
953
|
+
"threads_running": "1",
|
|
954
|
+
"questions": "1000000"
|
|
955
|
+
}
|
|
956
|
+
```
|
|
957
|
+
|
|
958
|
+
### Showing Server Variables
|
|
959
|
+
|
|
960
|
+
```json
|
|
961
|
+
{
|
|
962
|
+
"tool": "show_variables",
|
|
963
|
+
"arguments": {
|
|
964
|
+
"like": "max_%",
|
|
965
|
+
"global": true
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
```
|
|
969
|
+
|
|
970
|
+
---
|
|
971
|
+
|
|
529
972
|
## π Usage Examples
|
|
530
973
|
|
|
531
974
|
### Example 1: Read Data
|
|
@@ -1387,11 +1830,21 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
1387
1830
|
- β
**Query result caching** - **COMPLETED!**
|
|
1388
1831
|
- β
**Advanced query optimization hints** - **COMPLETED!**
|
|
1389
1832
|
|
|
1833
|
+
### Essential Database Objects (v1.6.0)
|
|
1834
|
+
- β
**Views Management** - Create, alter, drop, and query database views - **COMPLETED!**
|
|
1835
|
+
- β
**Triggers Management** - Full trigger lifecycle management - **COMPLETED!**
|
|
1836
|
+
- β
**Functions Management** - Stored function creation and execution - **COMPLETED!**
|
|
1837
|
+
|
|
1838
|
+
### Administration Features (v1.6.0)
|
|
1839
|
+
- β
**Index Management** - Create, drop, and analyze indexes - **COMPLETED!**
|
|
1840
|
+
- β
**Foreign Keys & Constraints** - Constraint management with referential integrity - **COMPLETED!**
|
|
1841
|
+
- β
**Table Maintenance** - Analyze, optimize, check, repair tables - **COMPLETED!**
|
|
1842
|
+
- β
**Process Management** - Server processes, status, and query analysis - **COMPLETED!**
|
|
1843
|
+
|
|
1390
1844
|
### Enterprise Features
|
|
1391
1845
|
- [ ] **Database backup and restore tools**
|
|
1392
1846
|
- [ ] **Data export/import utilities** (CSV, JSON, SQL dumps)
|
|
1393
1847
|
- [ ] **Performance monitoring and metrics**
|
|
1394
|
-
- [ ] **Query performance analysis**
|
|
1395
1848
|
- [ ] **Connection pool monitoring**
|
|
1396
1849
|
- [ ] **Audit logging and compliance**
|
|
1397
1850
|
- [ ] **Data migration utilities**
|
|
@@ -1435,13 +1888,20 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
1435
1888
|
| Feature | Impact | Effort | Priority | Status |
|
|
1436
1889
|
|---------|--------|--------|----------|--------|
|
|
1437
1890
|
| Query Result Caching | High | Medium | 1 | β
COMPLETED |
|
|
1438
|
-
|
|
|
1439
|
-
|
|
|
1440
|
-
|
|
|
1441
|
-
|
|
|
1442
|
-
|
|
|
1443
|
-
|
|
|
1444
|
-
|
|
|
1891
|
+
| Views Management | High | Medium | 2 | β
COMPLETED |
|
|
1892
|
+
| Triggers Management | High | Medium | 3 | β
COMPLETED |
|
|
1893
|
+
| Functions Management | High | Medium | 4 | β
COMPLETED |
|
|
1894
|
+
| Index Management | High | Medium | 5 | β
COMPLETED |
|
|
1895
|
+
| Foreign Keys & Constraints | High | Medium | 6 | β
COMPLETED |
|
|
1896
|
+
| Table Maintenance | High | Low | 7 | β
COMPLETED |
|
|
1897
|
+
| Process Management | High | Medium | 8 | β
COMPLETED |
|
|
1898
|
+
| Query Optimization | Medium | Medium | 9 | β
COMPLETED |
|
|
1899
|
+
| Database Backup/Restore | High | High | 10 | Pending |
|
|
1900
|
+
| Performance Monitoring | High | Medium | 11 | Pending |
|
|
1901
|
+
| Data Migration | High | High | 12 | Pending |
|
|
1902
|
+
| PostgreSQL Adapter | High | High | 13 | Pending |
|
|
1903
|
+
| Audit Logging | Medium | Low | 14 | Pending |
|
|
1904
|
+
| Schema Versioning | Medium | Medium | 15 | Pending |
|
|
1445
1905
|
|
|
1446
1906
|
---
|
|
1447
1907
|
|
package/README.md
CHANGED
|
@@ -463,7 +463,7 @@ After (DDL enabled):
|
|
|
463
463
|
|
|
464
464
|
## π οΈ Available Tools
|
|
465
465
|
|
|
466
|
-
The MCP server provides **
|
|
466
|
+
The MCP server provides **72 powerful tools**:
|
|
467
467
|
|
|
468
468
|
### Database Discovery (4 tools)
|
|
469
469
|
|
|
@@ -485,9 +485,7 @@ The MCP server provides **30 powerful tools**:
|
|
|
485
485
|
|
|
486
486
|
### Bulk Operations (3 tools)
|
|
487
487
|
|
|
488
|
-
| Tool | Description |
|
|
489
|
-
|
|
490
|
-
| Performance |
|
|
488
|
+
| Tool | Description | Performance |
|
|
491
489
|
|------|-------------|-------------|
|
|
492
490
|
| `bulk_insert` | Insert multiple records in batches for optimal performance | Up to 10,000 records per batch |
|
|
493
491
|
| `bulk_update` | Update multiple records with different conditions in batches | Up to 1,000 operations per batch |
|
|
@@ -528,7 +526,7 @@ The MCP server provides **30 powerful tools**:
|
|
|
528
526
|
| `get_transaction_status` | Check if a transaction is active |
|
|
529
527
|
| `execute_in_transaction` | Execute SQL within a transaction context |
|
|
530
528
|
|
|
531
|
-
### Stored Procedures (
|
|
529
|
+
### Stored Procedures (6 tools)
|
|
532
530
|
|
|
533
531
|
| Tool | Description | Requires |
|
|
534
532
|
|------|-------------|----------|
|
|
@@ -537,6 +535,105 @@ The MCP server provides **30 powerful tools**:
|
|
|
537
535
|
| `get_stored_procedure_info` | Get detailed information about a stored procedure | `procedure` permission |
|
|
538
536
|
| `execute_stored_procedure` | Execute stored procedures with IN/OUT/INOUT parameters | `procedure` permission |
|
|
539
537
|
| `drop_stored_procedure` | Delete stored procedures | `procedure` permission |
|
|
538
|
+
| `show_create_procedure` | Show CREATE statement for a stored procedure | `procedure` permission |
|
|
539
|
+
|
|
540
|
+
### Views Management (6 tools) - NEW!
|
|
541
|
+
|
|
542
|
+
| Tool | Description | Requires |
|
|
543
|
+
|------|-------------|----------|
|
|
544
|
+
| `list_views` | List all views in the database | `list` permission |
|
|
545
|
+
| `get_view_info` | Get detailed information about a view | `list` permission |
|
|
546
|
+
| `create_view` | Create a new view with SELECT definition | `ddl` permission |
|
|
547
|
+
| `alter_view` | Alter an existing view definition | `ddl` permission |
|
|
548
|
+
| `drop_view` | Drop a view | `ddl` permission |
|
|
549
|
+
| `show_create_view` | Show CREATE statement for a view | `list` permission |
|
|
550
|
+
|
|
551
|
+
### Triggers Management (5 tools) - NEW!
|
|
552
|
+
|
|
553
|
+
| Tool | Description | Requires |
|
|
554
|
+
|------|-------------|----------|
|
|
555
|
+
| `list_triggers` | List all triggers in the database | `list` permission |
|
|
556
|
+
| `get_trigger_info` | Get detailed information about a trigger | `list` permission |
|
|
557
|
+
| `create_trigger` | Create a new trigger on a table | `ddl` permission |
|
|
558
|
+
| `drop_trigger` | Drop a trigger | `ddl` permission |
|
|
559
|
+
| `show_create_trigger` | Show CREATE statement for a trigger | `list` permission |
|
|
560
|
+
|
|
561
|
+
### Functions Management (6 tools) - NEW!
|
|
562
|
+
|
|
563
|
+
| Tool | Description | Requires |
|
|
564
|
+
|------|-------------|----------|
|
|
565
|
+
| `list_functions` | List all user-defined functions | `list` permission |
|
|
566
|
+
| `get_function_info` | Get detailed information about a function | `list` permission |
|
|
567
|
+
| `create_function` | Create a new user-defined function | `ddl` permission |
|
|
568
|
+
| `drop_function` | Drop a function | `ddl` permission |
|
|
569
|
+
| `show_create_function` | Show CREATE statement for a function | `list` permission |
|
|
570
|
+
| `execute_function` | Execute a function and return its result | `read` permission |
|
|
571
|
+
|
|
572
|
+
### Index Management (5 tools) - NEW!
|
|
573
|
+
|
|
574
|
+
| Tool | Description | Requires |
|
|
575
|
+
|------|-------------|----------|
|
|
576
|
+
| `list_indexes` | List all indexes for a table | `list` permission |
|
|
577
|
+
| `get_index_info` | Get detailed information about an index | `list` permission |
|
|
578
|
+
| `create_index` | Create a new index (BTREE, HASH, FULLTEXT, SPATIAL) | `ddl` permission |
|
|
579
|
+
| `drop_index` | Drop an index from a table | `ddl` permission |
|
|
580
|
+
| `analyze_index` | Analyze index statistics | `utility` permission |
|
|
581
|
+
|
|
582
|
+
### Constraint Management (7 tools) - NEW!
|
|
583
|
+
|
|
584
|
+
| Tool | Description | Requires |
|
|
585
|
+
|------|-------------|----------|
|
|
586
|
+
| `list_foreign_keys` | List all foreign keys for a table | `list` permission |
|
|
587
|
+
| `list_constraints` | List all constraints (PK, FK, UNIQUE, CHECK) | `list` permission |
|
|
588
|
+
| `add_foreign_key` | Add a foreign key constraint | `ddl` permission |
|
|
589
|
+
| `drop_foreign_key` | Drop a foreign key constraint | `ddl` permission |
|
|
590
|
+
| `add_unique_constraint` | Add a unique constraint | `ddl` permission |
|
|
591
|
+
| `drop_constraint` | Drop a UNIQUE or CHECK constraint | `ddl` permission |
|
|
592
|
+
| `add_check_constraint` | Add a CHECK constraint (MySQL 8.0.16+) | `ddl` permission |
|
|
593
|
+
|
|
594
|
+
### Table Maintenance (8 tools) - NEW!
|
|
595
|
+
|
|
596
|
+
| Tool | Description | Requires |
|
|
597
|
+
|------|-------------|----------|
|
|
598
|
+
| `analyze_table` | Update index statistics for optimizer | `utility` permission |
|
|
599
|
+
| `optimize_table` | Reclaim unused space and defragment | `utility` permission |
|
|
600
|
+
| `check_table` | Check table for errors | `utility` permission |
|
|
601
|
+
| `repair_table` | Repair corrupted table (MyISAM, ARCHIVE, CSV) | `utility` permission |
|
|
602
|
+
| `truncate_table` | Remove all rows quickly | `ddl` permission |
|
|
603
|
+
| `get_table_status` | Get detailed table status and statistics | `list` permission |
|
|
604
|
+
| `flush_table` | Close and reopen table(s) | `utility` permission |
|
|
605
|
+
| `get_table_size` | Get size information for tables | `list` permission |
|
|
606
|
+
|
|
607
|
+
### Process & Server Management (9 tools) - NEW!
|
|
608
|
+
|
|
609
|
+
| Tool | Description | Requires |
|
|
610
|
+
|------|-------------|----------|
|
|
611
|
+
| `show_process_list` | Show all running MySQL processes | `utility` permission |
|
|
612
|
+
| `kill_process` | Kill a MySQL process/connection | `utility` permission |
|
|
613
|
+
| `show_status` | Show MySQL server status variables | `utility` permission |
|
|
614
|
+
| `show_variables` | Show MySQL server configuration variables | `utility` permission |
|
|
615
|
+
| `explain_query` | Show query execution plan (EXPLAIN) | `utility` permission |
|
|
616
|
+
| `show_engine_status` | Show storage engine status (InnoDB) | `utility` permission |
|
|
617
|
+
| `get_server_info` | Get comprehensive server information | `utility` permission |
|
|
618
|
+
| `show_binary_logs` | Show binary log files | `utility` permission |
|
|
619
|
+
| `show_replication_status` | Show replication status | `utility` permission |
|
|
620
|
+
|
|
621
|
+
### Cache Management (5 tools)
|
|
622
|
+
|
|
623
|
+
| Tool | Description |
|
|
624
|
+
|------|-------------|
|
|
625
|
+
| `get_cache_stats` | Get query cache statistics |
|
|
626
|
+
| `get_cache_config` | Get current cache configuration |
|
|
627
|
+
| `configure_cache` | Configure cache settings (TTL, max size) |
|
|
628
|
+
| `clear_cache` | Clear all cached query results |
|
|
629
|
+
| `invalidate_table_cache` | Invalidate cache for a specific table |
|
|
630
|
+
|
|
631
|
+
### Query Optimization (2 tools)
|
|
632
|
+
|
|
633
|
+
| Tool | Description |
|
|
634
|
+
|------|-------------|
|
|
635
|
+
| `analyze_query` | Analyze query and get optimization suggestions |
|
|
636
|
+
| `get_optimization_hints` | Get optimizer hints for SPEED, MEMORY, or STABILITY goals |
|
|
540
637
|
|
|
541
638
|
---
|
|
542
639
|
|