db-mcp 1.1.0 → 2.0.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/.gitleaks.toml +9 -0
- package/.trivyignore +8 -0
- package/README.md +193 -120
- package/dist/{chunk-DWJXQEFA.js → chunk-5Y42NPBP.js} +4168 -2411
- package/dist/{chunk-AOUL5SHS.js → chunk-645ZEFLA.js} +70 -20
- package/dist/chunk-OKOVZ5QE.js +28 -0
- package/dist/chunk-SFJQCNG7.js +131 -0
- package/dist/{chunk-S5IDDSSB.js → chunk-VIDSICEL.js} +12 -1
- package/dist/chunk-WBER5YY4.js +2053 -0
- package/dist/{chunk-4IA3DB5C.js → chunk-X3MUUOWM.js} +19 -2
- package/dist/{chunk-Z2GFQU3G.js → chunk-Z7C2TM4L.js} +114 -21
- package/dist/cli.js +79 -5
- package/dist/{http-VSB7DBJR.js → http-6KF4ULDI.js} +199 -77
- package/dist/index.d.ts +231 -8
- package/dist/index.js +6 -5
- package/dist/{sqlite-VHBA4ABV.js → sqlite-U5KSYQXK.js} +63 -140
- package/dist/{sqlite-native-D2LH5ZT7.js → sqlite-native-JXMCFQBA.js} +576 -114
- package/dist/worker-script.js +34 -10
- package/logs/.gitkeep +1 -0
- package/mcp-config-example.json +83 -0
- package/package.json +9 -8
- package/playwright.config.ts +1 -1
- package/scripts/update-badges.ts +99 -0
- package/server.json +7 -5
- package/test-server/README.md +20 -23
- package/test-server/code-map.md +45 -33
- package/test-server/reset-database.ps1 +59 -17
- package/test-server/scripts/README.md +27 -0
- package/test-server/{test-help-resources.mjs → scripts/test-help-resources.mjs} +12 -5
- package/test-server/scripts/test-prompts.mjs +251 -0
- package/test-server/{test-tool-annotations.mjs → scripts/test-tool-annotations.mjs} +9 -4
- package/test-server/test-advanced/README.md +70 -0
- package/test-server/test-advanced/test-codemode-advanced-admin.md +174 -0
- package/test-server/test-advanced/test-codemode-advanced-core.md +193 -0
- package/test-server/test-advanced/test-codemode-advanced-geo.md +157 -0
- package/test-server/test-advanced/test-codemode-advanced-introspection.md +171 -0
- package/test-server/test-advanced/test-codemode-advanced-json.md +169 -0
- package/test-server/test-advanced/test-codemode-advanced-migration.md +160 -0
- package/test-server/test-advanced/test-codemode-advanced-stats.md +185 -0
- package/test-server/test-advanced/test-codemode-advanced-text.md +183 -0
- package/test-server/test-advanced/test-codemode-advanced-transactions.md +136 -0
- package/test-server/test-advanced/test-codemode-advanced-vector.md +141 -0
- package/test-server/test-codemode/README.md +121 -0
- package/test-server/test-codemode/test-codemode-admin.md +223 -0
- package/test-server/test-codemode/test-codemode-core.md +286 -0
- package/test-server/test-codemode/test-codemode-geo.md +177 -0
- package/test-server/test-codemode/test-codemode-introspection.md +190 -0
- package/test-server/test-codemode/test-codemode-json.md +237 -0
- package/test-server/test-codemode/test-codemode-migration.md +278 -0
- package/test-server/test-codemode/test-codemode-sandbox.md +413 -0
- package/test-server/test-codemode/test-codemode-stats.md +232 -0
- package/test-server/test-codemode/test-codemode-text.md +237 -0
- package/test-server/test-codemode/test-codemode-transactions.md +236 -0
- package/test-server/test-codemode/test-codemode-vector.md +244 -0
- package/test-server/test-codemode/test-codemode-wasm-degradation.md +394 -0
- package/test-server/test-database.sql +37 -1
- package/test-server/test-resources.md +43 -16
- package/test-server/test-tool-groups/README.md +100 -0
- package/test-server/test-tool-groups/test-admin-core.md +165 -0
- package/test-server/test-tool-groups/test-admin-extensions.md +133 -0
- package/test-server/{test-tools.md → test-tool-groups/test-core-data.md} +103 -17
- package/test-server/test-tool-groups/test-core-schema.md +240 -0
- package/test-server/test-tool-groups/test-geo-haversine.md +130 -0
- package/test-server/test-tool-groups/test-geo-spatialite.md +110 -0
- package/test-server/test-tool-groups/test-introspection-diagnostics.md +123 -0
- package/test-server/test-tool-groups/test-introspection-schema.md +133 -0
- package/test-server/test-tool-groups/test-json-read.md +219 -0
- package/test-server/test-tool-groups/test-json-write.md +157 -0
- package/test-server/test-tool-groups/test-migration.md +193 -0
- package/test-server/test-tool-groups/test-stats-advanced.md +118 -0
- package/test-server/test-tool-groups/test-stats-basic.md +156 -0
- package/test-server/test-tool-groups/test-text-advanced.md +169 -0
- package/test-server/test-tool-groups/test-text-basic.md +177 -0
- package/test-server/test-tool-groups/test-transactions.md +179 -0
- package/test-server/test-tool-groups/test-vector-read.md +130 -0
- package/test-server/test-tool-groups/test-vector-write.md +115 -0
- package/test-server/tool-reference.md +79 -58
- package/tsconfig.build.json +6 -0
- package/dist/chunk-DZQLDEQS.js +0 -879
- package/test-server/test-agent-experience.md +0 -243
- package/test-server/test-group-tools.md +0 -861
- package/test-server/test-tools-advanced-1.md +0 -517
- package/test-server/test-tools-advanced-2.md +0 -487
- package/test-server/test-tools-codemode.md +0 -629
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Tool Reference
|
|
2
2
|
|
|
3
|
-
Complete reference of all **
|
|
3
|
+
Complete reference of all **151 Native / 125 WASM tools** organized by 10 tool groups + codemode. Each group automatically includes Code Mode (`sqlite_execute_code`) for token-efficient operations.
|
|
4
4
|
|
|
5
5
|
> **3 built-in tools** (`server_info`, `server_health`, `list_adapters`) are always available regardless of filter settings.
|
|
6
6
|
>
|
|
@@ -18,7 +18,7 @@ Sandboxed JavaScript execution that exposes all 9 tool groups through the `sqlit
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## core (
|
|
21
|
+
## core (14 tools + Code Mode)
|
|
22
22
|
|
|
23
23
|
Read/write queries, table and index management, and schema discovery.
|
|
24
24
|
|
|
@@ -26,6 +26,11 @@ Read/write queries, table and index management, and schema discovery.
|
|
|
26
26
|
| ----------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
27
27
|
| `sqlite_read_query` | Execute a SELECT query on the SQLite database. Returns rows as JSON. Use parameter binding for safety. |
|
|
28
28
|
| `sqlite_write_query` | Execute an INSERT, UPDATE, or DELETE query. Returns affected row count. Use parameter binding for safety. |
|
|
29
|
+
| `sqlite_upsert` | Insert a row or update it if it already exists (INSERT ON CONFLICT DO UPDATE / INSERT OR REPLACE). |
|
|
30
|
+
| `sqlite_batch_insert` | Insert multiple rows in a single statement. |
|
|
31
|
+
| `sqlite_count` | Count rows in a table, optionally filtered by a WHERE clause. |
|
|
32
|
+
| `sqlite_exists` | Check whether rows exist in a table, optionally filtered by a WHERE clause. |
|
|
33
|
+
| `sqlite_truncate` | Truncate a table (executes DELETE FROM table). |
|
|
29
34
|
| `sqlite_list_tables` | List all tables and views in the database with their column counts. |
|
|
30
35
|
| `sqlite_describe_table` | Get detailed schema information for a table including columns, types, and constraints. |
|
|
31
36
|
| `sqlite_create_table` | Create a new table in the database with specified columns and constraints. |
|
|
@@ -36,7 +41,7 @@ Read/write queries, table and index management, and schema discovery.
|
|
|
36
41
|
|
|
37
42
|
---
|
|
38
43
|
|
|
39
|
-
## json (
|
|
44
|
+
## json (24 tools + Code Mode)
|
|
40
45
|
|
|
41
46
|
Comprehensive JSON manipulation — read, write, transform, validate, and analyze JSON documents stored in SQLite.
|
|
42
47
|
|
|
@@ -65,12 +70,13 @@ Comprehensive JSON manipulation — read, write, transform, validate, and analyz
|
|
|
65
70
|
| `sqlite_jsonb_convert` | Convert a text JSON column to JSONB binary format for faster processing. Requires SQLite 3.45+. |
|
|
66
71
|
| `sqlite_json_storage_info` | Analyze storage format of a JSON column (text vs JSONB) and report statistics. |
|
|
67
72
|
| `sqlite_json_normalize_column` | Normalize JSON data in a column (sort keys, compact format) for consistent storage and comparison. |
|
|
73
|
+
| `sqlite_json_security_scan` | Scan JSON columns for sensitive keys (PII/credentials), SQL injection patterns, and XSS attack vectors. |
|
|
68
74
|
|
|
69
75
|
---
|
|
70
76
|
|
|
71
|
-
## text (
|
|
77
|
+
## text (19 Native / 14 WASM tools + Code Mode)
|
|
72
78
|
|
|
73
|
-
Text processing, regex, fuzzy matching, phonetic search, and FTS5 full-text search.
|
|
79
|
+
Text processing, regex, fuzzy matching, phonetic search, sentiment analysis, and FTS5 full-text search.
|
|
74
80
|
|
|
75
81
|
| Tool | Description |
|
|
76
82
|
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -87,38 +93,43 @@ Text processing, regex, fuzzy matching, phonetic search, and FTS5 full-text sear
|
|
|
87
93
|
| `sqlite_text_normalize` | Normalize text using Unicode normalization (NFC, NFD, NFKC, NFKD) or strip accents. |
|
|
88
94
|
| `sqlite_text_validate` | Validate text values against patterns: email, phone, URL, UUID, IPv4, or custom regex. |
|
|
89
95
|
| `sqlite_advanced_search` | Advanced search combining exact, fuzzy (Levenshtein), and phonetic (Soundex) matching. |
|
|
96
|
+
| `sqlite_text_sentiment` | Perform basic keyword-based sentiment analysis on raw text. Returns sentiment classification, score, confidence, and optionally matched words. No database query needed. |
|
|
90
97
|
| `sqlite_fts_create` | Create an FTS5 full-text search virtual table. `[NATIVE ONLY]` |
|
|
91
98
|
| `sqlite_fts_search` | Search an FTS5 table using full-text query syntax. `[NATIVE ONLY]` |
|
|
92
99
|
| `sqlite_fts_rebuild` | Rebuild an FTS5 index to optimize search performance. `[NATIVE ONLY]` |
|
|
93
100
|
| `sqlite_fts_match_info` | Get FTS5 match ranking information using bm25. `[NATIVE ONLY]` |
|
|
101
|
+
| `sqlite_fts_headline` | Generate highlighted snippets from FTS5 search results using `highlight()` and `snippet()`. `[NATIVE ONLY]` |
|
|
94
102
|
|
|
95
103
|
---
|
|
96
104
|
|
|
97
|
-
## stats (
|
|
98
|
-
|
|
99
|
-
Statistical analysis — descriptive stats, percentiles, correlation, regression, distributions, and window functions.
|
|
100
|
-
|
|
101
|
-
| Tool
|
|
102
|
-
|
|
|
103
|
-
| `sqlite_stats_basic`
|
|
104
|
-
| `sqlite_stats_count`
|
|
105
|
-
| `sqlite_stats_group_by`
|
|
106
|
-
| `sqlite_stats_histogram`
|
|
107
|
-
| `sqlite_stats_percentile`
|
|
108
|
-
| `sqlite_stats_correlation`
|
|
109
|
-
| `sqlite_stats_top_n`
|
|
110
|
-
| `sqlite_stats_distinct`
|
|
111
|
-
| `sqlite_stats_summary`
|
|
112
|
-
| `sqlite_stats_frequency`
|
|
113
|
-
| `sqlite_stats_outliers`
|
|
114
|
-
| `sqlite_stats_regression`
|
|
115
|
-
| `sqlite_stats_hypothesis`
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
105
|
+
## stats (22 Native / 16 WASM tools + Code Mode)
|
|
106
|
+
|
|
107
|
+
Statistical analysis — descriptive stats, percentiles, correlation, regression, distributions, anomaly detection, and window functions.
|
|
108
|
+
|
|
109
|
+
| Tool | Description |
|
|
110
|
+
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
111
|
+
| `sqlite_stats_basic` | Get basic statistics (count, sum, avg, min, max) for a numeric column. |
|
|
112
|
+
| `sqlite_stats_count` | Count rows, optionally distinct values in a column. |
|
|
113
|
+
| `sqlite_stats_group_by` | Aggregate statistics grouped by a column. |
|
|
114
|
+
| `sqlite_stats_histogram` | Create a histogram with specified number of buckets. |
|
|
115
|
+
| `sqlite_stats_percentile` | Calculate percentiles (median, quartiles, etc.) for a column. |
|
|
116
|
+
| `sqlite_stats_correlation` | Calculate Pearson correlation coefficient between two numeric columns. |
|
|
117
|
+
| `sqlite_stats_top_n` | Get top N values from a column. |
|
|
118
|
+
| `sqlite_stats_distinct` | Get distinct values from a column. |
|
|
119
|
+
| `sqlite_stats_summary` | Get summary statistics for multiple columns at once. |
|
|
120
|
+
| `sqlite_stats_frequency` | Get frequency distribution of values in a column. |
|
|
121
|
+
| `sqlite_stats_outliers` | Detect outliers using IQR (Interquartile Range) or Z-score method. |
|
|
122
|
+
| `sqlite_stats_regression` | Perform linear or polynomial regression analysis between two columns. |
|
|
123
|
+
| `sqlite_stats_hypothesis` | Perform statistical hypothesis tests: one-sample t-test, two-sample t-test, or chi-square test. |
|
|
124
|
+
| `sqlite_stats_detect_anomalies` | Detect data distribution anomalies using z-score analysis across numeric columns. Returns per-column risk assessment. |
|
|
125
|
+
| `sqlite_stats_detect_bloat` | Score tables by fragmentation/bloat risk using PRAGMA + dbstat metrics. Returns weighted risk scores (0-100). |
|
|
126
|
+
| `sqlite_stats_detect_schema_risks` | Score tables by schema health risk: missing FK indexes, no PKs, wide tables, large unindexed tables. Risk scores 0-100. |
|
|
127
|
+
| `sqlite_window_row_number` | Assign sequential row numbers based on ordering. Useful for pagination and ranking. `[NATIVE ONLY]` |
|
|
128
|
+
| `sqlite_window_rank` | Calculate rank of rows. RANK leaves gaps after ties, DENSE_RANK does not, PERCENT_RANK gives 0–1 range. `[NATIVE ONLY]` |
|
|
129
|
+
| `sqlite_window_lag_lead` | Access previous (LAG) or next (LEAD) row values. Useful for comparing consecutive rows. `[NATIVE ONLY]` |
|
|
130
|
+
| `sqlite_window_running_total` | Calculate running (cumulative) total. Useful for balance tracking, cumulative metrics. `[NATIVE ONLY]` |
|
|
131
|
+
| `sqlite_window_moving_avg` | Calculate moving (rolling) average. Useful for smoothing time series data. `[NATIVE ONLY]` |
|
|
132
|
+
| `sqlite_window_ntile` | Divide rows into N buckets. E.g., 4 buckets = quartiles, 10 = deciles, 100 = percentiles. `[NATIVE ONLY]` |
|
|
122
133
|
|
|
123
134
|
---
|
|
124
135
|
|
|
@@ -142,39 +153,49 @@ Vector storage, similarity search, and distance calculations for embeddings and
|
|
|
142
153
|
|
|
143
154
|
---
|
|
144
155
|
|
|
145
|
-
## admin (
|
|
156
|
+
## admin (26 Native / 26 WASM tools + Code Mode)
|
|
157
|
+
|
|
158
|
+
Database maintenance — backup/restore, PRAGMA, views, and virtual tables.
|
|
159
|
+
|
|
160
|
+
| Tool | Description |
|
|
161
|
+
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
162
|
+
| `sqlite_backup` | Create a backup of the database to a file. |
|
|
163
|
+
| `sqlite_analyze` | Analyze table statistics to improve query performance. |
|
|
164
|
+
| `sqlite_integrity_check` | Check database integrity for corruption or errors. |
|
|
165
|
+
| `sqlite_optimize` | Optimize database by reindexing and/or analyzing. |
|
|
166
|
+
| `sqlite_restore` | Restore database from a backup file. WARNING: This replaces the current database. |
|
|
167
|
+
| `sqlite_verify_backup` | Verify a backup file's integrity without restoring it. |
|
|
168
|
+
| `sqlite_index_stats` | Get detailed statistics for database indexes. |
|
|
169
|
+
| `sqlite_pragma_compile_options` | Get the compile-time options used to build SQLite. Use the `filter` parameter to reduce output (~50+ options by default). |
|
|
170
|
+
| `sqlite_pragma_database_list` | List all attached databases. |
|
|
171
|
+
| `sqlite_pragma_optimize` | Run `PRAGMA optimize` to improve query performance based on usage patterns. |
|
|
172
|
+
| `sqlite_pragma_settings` | Get or set a PRAGMA value. |
|
|
173
|
+
| `sqlite_pragma_table_info` | Get detailed column information for a table. |
|
|
174
|
+
| `sqlite_append_insight` | Add a business insight to the `memo://insights` resource. Use this to capture key findings during data analysis. |
|
|
175
|
+
| `sqlite_generate_series` | Generate a series of numbers using `generate_series()` virtual table. |
|
|
176
|
+
| `sqlite_create_view` | Create a view based on a SELECT query. |
|
|
177
|
+
| `sqlite_list_views` | List all views in the database. |
|
|
178
|
+
| `sqlite_drop_view` | Drop (delete) a view from the database. |
|
|
179
|
+
| `sqlite_dbstat` | Get database storage statistics using dbstat virtual table. |
|
|
180
|
+
| `sqlite_vacuum` | Rebuild the database to reclaim space and optimize structure. |
|
|
181
|
+
| `sqlite_list_virtual_tables` | List all virtual tables in the database. |
|
|
182
|
+
| `sqlite_virtual_table_info` | Get metadata about a specific virtual table. |
|
|
183
|
+
| `sqlite_drop_virtual_table` | Drop a virtual table. |
|
|
184
|
+
| `sqlite_create_csv_table` | Create a virtual table from a CSV file. Requires the csv extension. |
|
|
185
|
+
| `sqlite_analyze_csv_schema` | Analyze a CSV file structure and infer column types. Uses a temporary virtual table. |
|
|
186
|
+
| `sqlite_create_rtree_table` | Create an R-Tree virtual table for spatial indexing. Supports 2–5 dimensions. |
|
|
187
|
+
| `sqlite_create_series_table` | Create a table populated with a series of numbers. Unlike `generate_series`, this creates a persistent table. |
|
|
146
188
|
|
|
147
|
-
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## transactions (8 Native tools + Code Mode)
|
|
192
|
+
|
|
193
|
+
Transaction control — begin, commit, rollback, savepoints, and atomic multi-statement execution.
|
|
148
194
|
|
|
149
195
|
| Tool | Description |
|
|
150
196
|
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
151
|
-
| `sqlite_backup` | Create a backup of the database to a file. |
|
|
152
|
-
| `sqlite_analyze` | Analyze table statistics to improve query performance. |
|
|
153
|
-
| `sqlite_integrity_check` | Check database integrity for corruption or errors. |
|
|
154
|
-
| `sqlite_optimize` | Optimize database by reindexing and/or analyzing. |
|
|
155
|
-
| `sqlite_restore` | Restore database from a backup file. WARNING: This replaces the current database. |
|
|
156
|
-
| `sqlite_verify_backup` | Verify a backup file's integrity without restoring it. |
|
|
157
|
-
| `sqlite_index_stats` | Get detailed statistics for database indexes. |
|
|
158
|
-
| `sqlite_pragma_compile_options` | Get the compile-time options used to build SQLite. Use the `filter` parameter to reduce output (~50+ options by default). |
|
|
159
|
-
| `sqlite_pragma_database_list` | List all attached databases. |
|
|
160
|
-
| `sqlite_pragma_optimize` | Run `PRAGMA optimize` to improve query performance based on usage patterns. |
|
|
161
|
-
| `sqlite_pragma_settings` | Get or set a PRAGMA value. |
|
|
162
|
-
| `sqlite_pragma_table_info` | Get detailed column information for a table. |
|
|
163
|
-
| `sqlite_append_insight` | Add a business insight to the `memo://insights` resource. Use this to capture key findings during data analysis. |
|
|
164
|
-
| `sqlite_generate_series` | Generate a series of numbers using `generate_series()` virtual table. |
|
|
165
|
-
| `sqlite_create_view` | Create a view based on a SELECT query. |
|
|
166
|
-
| `sqlite_list_views` | List all views in the database. |
|
|
167
|
-
| `sqlite_drop_view` | Drop (delete) a view from the database. |
|
|
168
|
-
| `sqlite_dbstat` | Get database storage statistics using dbstat virtual table. |
|
|
169
|
-
| `sqlite_vacuum` | Rebuild the database to reclaim space and optimize structure. |
|
|
170
|
-
| `sqlite_list_virtual_tables` | List all virtual tables in the database. |
|
|
171
|
-
| `sqlite_virtual_table_info` | Get metadata about a specific virtual table. |
|
|
172
|
-
| `sqlite_drop_virtual_table` | Drop a virtual table. |
|
|
173
|
-
| `sqlite_create_csv_table` | Create a virtual table from a CSV file. Requires the csv extension. |
|
|
174
|
-
| `sqlite_analyze_csv_schema` | Analyze a CSV file structure and infer column types. Uses a temporary virtual table. |
|
|
175
|
-
| `sqlite_create_rtree_table` | Create an R-Tree virtual table for spatial indexing. Supports 2–5 dimensions. |
|
|
176
|
-
| `sqlite_create_series_table` | Create a table populated with a series of numbers. Unlike `generate_series`, this creates a persistent table. |
|
|
177
197
|
| `sqlite_transaction_begin` | Begin a new transaction. Use immediate or exclusive mode for write-heavy operations. `[NATIVE ONLY]` |
|
|
198
|
+
| `sqlite_transaction_status` | Check whether a transaction is currently active. Returns status and a boolean flag. Read-only. `[NATIVE ONLY]` |
|
|
178
199
|
| `sqlite_transaction_commit` | Commit the current transaction, making all changes permanent. `[NATIVE ONLY]` |
|
|
179
200
|
| `sqlite_transaction_rollback` | Rollback the current transaction, discarding all changes. `[NATIVE ONLY]` |
|
|
180
201
|
| `sqlite_transaction_savepoint` | Create a savepoint within the current transaction for partial rollback. `[NATIVE ONLY]` |
|