@berthojoris/mcp-mysql-server 1.5.0 β 1.6.1
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/CHANGELOG.md +19 -0
- package/DOCUMENTATIONS.md +495 -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/manifest.json +290 -248
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ All notable changes to the MySQL MCP Server will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.4.16] - 2025-11-22
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **get_table_size tool** - Added get_table_size tool to manifest.json and documentation
|
|
12
|
+
- Tool was implemented in server code but missing from manifest causing "Unknown tool" error
|
|
13
|
+
- Added proper input/output schema to manifest.json
|
|
14
|
+
- Enhanced documentation with usage examples and parameter details
|
|
15
|
+
- Updated version in manifest.json to match server code (1.4.4)
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- **Manifest synchronization** - Fixed manifest.json to include all implemented tools
|
|
19
|
+
- Many tools were implemented in server code but missing from manifest.json
|
|
20
|
+
- get_table_size tool now properly exposed to MCP clients
|
|
21
|
+
- Version number synchronized between manifest and server code
|
|
22
|
+
|
|
23
|
+
### Documentation
|
|
24
|
+
- Enhanced Table Maintenance section with complete get_table_size examples
|
|
25
|
+
- Added proper usage patterns and parameter documentation
|
|
26
|
+
|
|
8
27
|
## [1.4.15] - 2025-11-22
|
|
9
28
|
|
|
10
29
|
### Fixed
|
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,460 @@ 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
|
+
**User:** *"Get size information for all tables in the database"*
|
|
842
|
+
|
|
843
|
+
```json
|
|
844
|
+
{
|
|
845
|
+
"tool": "get_table_size",
|
|
846
|
+
"arguments": {}
|
|
847
|
+
}
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
**User:** *"Get size information for a specific table"*
|
|
851
|
+
|
|
852
|
+
```json
|
|
853
|
+
{
|
|
854
|
+
"tool": "get_table_size",
|
|
855
|
+
"arguments": {
|
|
856
|
+
"table_name": "orders"
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
**Returns:**
|
|
862
|
+
```json
|
|
863
|
+
{
|
|
864
|
+
"tables": [
|
|
865
|
+
{
|
|
866
|
+
"table_name": "orders",
|
|
867
|
+
"row_count": 150000,
|
|
868
|
+
"data_size_bytes": 15728640,
|
|
869
|
+
"index_size_bytes": 5242880,
|
|
870
|
+
"total_size_mb": "20.00"
|
|
871
|
+
}
|
|
872
|
+
],
|
|
873
|
+
"summary": {
|
|
874
|
+
"total_tables": 25,
|
|
875
|
+
"total_size_mb": "150.50"
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
**Usage:**
|
|
881
|
+
- Get size information for all tables (no arguments)
|
|
882
|
+
- Get size for specific table (use `table_name` parameter)
|
|
883
|
+
- Optional `database` parameter to specify different database
|
|
884
|
+
|
|
885
|
+
---
|
|
886
|
+
|
|
887
|
+
## π Process & Server Management
|
|
888
|
+
|
|
889
|
+
Monitor and manage MySQL server processes and configuration.
|
|
890
|
+
|
|
891
|
+
### Process Tools Overview
|
|
892
|
+
|
|
893
|
+
- **`show_process_list`** - Show all running processes/connections
|
|
894
|
+
- **`kill_process`** - Kill a process or query
|
|
895
|
+
- **`show_status`** - Show server status variables
|
|
896
|
+
- **`show_variables`** - Show server configuration variables
|
|
897
|
+
- **`explain_query`** - Show query execution plan
|
|
898
|
+
- **`show_engine_status`** - Show storage engine status
|
|
899
|
+
- **`get_server_info`** - Get comprehensive server information
|
|
900
|
+
- **`show_binary_logs`** - Show binary log files
|
|
901
|
+
- **`show_replication_status`** - Show replication status
|
|
902
|
+
|
|
903
|
+
### Showing Process List
|
|
904
|
+
|
|
905
|
+
**User:** *"Show me all running MySQL processes"*
|
|
906
|
+
|
|
907
|
+
```json
|
|
908
|
+
{
|
|
909
|
+
"tool": "show_process_list",
|
|
910
|
+
"arguments": {
|
|
911
|
+
"full": true
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
```
|
|
915
|
+
|
|
916
|
+
### Killing a Process
|
|
917
|
+
|
|
918
|
+
```json
|
|
919
|
+
{
|
|
920
|
+
"tool": "kill_process",
|
|
921
|
+
"arguments": {
|
|
922
|
+
"process_id": 12345,
|
|
923
|
+
"type": "QUERY"
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
**Types:**
|
|
929
|
+
- `CONNECTION` - Kill the entire connection
|
|
930
|
+
- `QUERY` - Kill only the current query, keep connection
|
|
931
|
+
|
|
932
|
+
### Explaining Queries
|
|
933
|
+
|
|
934
|
+
**User:** *"Explain this query to see its execution plan"*
|
|
935
|
+
|
|
936
|
+
```json
|
|
937
|
+
{
|
|
938
|
+
"tool": "explain_query",
|
|
939
|
+
"arguments": {
|
|
940
|
+
"query": "SELECT * FROM orders WHERE user_id = 5 ORDER BY created_at DESC",
|
|
941
|
+
"format": "JSON",
|
|
942
|
+
"analyze": true
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
```
|
|
946
|
+
|
|
947
|
+
**Formats:**
|
|
948
|
+
- `TRADITIONAL` - Tabular output (default)
|
|
949
|
+
- `JSON` - JSON format with detailed information
|
|
950
|
+
- `TREE` - Tree-like output showing query plan
|
|
951
|
+
|
|
952
|
+
### Getting Server Information
|
|
953
|
+
|
|
954
|
+
```json
|
|
955
|
+
{
|
|
956
|
+
"tool": "get_server_info",
|
|
957
|
+
"arguments": {}
|
|
958
|
+
}
|
|
959
|
+
```
|
|
960
|
+
|
|
961
|
+
**Returns:**
|
|
962
|
+
```json
|
|
963
|
+
{
|
|
964
|
+
"version": "8.0.32",
|
|
965
|
+
"connection_id": 12345,
|
|
966
|
+
"current_user": "app_user@localhost",
|
|
967
|
+
"database": "myapp",
|
|
968
|
+
"uptime": "86400",
|
|
969
|
+
"uptime_formatted": "1d 0h 0m",
|
|
970
|
+
"threads_connected": "5",
|
|
971
|
+
"threads_running": "1",
|
|
972
|
+
"questions": "1000000"
|
|
973
|
+
}
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
### Showing Server Variables
|
|
977
|
+
|
|
978
|
+
```json
|
|
979
|
+
{
|
|
980
|
+
"tool": "show_variables",
|
|
981
|
+
"arguments": {
|
|
982
|
+
"like": "max_%",
|
|
983
|
+
"global": true
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
---
|
|
989
|
+
|
|
529
990
|
## π Usage Examples
|
|
530
991
|
|
|
531
992
|
### Example 1: Read Data
|
|
@@ -1387,11 +1848,21 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
1387
1848
|
- β
**Query result caching** - **COMPLETED!**
|
|
1388
1849
|
- β
**Advanced query optimization hints** - **COMPLETED!**
|
|
1389
1850
|
|
|
1851
|
+
### Essential Database Objects (v1.6.0)
|
|
1852
|
+
- β
**Views Management** - Create, alter, drop, and query database views - **COMPLETED!**
|
|
1853
|
+
- β
**Triggers Management** - Full trigger lifecycle management - **COMPLETED!**
|
|
1854
|
+
- β
**Functions Management** - Stored function creation and execution - **COMPLETED!**
|
|
1855
|
+
|
|
1856
|
+
### Administration Features (v1.6.0)
|
|
1857
|
+
- β
**Index Management** - Create, drop, and analyze indexes - **COMPLETED!**
|
|
1858
|
+
- β
**Foreign Keys & Constraints** - Constraint management with referential integrity - **COMPLETED!**
|
|
1859
|
+
- β
**Table Maintenance** - Analyze, optimize, check, repair tables - **COMPLETED!**
|
|
1860
|
+
- β
**Process Management** - Server processes, status, and query analysis - **COMPLETED!**
|
|
1861
|
+
|
|
1390
1862
|
### Enterprise Features
|
|
1391
1863
|
- [ ] **Database backup and restore tools**
|
|
1392
1864
|
- [ ] **Data export/import utilities** (CSV, JSON, SQL dumps)
|
|
1393
1865
|
- [ ] **Performance monitoring and metrics**
|
|
1394
|
-
- [ ] **Query performance analysis**
|
|
1395
1866
|
- [ ] **Connection pool monitoring**
|
|
1396
1867
|
- [ ] **Audit logging and compliance**
|
|
1397
1868
|
- [ ] **Data migration utilities**
|
|
@@ -1435,13 +1906,20 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
1435
1906
|
| Feature | Impact | Effort | Priority | Status |
|
|
1436
1907
|
|---------|--------|--------|----------|--------|
|
|
1437
1908
|
| Query Result Caching | High | Medium | 1 | β
COMPLETED |
|
|
1438
|
-
|
|
|
1439
|
-
|
|
|
1440
|
-
|
|
|
1441
|
-
|
|
|
1442
|
-
|
|
|
1443
|
-
|
|
|
1444
|
-
|
|
|
1909
|
+
| Views Management | High | Medium | 2 | β
COMPLETED |
|
|
1910
|
+
| Triggers Management | High | Medium | 3 | β
COMPLETED |
|
|
1911
|
+
| Functions Management | High | Medium | 4 | β
COMPLETED |
|
|
1912
|
+
| Index Management | High | Medium | 5 | β
COMPLETED |
|
|
1913
|
+
| Foreign Keys & Constraints | High | Medium | 6 | β
COMPLETED |
|
|
1914
|
+
| Table Maintenance | High | Low | 7 | β
COMPLETED |
|
|
1915
|
+
| Process Management | High | Medium | 8 | β
COMPLETED |
|
|
1916
|
+
| Query Optimization | Medium | Medium | 9 | β
COMPLETED |
|
|
1917
|
+
| Database Backup/Restore | High | High | 10 | Pending |
|
|
1918
|
+
| Performance Monitoring | High | Medium | 11 | Pending |
|
|
1919
|
+
| Data Migration | High | High | 12 | Pending |
|
|
1920
|
+
| PostgreSQL Adapter | High | High | 13 | Pending |
|
|
1921
|
+
| Audit Logging | Medium | Low | 14 | Pending |
|
|
1922
|
+
| Schema Versioning | Medium | Medium | 15 | Pending |
|
|
1445
1923
|
|
|
1446
1924
|
---
|
|
1447
1925
|
|
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 **73 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
|
|