@node2flow/sqlite-mcp 1.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/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/client.d.ts +38 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +212 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +163 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +54 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +212 -0
- package/dist/server.js.map +1 -0
- package/dist/tools.d.ts +18 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +406 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +52 -0
package/dist/server.js
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP Server — used by both stdio and HTTP modes
|
|
3
|
+
*/
|
|
4
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
+
import { ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import { SqliteClient } from './client.js';
|
|
7
|
+
import { TOOLS } from './tools.js';
|
|
8
|
+
export function handleToolCall(toolName, args, client) {
|
|
9
|
+
switch (toolName) {
|
|
10
|
+
// ========== Query & Execute ==========
|
|
11
|
+
case 'sqlite_query':
|
|
12
|
+
return client.query(args.sql, args.params);
|
|
13
|
+
case 'sqlite_execute':
|
|
14
|
+
return client.execute(args.sql, args.params);
|
|
15
|
+
case 'sqlite_run_script':
|
|
16
|
+
return client.runScript(args.sql);
|
|
17
|
+
// ========== Schema Inspection ==========
|
|
18
|
+
case 'sqlite_list_tables':
|
|
19
|
+
return client.listTables();
|
|
20
|
+
case 'sqlite_describe_table':
|
|
21
|
+
return client.describeTable(args.table);
|
|
22
|
+
case 'sqlite_list_indexes':
|
|
23
|
+
return client.listIndexes(args.table);
|
|
24
|
+
case 'sqlite_list_foreign_keys':
|
|
25
|
+
return client.listForeignKeys(args.table);
|
|
26
|
+
// ========== Schema Management ==========
|
|
27
|
+
case 'sqlite_create_table': {
|
|
28
|
+
client.createTable(args.table, args.columns, args.ifNotExists);
|
|
29
|
+
return { success: true, table: args.table };
|
|
30
|
+
}
|
|
31
|
+
case 'sqlite_alter_table': {
|
|
32
|
+
client.alterTable(args.table, args.action, args);
|
|
33
|
+
return { success: true, table: args.table, action: args.action };
|
|
34
|
+
}
|
|
35
|
+
case 'sqlite_drop_table': {
|
|
36
|
+
client.dropTable(args.table, args.ifExists);
|
|
37
|
+
return { success: true, table: args.table, dropped: true };
|
|
38
|
+
}
|
|
39
|
+
// ========== Index Management ==========
|
|
40
|
+
case 'sqlite_create_index': {
|
|
41
|
+
client.createIndex(args.table, args.columns, args.indexName, args.unique, args.ifNotExists);
|
|
42
|
+
return {
|
|
43
|
+
success: true,
|
|
44
|
+
table: args.table,
|
|
45
|
+
indexName: args.indexName ||
|
|
46
|
+
`idx_${args.table}_${args.columns.join('_')}`,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
case 'sqlite_drop_index': {
|
|
50
|
+
client.dropIndex(args.indexName, args.ifExists);
|
|
51
|
+
return { success: true, indexName: args.indexName, dropped: true };
|
|
52
|
+
}
|
|
53
|
+
// ========== Database Management ==========
|
|
54
|
+
case 'sqlite_get_info':
|
|
55
|
+
return client.getInfo();
|
|
56
|
+
case 'sqlite_vacuum':
|
|
57
|
+
return client.vacuum();
|
|
58
|
+
case 'sqlite_integrity_check':
|
|
59
|
+
return client.integrityCheck();
|
|
60
|
+
default:
|
|
61
|
+
throw new Error(`Unknown tool: ${toolName}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export function createServer(config) {
|
|
65
|
+
const server = new McpServer({
|
|
66
|
+
name: 'sqlite-mcp',
|
|
67
|
+
version: '1.0.0',
|
|
68
|
+
});
|
|
69
|
+
let client = null;
|
|
70
|
+
// Register all 15 tools with annotations
|
|
71
|
+
for (const tool of TOOLS) {
|
|
72
|
+
server.registerTool(tool.name, {
|
|
73
|
+
description: tool.description,
|
|
74
|
+
inputSchema: tool.inputSchema,
|
|
75
|
+
annotations: tool.annotations,
|
|
76
|
+
}, async (args) => {
|
|
77
|
+
const dbPath = config?.dbPath ||
|
|
78
|
+
args.SQLITE_DB_PATH;
|
|
79
|
+
if (!dbPath) {
|
|
80
|
+
return {
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: 'Error: SQLITE_DB_PATH is required',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
isError: true,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (!client) {
|
|
91
|
+
client = new SqliteClient({
|
|
92
|
+
dbPath,
|
|
93
|
+
readonly: config?.readonly,
|
|
94
|
+
timeout: config?.timeout,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
const result = handleToolCall(tool.name, args, client);
|
|
99
|
+
return {
|
|
100
|
+
content: [
|
|
101
|
+
{
|
|
102
|
+
type: 'text',
|
|
103
|
+
text: JSON.stringify(result, null, 2),
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
isError: false,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return {
|
|
111
|
+
content: [
|
|
112
|
+
{
|
|
113
|
+
type: 'text',
|
|
114
|
+
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
isError: true,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
// Register prompts
|
|
123
|
+
server.prompt('explore-database', 'Guide for exploring and querying a SQLite database', async () => ({
|
|
124
|
+
messages: [
|
|
125
|
+
{
|
|
126
|
+
role: 'user',
|
|
127
|
+
content: {
|
|
128
|
+
type: 'text',
|
|
129
|
+
text: [
|
|
130
|
+
'You are a SQLite database assistant.',
|
|
131
|
+
'',
|
|
132
|
+
'Available exploration actions:',
|
|
133
|
+
'1. **List tables** — Use sqlite_list_tables to see all tables with row counts',
|
|
134
|
+
'2. **Describe table** — Use sqlite_describe_table to see columns, types, constraints',
|
|
135
|
+
'3. **List indexes** — Use sqlite_list_indexes to see indexes on a table',
|
|
136
|
+
'4. **List foreign keys** — Use sqlite_list_foreign_keys to see relationships',
|
|
137
|
+
'5. **Query data** — Use sqlite_query with SELECT statements',
|
|
138
|
+
'6. **Database info** — Use sqlite_get_info for metadata (size, version, journal mode)',
|
|
139
|
+
'7. **Health check** — Use sqlite_integrity_check to verify database health',
|
|
140
|
+
'',
|
|
141
|
+
'Start by listing tables with sqlite_list_tables, then describe tables of interest.',
|
|
142
|
+
].join('\n'),
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
}));
|
|
147
|
+
server.prompt('manage-schema', 'Guide for managing SQLite tables, columns, and indexes', async () => ({
|
|
148
|
+
messages: [
|
|
149
|
+
{
|
|
150
|
+
role: 'user',
|
|
151
|
+
content: {
|
|
152
|
+
type: 'text',
|
|
153
|
+
text: [
|
|
154
|
+
'You are a SQLite schema management assistant.',
|
|
155
|
+
'',
|
|
156
|
+
'Available schema actions:',
|
|
157
|
+
'1. **Create table** — Use sqlite_create_table with column definitions',
|
|
158
|
+
'2. **Alter table** — Use sqlite_alter_table to add/rename columns or rename table',
|
|
159
|
+
'3. **Drop table** — Use sqlite_drop_table to delete a table (irreversible)',
|
|
160
|
+
'4. **Create index** — Use sqlite_create_index for query performance',
|
|
161
|
+
'5. **Drop index** — Use sqlite_drop_index to remove an index',
|
|
162
|
+
'6. **Run script** — Use sqlite_run_script for multi-statement migrations',
|
|
163
|
+
'7. **Execute** — Use sqlite_execute for INSERT, UPDATE, DELETE statements',
|
|
164
|
+
'',
|
|
165
|
+
'Column types: INTEGER, TEXT, REAL, BLOB, NUMERIC',
|
|
166
|
+
'Constraints: PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT',
|
|
167
|
+
'',
|
|
168
|
+
'What would you like to manage?',
|
|
169
|
+
].join('\n'),
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
}));
|
|
174
|
+
// Register resources
|
|
175
|
+
server.resource('server-info', 'sqlite://server-info', {
|
|
176
|
+
description: 'Connection status and available tools for this SQLite MCP server',
|
|
177
|
+
mimeType: 'application/json',
|
|
178
|
+
}, async () => ({
|
|
179
|
+
contents: [
|
|
180
|
+
{
|
|
181
|
+
uri: 'sqlite://server-info',
|
|
182
|
+
mimeType: 'application/json',
|
|
183
|
+
text: JSON.stringify({
|
|
184
|
+
name: 'sqlite-mcp',
|
|
185
|
+
version: '1.0.0',
|
|
186
|
+
connected: !!config,
|
|
187
|
+
database: config?.dbPath ?? '(not configured)',
|
|
188
|
+
tools_available: TOOLS.length,
|
|
189
|
+
tool_categories: {
|
|
190
|
+
query_and_execute: 3,
|
|
191
|
+
schema_inspection: 4,
|
|
192
|
+
schema_management: 3,
|
|
193
|
+
index_management: 2,
|
|
194
|
+
database_management: 3,
|
|
195
|
+
},
|
|
196
|
+
}, null, 2),
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
}));
|
|
200
|
+
// Override tools/list handler to return raw JSON Schema with property descriptions.
|
|
201
|
+
// McpServer's Zod processing strips raw JSON Schema properties, returning empty schemas.
|
|
202
|
+
server.server.setRequestHandler(ListToolsRequestSchema, () => ({
|
|
203
|
+
tools: TOOLS.map((tool) => ({
|
|
204
|
+
name: tool.name,
|
|
205
|
+
description: tool.description,
|
|
206
|
+
inputSchema: tool.inputSchema,
|
|
207
|
+
annotations: tool.annotations,
|
|
208
|
+
})),
|
|
209
|
+
}));
|
|
210
|
+
return server;
|
|
211
|
+
}
|
|
212
|
+
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AAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC,CAAC;KACJ,CAAC,CAAC,CAAC;IAEJ,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite MCP - Tool Definitions (15 tools)
|
|
3
|
+
*/
|
|
4
|
+
export interface ToolAnnotation {
|
|
5
|
+
title: string;
|
|
6
|
+
readOnlyHint?: boolean;
|
|
7
|
+
destructiveHint?: boolean;
|
|
8
|
+
idempotentHint?: boolean;
|
|
9
|
+
openWorldHint?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface MCPToolDefinition {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
annotations: ToolAnnotation;
|
|
15
|
+
inputSchema: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare const TOOLS: MCPToolDefinition[];
|
|
18
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,cAAc,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,eAAO,MAAM,KAAK,EAAE,iBAAiB,EA2bpC,CAAC"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite MCP - Tool Definitions (15 tools)
|
|
3
|
+
*/
|
|
4
|
+
export const TOOLS = [
|
|
5
|
+
// ========== Query & Execute (3) ==========
|
|
6
|
+
{
|
|
7
|
+
name: 'sqlite_query',
|
|
8
|
+
description: 'Execute a SELECT query on the SQLite database and return rows as a JSON array. Use this for reading data — supports any valid SELECT statement with optional parameter binding for safe queries.',
|
|
9
|
+
annotations: {
|
|
10
|
+
title: 'Query Database',
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
idempotentHint: true,
|
|
14
|
+
openWorldHint: false,
|
|
15
|
+
},
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
sql: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'SQL SELECT query to execute (e.g., "SELECT * FROM users WHERE age > ?")',
|
|
22
|
+
},
|
|
23
|
+
params: {
|
|
24
|
+
type: 'array',
|
|
25
|
+
items: {},
|
|
26
|
+
description: 'Array of bind parameter values for ? placeholders (e.g., [25])',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ['sql'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'sqlite_execute',
|
|
34
|
+
description: 'Execute a write statement (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP) on the SQLite database. Returns the number of rows changed and the last inserted row ID. Use parameter binding for safe writes.',
|
|
35
|
+
annotations: {
|
|
36
|
+
title: 'Execute Statement',
|
|
37
|
+
readOnlyHint: false,
|
|
38
|
+
destructiveHint: false,
|
|
39
|
+
idempotentHint: false,
|
|
40
|
+
openWorldHint: false,
|
|
41
|
+
},
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
properties: {
|
|
45
|
+
sql: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'SQL write statement to execute (e.g., "INSERT INTO users (name, age) VALUES (?, ?)")',
|
|
48
|
+
},
|
|
49
|
+
params: {
|
|
50
|
+
type: 'array',
|
|
51
|
+
items: {},
|
|
52
|
+
description: 'Array of bind parameter values for ? placeholders (e.g., ["Alice", 30])',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
required: ['sql'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'sqlite_run_script',
|
|
60
|
+
description: 'Execute multiple SQL statements in a single transaction. All statements succeed or all fail (atomic). Separate statements with semicolons. Use for migrations, seed data, or batch operations.',
|
|
61
|
+
annotations: {
|
|
62
|
+
title: 'Run SQL Script',
|
|
63
|
+
readOnlyHint: false,
|
|
64
|
+
destructiveHint: false,
|
|
65
|
+
idempotentHint: false,
|
|
66
|
+
openWorldHint: false,
|
|
67
|
+
},
|
|
68
|
+
inputSchema: {
|
|
69
|
+
type: 'object',
|
|
70
|
+
properties: {
|
|
71
|
+
sql: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'Multiple SQL statements separated by semicolons (e.g., "CREATE TABLE t1 (id INTEGER); INSERT INTO t1 VALUES (1);")',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
required: ['sql'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
// ========== Schema Inspection (4) ==========
|
|
80
|
+
{
|
|
81
|
+
name: 'sqlite_list_tables',
|
|
82
|
+
description: 'List all tables and views in the database with their row counts. Use this as the first step to explore an unfamiliar database. Returns table name, type (table or view), and row count.',
|
|
83
|
+
annotations: {
|
|
84
|
+
title: 'List Tables',
|
|
85
|
+
readOnlyHint: true,
|
|
86
|
+
destructiveHint: false,
|
|
87
|
+
idempotentHint: true,
|
|
88
|
+
openWorldHint: false,
|
|
89
|
+
},
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'sqlite_describe_table',
|
|
97
|
+
description: 'Get the column schema of a table — column names, data types, NOT NULL constraints, default values, and primary key flags. Also returns the CREATE TABLE SQL statement.',
|
|
98
|
+
annotations: {
|
|
99
|
+
title: 'Describe Table',
|
|
100
|
+
readOnlyHint: true,
|
|
101
|
+
destructiveHint: false,
|
|
102
|
+
idempotentHint: true,
|
|
103
|
+
openWorldHint: false,
|
|
104
|
+
},
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
properties: {
|
|
108
|
+
table: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
description: 'Table name to describe (e.g., "users")',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
required: ['table'],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'sqlite_list_indexes',
|
|
118
|
+
description: 'List all indexes on a table — index name, uniqueness, origin (manual or auto-created), and whether it is a partial index.',
|
|
119
|
+
annotations: {
|
|
120
|
+
title: 'List Indexes',
|
|
121
|
+
readOnlyHint: true,
|
|
122
|
+
destructiveHint: false,
|
|
123
|
+
idempotentHint: true,
|
|
124
|
+
openWorldHint: false,
|
|
125
|
+
},
|
|
126
|
+
inputSchema: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
properties: {
|
|
129
|
+
table: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
description: 'Table name to list indexes for (e.g., "users")',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
required: ['table'],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'sqlite_list_foreign_keys',
|
|
139
|
+
description: 'List foreign key constraints on a table — referenced table, local and remote columns, ON UPDATE and ON DELETE actions.',
|
|
140
|
+
annotations: {
|
|
141
|
+
title: 'List Foreign Keys',
|
|
142
|
+
readOnlyHint: true,
|
|
143
|
+
destructiveHint: false,
|
|
144
|
+
idempotentHint: true,
|
|
145
|
+
openWorldHint: false,
|
|
146
|
+
},
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: 'object',
|
|
149
|
+
properties: {
|
|
150
|
+
table: {
|
|
151
|
+
type: 'string',
|
|
152
|
+
description: 'Table name to list foreign keys for (e.g., "orders")',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
required: ['table'],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
// ========== Schema Management (3) ==========
|
|
159
|
+
{
|
|
160
|
+
name: 'sqlite_create_table',
|
|
161
|
+
description: 'Create a new table with column definitions. Each column has a name, type, and optional constraints (PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT). Use ifNotExists to skip if the table already exists.',
|
|
162
|
+
annotations: {
|
|
163
|
+
title: 'Create Table',
|
|
164
|
+
readOnlyHint: false,
|
|
165
|
+
destructiveHint: false,
|
|
166
|
+
idempotentHint: false,
|
|
167
|
+
openWorldHint: false,
|
|
168
|
+
},
|
|
169
|
+
inputSchema: {
|
|
170
|
+
type: 'object',
|
|
171
|
+
properties: {
|
|
172
|
+
table: {
|
|
173
|
+
type: 'string',
|
|
174
|
+
description: 'Name for the new table (e.g., "users")',
|
|
175
|
+
},
|
|
176
|
+
columns: {
|
|
177
|
+
type: 'array',
|
|
178
|
+
items: {
|
|
179
|
+
type: 'object',
|
|
180
|
+
properties: {
|
|
181
|
+
name: {
|
|
182
|
+
type: 'string',
|
|
183
|
+
description: 'Column name (e.g., "id", "email")',
|
|
184
|
+
},
|
|
185
|
+
type: {
|
|
186
|
+
type: 'string',
|
|
187
|
+
description: 'Column data type (e.g., "INTEGER", "TEXT", "REAL", "BLOB")',
|
|
188
|
+
},
|
|
189
|
+
primaryKey: {
|
|
190
|
+
type: 'boolean',
|
|
191
|
+
description: 'Set as PRIMARY KEY (default: false)',
|
|
192
|
+
},
|
|
193
|
+
notNull: {
|
|
194
|
+
type: 'boolean',
|
|
195
|
+
description: 'Add NOT NULL constraint (default: false)',
|
|
196
|
+
},
|
|
197
|
+
default: {
|
|
198
|
+
description: 'Default value for the column (string or number)',
|
|
199
|
+
},
|
|
200
|
+
unique: {
|
|
201
|
+
type: 'boolean',
|
|
202
|
+
description: 'Add UNIQUE constraint (default: false)',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
required: ['name', 'type'],
|
|
206
|
+
},
|
|
207
|
+
description: 'Array of column definitions with name, type, and optional constraints',
|
|
208
|
+
},
|
|
209
|
+
ifNotExists: {
|
|
210
|
+
type: 'boolean',
|
|
211
|
+
description: 'Skip creation if table already exists (default: false)',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
required: ['table', 'columns'],
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'sqlite_alter_table',
|
|
219
|
+
description: 'Alter an existing table — add a new column, rename a column, or rename the table. SQLite does not support dropping columns via ALTER TABLE.',
|
|
220
|
+
annotations: {
|
|
221
|
+
title: 'Alter Table',
|
|
222
|
+
readOnlyHint: false,
|
|
223
|
+
destructiveHint: false,
|
|
224
|
+
idempotentHint: false,
|
|
225
|
+
openWorldHint: false,
|
|
226
|
+
},
|
|
227
|
+
inputSchema: {
|
|
228
|
+
type: 'object',
|
|
229
|
+
properties: {
|
|
230
|
+
table: {
|
|
231
|
+
type: 'string',
|
|
232
|
+
description: 'Current table name to alter (e.g., "users")',
|
|
233
|
+
},
|
|
234
|
+
action: {
|
|
235
|
+
type: 'string',
|
|
236
|
+
enum: ['add_column', 'rename_column', 'rename_table'],
|
|
237
|
+
description: 'Alter action: "add_column" to add a new column, "rename_column" to rename a column, "rename_table" to rename the table',
|
|
238
|
+
},
|
|
239
|
+
column: {
|
|
240
|
+
type: 'string',
|
|
241
|
+
description: 'New column name (for add_column action)',
|
|
242
|
+
},
|
|
243
|
+
type: {
|
|
244
|
+
type: 'string',
|
|
245
|
+
description: 'Column data type (for add_column action, e.g., "TEXT", "INTEGER")',
|
|
246
|
+
},
|
|
247
|
+
notNull: {
|
|
248
|
+
type: 'boolean',
|
|
249
|
+
description: 'Add NOT NULL constraint to new column (for add_column, default: false)',
|
|
250
|
+
},
|
|
251
|
+
default: {
|
|
252
|
+
description: 'Default value for new column (for add_column)',
|
|
253
|
+
},
|
|
254
|
+
oldName: {
|
|
255
|
+
type: 'string',
|
|
256
|
+
description: 'Current column name to rename (for rename_column action)',
|
|
257
|
+
},
|
|
258
|
+
newName: {
|
|
259
|
+
type: 'string',
|
|
260
|
+
description: 'New column name (for rename_column action)',
|
|
261
|
+
},
|
|
262
|
+
newTableName: {
|
|
263
|
+
type: 'string',
|
|
264
|
+
description: 'New table name (for rename_table action)',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
required: ['table', 'action'],
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
name: 'sqlite_drop_table',
|
|
272
|
+
description: 'Drop (delete) a table and all its data permanently. This action is irreversible. Use ifExists to avoid errors if the table does not exist.',
|
|
273
|
+
annotations: {
|
|
274
|
+
title: 'Drop Table',
|
|
275
|
+
readOnlyHint: false,
|
|
276
|
+
destructiveHint: true,
|
|
277
|
+
idempotentHint: false,
|
|
278
|
+
openWorldHint: false,
|
|
279
|
+
},
|
|
280
|
+
inputSchema: {
|
|
281
|
+
type: 'object',
|
|
282
|
+
properties: {
|
|
283
|
+
table: {
|
|
284
|
+
type: 'string',
|
|
285
|
+
description: 'Table name to drop (e.g., "old_users")',
|
|
286
|
+
},
|
|
287
|
+
ifExists: {
|
|
288
|
+
type: 'boolean',
|
|
289
|
+
description: 'Skip if table does not exist instead of throwing error (default: false)',
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
required: ['table'],
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
// ========== Index Management (2) ==========
|
|
296
|
+
{
|
|
297
|
+
name: 'sqlite_create_index',
|
|
298
|
+
description: 'Create an index on one or more columns to speed up queries. Optionally create a UNIQUE index to enforce uniqueness. Index name is auto-generated if not provided.',
|
|
299
|
+
annotations: {
|
|
300
|
+
title: 'Create Index',
|
|
301
|
+
readOnlyHint: false,
|
|
302
|
+
destructiveHint: false,
|
|
303
|
+
idempotentHint: false,
|
|
304
|
+
openWorldHint: false,
|
|
305
|
+
},
|
|
306
|
+
inputSchema: {
|
|
307
|
+
type: 'object',
|
|
308
|
+
properties: {
|
|
309
|
+
table: {
|
|
310
|
+
type: 'string',
|
|
311
|
+
description: 'Table to create the index on (e.g., "users")',
|
|
312
|
+
},
|
|
313
|
+
columns: {
|
|
314
|
+
type: 'array',
|
|
315
|
+
items: { type: 'string' },
|
|
316
|
+
description: 'Array of column names to index (e.g., ["email"] or ["last_name", "first_name"])',
|
|
317
|
+
},
|
|
318
|
+
indexName: {
|
|
319
|
+
type: 'string',
|
|
320
|
+
description: 'Custom index name (auto-generated as idx_table_col1_col2 if omitted)',
|
|
321
|
+
},
|
|
322
|
+
unique: {
|
|
323
|
+
type: 'boolean',
|
|
324
|
+
description: 'Create a UNIQUE index to enforce uniqueness (default: false)',
|
|
325
|
+
},
|
|
326
|
+
ifNotExists: {
|
|
327
|
+
type: 'boolean',
|
|
328
|
+
description: 'Skip if index already exists (default: false)',
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
required: ['table', 'columns'],
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
name: 'sqlite_drop_index',
|
|
336
|
+
description: 'Drop (delete) an index by name. Does not affect the table data, only removes the index. Use ifExists to avoid errors if the index does not exist.',
|
|
337
|
+
annotations: {
|
|
338
|
+
title: 'Drop Index',
|
|
339
|
+
readOnlyHint: false,
|
|
340
|
+
destructiveHint: true,
|
|
341
|
+
idempotentHint: false,
|
|
342
|
+
openWorldHint: false,
|
|
343
|
+
},
|
|
344
|
+
inputSchema: {
|
|
345
|
+
type: 'object',
|
|
346
|
+
properties: {
|
|
347
|
+
indexName: {
|
|
348
|
+
type: 'string',
|
|
349
|
+
description: 'Name of the index to drop (e.g., "idx_users_email")',
|
|
350
|
+
},
|
|
351
|
+
ifExists: {
|
|
352
|
+
type: 'boolean',
|
|
353
|
+
description: 'Skip if index does not exist instead of throwing error (default: false)',
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
required: ['indexName'],
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
// ========== Database Management (3) ==========
|
|
360
|
+
{
|
|
361
|
+
name: 'sqlite_get_info',
|
|
362
|
+
description: 'Get database metadata — file path, file size, table count, page count, page size, journal mode, WAL status, encoding, and SQLite version. Use this to understand the database state.',
|
|
363
|
+
annotations: {
|
|
364
|
+
title: 'Get Database Info',
|
|
365
|
+
readOnlyHint: true,
|
|
366
|
+
destructiveHint: false,
|
|
367
|
+
idempotentHint: true,
|
|
368
|
+
openWorldHint: false,
|
|
369
|
+
},
|
|
370
|
+
inputSchema: {
|
|
371
|
+
type: 'object',
|
|
372
|
+
properties: {},
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
name: 'sqlite_vacuum',
|
|
377
|
+
description: 'Optimize and compact the database file by rebuilding it. Reclaims space from deleted rows and defragments the file. Returns file size before and after. May take time on large databases.',
|
|
378
|
+
annotations: {
|
|
379
|
+
title: 'Vacuum Database',
|
|
380
|
+
readOnlyHint: false,
|
|
381
|
+
destructiveHint: false,
|
|
382
|
+
idempotentHint: true,
|
|
383
|
+
openWorldHint: false,
|
|
384
|
+
},
|
|
385
|
+
inputSchema: {
|
|
386
|
+
type: 'object',
|
|
387
|
+
properties: {},
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'sqlite_integrity_check',
|
|
392
|
+
description: 'Run PRAGMA integrity_check to verify the database is not corrupted. Returns "ok" if the database is healthy, or a list of issues found. Use after crashes or suspicious behavior.',
|
|
393
|
+
annotations: {
|
|
394
|
+
title: 'Integrity Check',
|
|
395
|
+
readOnlyHint: true,
|
|
396
|
+
destructiveHint: false,
|
|
397
|
+
idempotentHint: true,
|
|
398
|
+
openWorldHint: false,
|
|
399
|
+
},
|
|
400
|
+
inputSchema: {
|
|
401
|
+
type: 'object',
|
|
402
|
+
properties: {},
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
];
|
|
406
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH,MAAM,CAAC,MAAM,KAAK,GAAwB;IACxC,4CAA4C;IAC5C;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,kMAAkM;QACpM,WAAW,EAAE;YACX,KAAK,EAAE,gBAAgB;YACvB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,yEAAyE;iBAC5E;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE;oBACT,WAAW,EACT,gEAAgE;iBACnE;aACF;YACD,QAAQ,EAAE,CAAC,KAAK,CAAC;SAClB;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,yMAAyM;QAC3M,WAAW,EAAE;YACX,KAAK,EAAE,mBAAmB;YAC1B,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,KAAK;YACrB,aAAa,EAAE,KAAK;SACrB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAA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