db-mcp 3.0.0 → 3.0.2
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/README.md +5 -20
- package/dist/.tsbuildinfo +1 -1
- package/dist/{chunk-THATOQRT.js → chunk-37G4DLL6.js} +55 -25
- package/dist/{chunk-FR65YPAH.js → chunk-NV34JSQM.js} +1 -1
- package/dist/cli.js +3 -3
- package/dist/constants/server-instructions.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{sqlite-6C3AJI4I.js → sqlite-TB56Z7G3.js} +2 -2
- package/dist/{sqlite-native-ZSSWCTYC.js → sqlite-native-IF75BB3O.js} +1 -1
- package/dist/transports/http/sessions/stateful.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -31,7 +31,9 @@ Read \`sqlite://help\` for gotchas and critical usage patterns.
|
|
|
31
31
|
Read \`sqlite://help/{group}\` for group-specific tool reference (core, json, text, stats, vector, geo, admin, transactions, introspection, migration).
|
|
32
32
|
Only help resources for your enabled tool groups are registered.`;
|
|
33
33
|
var HELP_CONTENT = /* @__PURE__ */ new Map([
|
|
34
|
-
[
|
|
34
|
+
[
|
|
35
|
+
"admin",
|
|
36
|
+
`# db-mcp Help \u2014 Database Administration (32N/31W tools) + Server Audit (5 tools)
|
|
35
37
|
|
|
36
38
|
## Maintenance
|
|
37
39
|
|
|
@@ -144,8 +146,11 @@ sqlite_create_csv_table({
|
|
|
144
146
|
|
|
145
147
|
\`\`\`javascript
|
|
146
148
|
sqlite_append_insight({ insight: "Q4 revenue increased 23% YoY" }); // add to memo://insights
|
|
147
|
-
\`\`\``
|
|
148
|
-
|
|
149
|
+
\`\`\``
|
|
150
|
+
],
|
|
151
|
+
[
|
|
152
|
+
"core",
|
|
153
|
+
`# db-mcp Help \u2014 Core Operations (21 tools)
|
|
149
154
|
|
|
150
155
|
## Basic Queries
|
|
151
156
|
|
|
@@ -178,8 +183,11 @@ sqlite_append_insight({ insight: "Q4 revenue increased 23% YoY" }); // add to me
|
|
|
178
183
|
- \`sqlite_exists({ table: "users", where: "email = 'test@example.com'" })\` \u2014 check if a row exists (stops at first match)
|
|
179
184
|
- \`sqlite_truncate({ table: "users" })\` \u2014 quickly delete all rows from a table (executes \`DELETE FROM table\`)
|
|
180
185
|
- \`sqlite_date_add({ table: "users", column: "created_at", amount: 7, unit: "days", whereClause: "id = 1" })\` \u2014 add or subtract time intervals from a date column. By default returns only the computed column; use \`selectColumns\` to return additional context.
|
|
181
|
-
- \`sqlite_date_diff({ table: "users", column1: "ended_at", column2: "started_at", unit: "days", whereClause: "id = 1" })\` \u2014 calculate the difference between two date columns. By default returns only the computed column; use \`selectColumns\` to return additional context.`
|
|
182
|
-
|
|
186
|
+
- \`sqlite_date_diff({ table: "users", column1: "ended_at", column2: "started_at", unit: "days", whereClause: "id = 1" })\` \u2014 calculate the difference between two date columns. By default returns only the computed column; use \`selectColumns\` to return additional context.`
|
|
187
|
+
],
|
|
188
|
+
[
|
|
189
|
+
"geo",
|
|
190
|
+
`# db-mcp Help \u2014 Geospatial Operations (11N/4W: 4 basic + 7 SpatiaLite [NATIVE ONLY])
|
|
183
191
|
|
|
184
192
|
## Basic Geo (always available \u2014 Haversine formula)
|
|
185
193
|
|
|
@@ -284,8 +292,11 @@ sqlite_spatialite_index({
|
|
|
284
292
|
geometryColumn: "geom",
|
|
285
293
|
action: "create",
|
|
286
294
|
}); // create, drop, or check
|
|
287
|
-
\`\`\``
|
|
288
|
-
|
|
295
|
+
\`\`\``
|
|
296
|
+
],
|
|
297
|
+
[
|
|
298
|
+
"gotchas",
|
|
299
|
+
`# db-mcp Help \u2014 Gotchas & Code Mode
|
|
289
300
|
|
|
290
301
|
## \u26A0\uFE0F Critical Gotchas
|
|
291
302
|
|
|
@@ -346,8 +357,11 @@ sqlite_spatialite_index({
|
|
|
346
357
|
|
|
347
358
|
**Positional args work**: \`sqlite.core.readQuery("SELECT...")\`, \`sqlite.json.insert("docs", "data", {...})\`
|
|
348
359
|
|
|
349
|
-
**Discovery**: \`sqlite.help()\` returns all groups and methods. \`sqlite.core.help()\`, \`sqlite.json.help()\` for group-specific methods.`
|
|
350
|
-
|
|
360
|
+
**Discovery**: \`sqlite.help()\` returns all groups and methods. \`sqlite.core.help()\`, \`sqlite.json.help()\` for group-specific methods.`
|
|
361
|
+
],
|
|
362
|
+
[
|
|
363
|
+
"introspection",
|
|
364
|
+
`# db-mcp Help \u2014 Schema Introspection (10 tools)
|
|
351
365
|
|
|
352
366
|
All introspection tools are **read-only** \u2014 they query PRAGMAs and sqlite_master, never modify data.
|
|
353
367
|
|
|
@@ -428,8 +442,11 @@ sqlite_query_plan({ sql: "SELECT * FROM orders WHERE status = 'active'" });
|
|
|
428
442
|
## \u26A0\uFE0F Gotchas
|
|
429
443
|
|
|
430
444
|
- \`excludeSystemTables\` defaults to \`true\` \u2014 SpatiaLite system tables are hidden for cleaner output. Pass \`false\` to include them
|
|
431
|
-
- \`sqlite_migration_risks\` analyzes DDL text statically \u2014 it does NOT execute the statements`
|
|
432
|
-
|
|
445
|
+
- \`sqlite_migration_risks\` analyzes DDL text statically \u2014 it does NOT execute the statements`
|
|
446
|
+
],
|
|
447
|
+
[
|
|
448
|
+
"json",
|
|
449
|
+
`# db-mcp Help \u2014 JSON Operations (25 tools)
|
|
433
450
|
|
|
434
451
|
## Collection & CRUD
|
|
435
452
|
|
|
@@ -503,8 +520,11 @@ sqlite_json_group_object({
|
|
|
503
520
|
|
|
504
521
|
- \`sqlite_json_storage_info({ table, column })\` \u2014 check text vs JSONB format
|
|
505
522
|
- \`sqlite_jsonb_convert({ table, column })\` \u2014 convert to JSONB for faster queries
|
|
506
|
-
- \`sqlite_json_normalize_column({ table, column, outputFormat? })\` \u2014 normalize JSON (sort keys, compact). \u26A0\uFE0F Defaults to \`"preserve"\` (maintains original format); use \`outputFormat: "text"\` to force text output`
|
|
507
|
-
|
|
523
|
+
- \`sqlite_json_normalize_column({ table, column, outputFormat? })\` \u2014 normalize JSON (sort keys, compact). \u26A0\uFE0F Defaults to \`"preserve"\` (maintains original format); use \`outputFormat: "text"\` to force text output`
|
|
524
|
+
],
|
|
525
|
+
[
|
|
526
|
+
"migration",
|
|
527
|
+
`# db-mcp Help \u2014 Migration Tracking (6 tools)
|
|
508
528
|
|
|
509
529
|
\u26A0\uFE0F Must call \`sqlite_migration_init()\` before using any other migration tool \u2014 it creates the tracking table.
|
|
510
530
|
|
|
@@ -546,8 +566,11 @@ sqlite_migration_status();
|
|
|
546
566
|
## \u26A0\uFE0F Gotchas
|
|
547
567
|
|
|
548
568
|
- Rollback requires \`rollbackSql\` to have been provided when the migration was recorded/applied
|
|
549
|
-
- Migration group is **opt-in** \u2014 not included by default. Enable via \`--tool-filter\` flag: use \`dev-schema\` (core+introspection+migration+codemode) or \`full\` (all groups)`
|
|
550
|
-
|
|
569
|
+
- Migration group is **opt-in** \u2014 not included by default. Enable via \`--tool-filter\` flag: use \`dev-schema\` (core+introspection+migration+codemode) or \`full\` (all groups)`
|
|
570
|
+
],
|
|
571
|
+
[
|
|
572
|
+
"stats",
|
|
573
|
+
`# db-mcp Help \u2014 Statistical Analysis (23N/17W: 17 core + 6 window [NATIVE ONLY])
|
|
551
574
|
|
|
552
575
|
## Core Statistics (always available)
|
|
553
576
|
|
|
@@ -666,8 +689,11 @@ sqlite_window_moving_avg({
|
|
|
666
689
|
windowSize: 7,
|
|
667
690
|
selectColumns: ["date"],
|
|
668
691
|
});
|
|
669
|
-
\`\`\``
|
|
670
|
-
|
|
692
|
+
\`\`\``
|
|
693
|
+
],
|
|
694
|
+
[
|
|
695
|
+
"text",
|
|
696
|
+
`# db-mcp Help \u2014 Text Processing & FTS5 (19N/14W: 14 text + 5 FTS5 [NATIVE ONLY])
|
|
671
697
|
|
|
672
698
|
## Full-Text Search / FTS5 (5 tools, Native only)
|
|
673
699
|
|
|
@@ -805,8 +831,11 @@ sqlite_text_sentiment({
|
|
|
805
831
|
returnWords: true,
|
|
806
832
|
});
|
|
807
833
|
// \u2192 { sentiment: "neutral", score: 0, matchedPositive: ["great"], matchedNegative: ["slow"] }
|
|
808
|
-
\`\`\``
|
|
809
|
-
|
|
834
|
+
\`\`\``
|
|
835
|
+
],
|
|
836
|
+
[
|
|
837
|
+
"transactions",
|
|
838
|
+
`# db-mcp Help \u2014 Transactions (8 tools, Native only)
|
|
810
839
|
|
|
811
840
|
## Atomic Execution (preferred for simple cases)
|
|
812
841
|
|
|
@@ -837,8 +866,11 @@ sqlite_transaction_status(); // \u2192 { status: "active" | "none", active: true
|
|
|
837
866
|
|
|
838
867
|
- Transaction tools are **Native only** \u2014 WASM adapter does not support transactions
|
|
839
868
|
- Use \`sqlite_transaction_execute\` for simple multi-statement operations; manual \`begin\`/\`commit\` for complex flows with savepoints
|
|
840
|
-
- \`sqlite_transaction_status\` is read-only and requires only \`read\` scope; all other transaction tools require \`write\` scope`
|
|
841
|
-
|
|
869
|
+
- \`sqlite_transaction_status\` is read-only and requires only \`read\` scope; all other transaction tools require \`write\` scope`
|
|
870
|
+
],
|
|
871
|
+
[
|
|
872
|
+
"vector",
|
|
873
|
+
`# db-mcp Help \u2014 Vector/Semantic Search (11 tools)
|
|
842
874
|
|
|
843
875
|
\`\`\`javascript
|
|
844
876
|
// Create vector table with metadata columns
|
|
@@ -864,7 +896,8 @@ sqlite_vector_stats({ table: "docs", vectorColumn: "emb" }); // returns sampleSi
|
|
|
864
896
|
// Utility tools for preprocessing
|
|
865
897
|
sqlite_vector_normalize({ vector: [3, 4, 0, 0] }); // returns unit vector [0.6, 0.8, 0, 0]
|
|
866
898
|
sqlite_vector_distance({ vector1: [...], vector2: [...], metric: "cosine" }); // returns { value: <number> }
|
|
867
|
-
\`\`\``
|
|
899
|
+
\`\`\``
|
|
900
|
+
]
|
|
868
901
|
]);
|
|
869
902
|
var BUFFER_HIGH_WATER = 50;
|
|
870
903
|
var FLUSH_INTERVAL_MS = 100;
|
|
@@ -1819,7 +1852,6 @@ function registerAuditBackupTools(server, backupManager, adaptersMap) {
|
|
|
1819
1852
|
destructiveHint: false,
|
|
1820
1853
|
idempotentHint: true,
|
|
1821
1854
|
openWorldHint: false
|
|
1822
|
-
// Requires admin scope
|
|
1823
1855
|
}
|
|
1824
1856
|
},
|
|
1825
1857
|
async (args) => {
|
|
@@ -1887,7 +1919,6 @@ function registerAuditBackupTools(server, backupManager, adaptersMap) {
|
|
|
1887
1919
|
destructiveHint: false,
|
|
1888
1920
|
idempotentHint: true,
|
|
1889
1921
|
openWorldHint: false
|
|
1890
|
-
// Requires admin scope
|
|
1891
1922
|
}
|
|
1892
1923
|
},
|
|
1893
1924
|
async (args) => {
|
|
@@ -1993,7 +2024,6 @@ function registerAuditBackupTools(server, backupManager, adaptersMap) {
|
|
|
1993
2024
|
destructiveHint: false,
|
|
1994
2025
|
idempotentHint: true,
|
|
1995
2026
|
openWorldHint: false
|
|
1996
|
-
// Requires admin scope
|
|
1997
2027
|
}
|
|
1998
2028
|
},
|
|
1999
2029
|
async (args) => {
|
|
@@ -13572,7 +13572,7 @@ function createPragmaSettingsTool(adapter) {
|
|
|
13572
13572
|
inputSchema: PragmaSettingsSchema,
|
|
13573
13573
|
outputSchema: PragmaSettingsOutputSchema,
|
|
13574
13574
|
requiredScopes: ["admin"],
|
|
13575
|
-
annotations:
|
|
13575
|
+
annotations: admin("PRAGMA Settings"),
|
|
13576
13576
|
handler: async (_params, _context) => {
|
|
13577
13577
|
let input;
|
|
13578
13578
|
try {
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_CONFIG, createServer } from './chunk-
|
|
2
|
+
import { DEFAULT_CONFIG, createServer } from './chunk-37G4DLL6.js';
|
|
3
3
|
import { VERSION } from './chunk-E5IESRTK.js';
|
|
4
4
|
import { logger } from './chunk-L552U3QS.js';
|
|
5
5
|
|
|
@@ -344,11 +344,11 @@ async function main() {
|
|
|
344
344
|
if (dbConfig.type === "sqlite") {
|
|
345
345
|
const options = dbConfig.options;
|
|
346
346
|
if (options?.backend === "better-sqlite3") {
|
|
347
|
-
const { NativeSqliteAdapter } = await import('./sqlite-native-
|
|
347
|
+
const { NativeSqliteAdapter } = await import('./sqlite-native-IF75BB3O.js');
|
|
348
348
|
const adapter = new NativeSqliteAdapter();
|
|
349
349
|
await server.registerAdapter(adapter, dbConfig);
|
|
350
350
|
} else {
|
|
351
|
-
const { SqliteAdapter } = await import('./sqlite-
|
|
351
|
+
const { SqliteAdapter } = await import('./sqlite-TB56Z7G3.js');
|
|
352
352
|
const adapter = new SqliteAdapter();
|
|
353
353
|
await server.registerAdapter(adapter, dbConfig);
|
|
354
354
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/constants/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,eAAO,MAAM,YAAY,yxBAmBwC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/constants/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,eAAO,MAAM,YAAY,yxBAmBwC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAo2BnD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DEFAULT_CONFIG, DbMcpServer, createServer } from './chunk-
|
|
1
|
+
export { DEFAULT_CONFIG, DbMcpServer, createServer } from './chunk-37G4DLL6.js';
|
|
2
2
|
export { DatabaseAdapter } from './chunk-W5WQVNVX.js';
|
|
3
3
|
export { NAME, VERSION } from './chunk-E5IESRTK.js';
|
|
4
4
|
export { ALL_TOOL_GROUPS, AuthenticationError, AuthorizationError, ConnectionError, DbMcpError, META_GROUPS, QueryError, TOOL_GROUPS, ValidationError, filterTools, getFilterSummary, getToolFilterFromEnv, isToolEnabled, parseToolFilter } from './chunk-L552U3QS.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getCoreTools, getJsonHelperTools, getJsonOperationTools, getTextTools, getStatsTools, getVirtualTools, getVectorTools, getGeoTools, getAdminTools, getIntrospectionTools, getMigrationTools, getCodeModeTools, executeRead, executeWrite, isDDL, executeGeneral, getResourceDefinitions, getPromptDefinitions, applyCommonPragmas, autoEnableWal, detectAndSetJsonbSupport, SchemaManager } from './chunk-
|
|
2
|
-
export { getCoreTools } from './chunk-
|
|
1
|
+
import { getCoreTools, getJsonHelperTools, getJsonOperationTools, getTextTools, getStatsTools, getVirtualTools, getVectorTools, getGeoTools, getAdminTools, getIntrospectionTools, getMigrationTools, getCodeModeTools, executeRead, executeWrite, isDDL, executeGeneral, getResourceDefinitions, getPromptDefinitions, applyCommonPragmas, autoEnableWal, detectAndSetJsonbSupport, SchemaManager } from './chunk-NV34JSQM.js';
|
|
2
|
+
export { getCoreTools } from './chunk-NV34JSQM.js';
|
|
3
3
|
import { DatabaseAdapter } from './chunk-W5WQVNVX.js';
|
|
4
4
|
import { getToolGroupIcon, VERSION } from './chunk-E5IESRTK.js';
|
|
5
5
|
import { createModuleLogger, ConnectionError, ConfigurationError, ERROR_CODES, DbMcpError } from './chunk-L552U3QS.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RowRecordSchema, WhereConditionSchema, sanitizeIdentifier, buildWhereClause, resolveAliases, autoEnableWal, detectAndSetJsonbSupport, SchemaManager, applyCommonPragmas, isDDL, getResourceDefinitions, getPromptDefinitions, validateIdentifier, normalizeSqliteParams, translateSqliteError, getCoreTools, getJsonOperationTools, getJsonHelperTools, getTextTools, getStatsTools, getVirtualTools, getVectorTools, getGeoTools, getAdminTools, getIntrospectionTools, getMigrationTools, getCodeModeTools, validateTableExists, FtsHeadlineSchema } from './chunk-
|
|
1
|
+
import { RowRecordSchema, WhereConditionSchema, sanitizeIdentifier, buildWhereClause, resolveAliases, autoEnableWal, detectAndSetJsonbSupport, SchemaManager, applyCommonPragmas, isDDL, getResourceDefinitions, getPromptDefinitions, validateIdentifier, normalizeSqliteParams, translateSqliteError, getCoreTools, getJsonOperationTools, getJsonHelperTools, getTextTools, getStatsTools, getVirtualTools, getVectorTools, getGeoTools, getAdminTools, getIntrospectionTools, getMigrationTools, getCodeModeTools, validateTableExists, FtsHeadlineSchema } from './chunk-NV34JSQM.js';
|
|
2
2
|
import { DatabaseAdapter } from './chunk-W5WQVNVX.js';
|
|
3
3
|
import { ErrorResponseFields, write, readOnly, VERSION, admin, writeFs, getToolGroupIcon, idempotent } from './chunk-E5IESRTK.js';
|
|
4
4
|
import { logger, formatHandlerError, ValidationError, ConfigurationError, ERROR_CODES, ConnectionError, DbMcpError, ResourceNotFoundError, ExtensionNotAvailableError } from './chunk-L552U3QS.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateful.d.ts","sourceRoot":"","sources":["../../../../src/transports/http/sessions/stateful.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAUtD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,kBAAkB,EACzB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAOT;AAYD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"stateful.d.ts","sourceRoot":"","sources":["../../../../src/transports/http/sessions/stateful.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAUtD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,kBAAkB,EACzB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAOT;AAYD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CA4QtE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "db-mcp",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "SQLite MCP
|
|
3
|
+
"version": "3.0.2",
|
|
4
|
+
"description": "SQLite MCP Server — Secure Database Administration & Observability with Code Mode. True V8 Isolate Sandbox Unifying 170+ Specialized Tools with Highly Optimized Payloads for 70–90% Token Savings. Includes Dynamic Tool Filtering, Dual-Transport HTTP/SSE, OAuth 2.1 Auth, Granular Access Control, Audit Logging, & Deterministic Error Handling.",
|
|
5
5
|
"mcpName": "io.github.neverinfamous/db-mcp",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"lint:fix": "eslint . --fix",
|
|
27
27
|
"lint:json": "eslint . --format json --output-file eslint-results.json",
|
|
28
28
|
"typecheck": "tsc --noEmit",
|
|
29
|
+
"typecheck:tests": "tsc --noEmit --project tsconfig.test.json",
|
|
29
30
|
"check": "npm run lint && npm run typecheck",
|
|
30
31
|
"test": "vitest run",
|
|
31
32
|
"test:watch": "vitest",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
"node": ">=24.0.0"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
64
|
+
"acorn": "^8.16.0",
|
|
63
65
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
64
66
|
"cors": "2.8.6",
|
|
65
67
|
"express": "5.2.1",
|