@berthojoris/mcp-mysql-server 1.15.0 → 1.16.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 +40 -0
- package/DOCUMENTATIONS.md +292 -5
- package/README.md +14 -13
- package/dist/config/featureConfig.d.ts +2 -1
- package/dist/config/featureConfig.js +20 -0
- package/dist/index.d.ts +225 -0
- package/dist/index.js +60 -0
- package/dist/mcp-server.js +311 -4
- package/dist/tools/ddlTools.js +1 -1
- package/dist/tools/documentationGeneratorTools.d.ts +145 -0
- package/dist/tools/documentationGeneratorTools.js +820 -0
- package/dist/tools/intelligentQueryTools.d.ts +94 -0
- package/dist/tools/intelligentQueryTools.js +713 -0
- package/dist/tools/smartDiscoveryTools.d.ts +163 -0
- package/dist/tools/smartDiscoveryTools.js +750 -0
- package/package.json +1 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { SecurityLayer } from "../security/securityLayer";
|
|
2
|
+
/**
|
|
3
|
+
* AI-Powered Documentation Generator
|
|
4
|
+
* Automatic database documentation generation with business glossary
|
|
5
|
+
*/
|
|
6
|
+
export declare class DocumentationGeneratorTools {
|
|
7
|
+
private db;
|
|
8
|
+
private security;
|
|
9
|
+
constructor(security: SecurityLayer);
|
|
10
|
+
/**
|
|
11
|
+
* Validate database access - ensures only the connected database can be accessed
|
|
12
|
+
*/
|
|
13
|
+
private validateDatabaseAccess;
|
|
14
|
+
/**
|
|
15
|
+
* Generate comprehensive database documentation
|
|
16
|
+
*/
|
|
17
|
+
generateDocumentation(params: {
|
|
18
|
+
scope?: "database" | "table" | "column" | "relationship";
|
|
19
|
+
table_name?: string;
|
|
20
|
+
include_business_glossary?: boolean;
|
|
21
|
+
format?: "markdown" | "html" | "json";
|
|
22
|
+
include_examples?: boolean;
|
|
23
|
+
include_statistics?: boolean;
|
|
24
|
+
database?: string;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
status: string;
|
|
27
|
+
data?: {
|
|
28
|
+
format: string;
|
|
29
|
+
scope: string;
|
|
30
|
+
content: string;
|
|
31
|
+
metadata: {
|
|
32
|
+
generated_at: string;
|
|
33
|
+
database: string;
|
|
34
|
+
tables_documented: number;
|
|
35
|
+
columns_documented: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
error?: string;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Generate data dictionary for a specific table
|
|
42
|
+
*/
|
|
43
|
+
generateDataDictionary(params: {
|
|
44
|
+
table_name: string;
|
|
45
|
+
include_sample_values?: boolean;
|
|
46
|
+
include_constraints?: boolean;
|
|
47
|
+
database?: string;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
status: string;
|
|
50
|
+
data?: {
|
|
51
|
+
table_name: string;
|
|
52
|
+
description: string;
|
|
53
|
+
columns: Array<{
|
|
54
|
+
name: string;
|
|
55
|
+
data_type: string;
|
|
56
|
+
description: string;
|
|
57
|
+
constraints: string[];
|
|
58
|
+
is_nullable: boolean;
|
|
59
|
+
default_value: string | null;
|
|
60
|
+
sample_values?: any[];
|
|
61
|
+
business_term?: string;
|
|
62
|
+
}>;
|
|
63
|
+
primary_key: string[];
|
|
64
|
+
foreign_keys: Array<{
|
|
65
|
+
column: string;
|
|
66
|
+
references_table: string;
|
|
67
|
+
references_column: string;
|
|
68
|
+
}>;
|
|
69
|
+
indexes: Array<{
|
|
70
|
+
name: string;
|
|
71
|
+
columns: string[];
|
|
72
|
+
is_unique: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
};
|
|
75
|
+
error?: string;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* Generate a business glossary from the schema
|
|
79
|
+
*/
|
|
80
|
+
generateBusinessGlossaryReport(params: {
|
|
81
|
+
include_descriptions?: boolean;
|
|
82
|
+
group_by?: "table" | "category" | "alphabetical";
|
|
83
|
+
database?: string;
|
|
84
|
+
}): Promise<{
|
|
85
|
+
status: string;
|
|
86
|
+
data?: {
|
|
87
|
+
glossary: Array<{
|
|
88
|
+
term: string;
|
|
89
|
+
technical_name: string;
|
|
90
|
+
source_table: string;
|
|
91
|
+
data_type: string;
|
|
92
|
+
description: string;
|
|
93
|
+
category: string;
|
|
94
|
+
related_terms?: string[];
|
|
95
|
+
}>;
|
|
96
|
+
categories: string[];
|
|
97
|
+
total_terms: number;
|
|
98
|
+
};
|
|
99
|
+
error?: string;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Generate business glossary from columns
|
|
103
|
+
*/
|
|
104
|
+
private generateBusinessGlossary;
|
|
105
|
+
/**
|
|
106
|
+
* Get table statistics
|
|
107
|
+
*/
|
|
108
|
+
private getTableStatistics;
|
|
109
|
+
/**
|
|
110
|
+
* Generate Markdown documentation
|
|
111
|
+
*/
|
|
112
|
+
private generateMarkdown;
|
|
113
|
+
/**
|
|
114
|
+
* Generate HTML documentation
|
|
115
|
+
*/
|
|
116
|
+
private generateHTML;
|
|
117
|
+
/**
|
|
118
|
+
* Generate JSON documentation
|
|
119
|
+
*/
|
|
120
|
+
private generateJSON;
|
|
121
|
+
/**
|
|
122
|
+
* Group indexes by name
|
|
123
|
+
*/
|
|
124
|
+
private groupIndexes;
|
|
125
|
+
/**
|
|
126
|
+
* Infer business term from column name
|
|
127
|
+
*/
|
|
128
|
+
private inferBusinessTerm;
|
|
129
|
+
/**
|
|
130
|
+
* Infer column description from name and type
|
|
131
|
+
*/
|
|
132
|
+
private inferColumnDescription;
|
|
133
|
+
/**
|
|
134
|
+
* Infer table description from name
|
|
135
|
+
*/
|
|
136
|
+
private inferTableDescription;
|
|
137
|
+
/**
|
|
138
|
+
* Infer category from column name and type
|
|
139
|
+
*/
|
|
140
|
+
private inferCategory;
|
|
141
|
+
/**
|
|
142
|
+
* Normalize column name for comparison
|
|
143
|
+
*/
|
|
144
|
+
private normalizeColumnName;
|
|
145
|
+
}
|