easy-sqlite-mcp 1.0.1 → 1.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/LICENSE +21 -0
- package/LICENSE.md +8 -0
- package/README.md +88 -66
- package/dist/tools/sqlite.js +70 -70
- package/package.json +52 -52
- package/skills/sqlite-mcp/SKILL.md +37 -37
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 chenkumi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Copyright 2026 Chenkumi
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
8
|
+
|
package/README.md
CHANGED
|
@@ -1,66 +1,88 @@
|
|
|
1
|
-
# Easy SQLite MCP
|
|
2
|
-
|
|
3
|
-
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server implemented in Node.js and TypeScript, designed to enable LLMs to interact directly with SQLite databases.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
This server provides 7 core tools covering all requirements from connection management to data querying:
|
|
8
|
-
|
|
9
|
-
1. **Connection Management**:
|
|
10
|
-
* `sqlite_open`: Open a specific SQLite database file path.
|
|
11
|
-
* `sqlite_close`: Close the current database connection.
|
|
12
|
-
* `sqlite_status`: Check connection status, file path, and database summary.
|
|
13
|
-
2. **Data Operations**:
|
|
14
|
-
* `sqlite_query`: Execute read-only `SELECT` queries and return results in a structured format.
|
|
15
|
-
* `sqlite_execute`: Execute write or modification operations (e.g., `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `DROP`).
|
|
16
|
-
3. **Schema Discovery**:
|
|
17
|
-
* `sqlite_list_tables`: List all user-defined tables in the database.
|
|
18
|
-
* `sqlite_describe_table`: Get column information, types, and total row count for a specific table.
|
|
19
|
-
|
|
20
|
-
## Installation and Execution
|
|
21
|
-
|
|
22
|
-
### 1. Run via npx
|
|
23
|
-
If the project is published on npm, you can start it directly using `npx` without prior installation:
|
|
24
|
-
```bash
|
|
25
|
-
npx easy-sqlite-mcp
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 2. Local Development and Build
|
|
29
|
-
To develop locally or build from source, follow these steps:
|
|
30
|
-
```bash
|
|
31
|
-
npm install
|
|
32
|
-
npm run build
|
|
33
|
-
npm run dev # Watch for changes and run in development mode
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
# Easy SQLite MCP
|
|
2
|
+
|
|
3
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server implemented in Node.js and TypeScript, designed to enable LLMs to interact directly with SQLite databases.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
This server provides 7 core tools covering all requirements from connection management to data querying:
|
|
8
|
+
|
|
9
|
+
1. **Connection Management**:
|
|
10
|
+
* `sqlite_open`: Open a specific SQLite database file path.
|
|
11
|
+
* `sqlite_close`: Close the current database connection.
|
|
12
|
+
* `sqlite_status`: Check connection status, file path, and database summary.
|
|
13
|
+
2. **Data Operations**:
|
|
14
|
+
* `sqlite_query`: Execute read-only `SELECT` queries and return results in a structured format.
|
|
15
|
+
* `sqlite_execute`: Execute write or modification operations (e.g., `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `DROP`).
|
|
16
|
+
3. **Schema Discovery**:
|
|
17
|
+
* `sqlite_list_tables`: List all user-defined tables in the database.
|
|
18
|
+
* `sqlite_describe_table`: Get column information, types, and total row count for a specific table.
|
|
19
|
+
|
|
20
|
+
## Installation and Execution
|
|
21
|
+
|
|
22
|
+
### 1. Run via npx
|
|
23
|
+
If the project is published on npm, you can start it directly using `npx` without prior installation:
|
|
24
|
+
```bash
|
|
25
|
+
npx easy-sqlite-mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 2. Local Development and Build
|
|
29
|
+
To develop locally or build from source, follow these steps:
|
|
30
|
+
```bash
|
|
31
|
+
npm install
|
|
32
|
+
npm run build
|
|
33
|
+
npm run dev # Watch for changes and run in development mode
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Claude Desktop Example
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"easy-mysql-mcp": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": [
|
|
44
|
+
"-y",
|
|
45
|
+
"easy-mysql-mcp"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Codex config.toml Example
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
[mcp_servers.easy-sqlite-mcp]
|
|
56
|
+
args = ["-y", "easy-sqlite-mcp"]
|
|
57
|
+
command = "npx"
|
|
58
|
+
enabled = true
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## OpenCode opencode.jsonc Example
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"$schema": "https://opencode.ai/config.json",
|
|
66
|
+
"mcp": {
|
|
67
|
+
"easy-mysql-mcp": {
|
|
68
|
+
"type": "local",
|
|
69
|
+
"command": ["npx", "-y", "easy-mysql-mcp"],
|
|
70
|
+
"enabled": true,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Agent Skills (`/skills`)
|
|
77
|
+
|
|
78
|
+
The `/skills` directory contains Agent Skills designed to work in conjunction with this MCP Server. These skill documents provide Large Language Models (LLMs) with the knowledge of how to use this server for professional, high-level database operations. You can add these skills to your AI agent's workspace.
|
|
79
|
+
|
|
80
|
+
## Tech Stack
|
|
81
|
+
- **Runtime**: Node.js (>= 18)
|
|
82
|
+
- **Language**: TypeScript
|
|
83
|
+
- **SDK**: @modelcontextprotocol/sdk
|
|
84
|
+
- **Database**: better-sqlite3 (High performance with support for synchronous operations)
|
|
85
|
+
- **Validation**: Zod (Strict parameter validation)
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
Developed with the assistance of Antigravity.
|
package/dist/tools/sqlite.js
CHANGED
|
@@ -8,18 +8,18 @@ export function registerSqliteTools(server) {
|
|
|
8
8
|
// ─── sqlite_open ───────────────────────────────────────────────
|
|
9
9
|
server.registerTool("sqlite_open", {
|
|
10
10
|
title: "Open SQLite Database",
|
|
11
|
-
description: `Open an SQLite database file at the specified path.
|
|
12
|
-
|
|
13
|
-
Args:
|
|
14
|
-
- file_path (string): Absolute or relative path to the .db / .sqlite file.
|
|
15
|
-
|
|
16
|
-
Returns:
|
|
17
|
-
{ "success": boolean, "message": string }
|
|
18
|
-
|
|
19
|
-
Examples:
|
|
20
|
-
- "Open the users database" -> file_path="/data/users.db"
|
|
21
|
-
|
|
22
|
-
Error Handling:
|
|
11
|
+
description: `Open an SQLite database file at the specified path.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
- file_path (string): Absolute or relative path to the .db / .sqlite file.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
{ "success": boolean, "message": string }
|
|
18
|
+
|
|
19
|
+
Examples:
|
|
20
|
+
- "Open the users database" -> file_path="/data/users.db"
|
|
21
|
+
|
|
22
|
+
Error Handling:
|
|
23
23
|
- Returns success=false with message if the file cannot be opened.`,
|
|
24
24
|
inputSchema: {
|
|
25
25
|
file_path: z
|
|
@@ -43,12 +43,12 @@ Error Handling:
|
|
|
43
43
|
// ─── sqlite_close ──────────────────────────────────────────────
|
|
44
44
|
server.registerTool("sqlite_close", {
|
|
45
45
|
title: "Close SQLite Database",
|
|
46
|
-
description: `Close the currently open SQLite database connection.
|
|
47
|
-
|
|
48
|
-
Returns:
|
|
49
|
-
{ "success": boolean, "message": string }
|
|
50
|
-
|
|
51
|
-
Error Handling:
|
|
46
|
+
description: `Close the currently open SQLite database connection.
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
{ "success": boolean, "message": string }
|
|
50
|
+
|
|
51
|
+
Error Handling:
|
|
52
52
|
- Returns success=false if no database is currently open.`,
|
|
53
53
|
inputSchema: {},
|
|
54
54
|
annotations: {
|
|
@@ -67,14 +67,14 @@ Error Handling:
|
|
|
67
67
|
// ─── sqlite_status ─────────────────────────────────────────────
|
|
68
68
|
server.registerTool("sqlite_status", {
|
|
69
69
|
title: "SQLite Database Status",
|
|
70
|
-
description: `Get the current status of the SQLite database connection.
|
|
71
|
-
|
|
72
|
-
Returns:
|
|
73
|
-
{
|
|
74
|
-
"isOpen": boolean,
|
|
75
|
-
"filePath": string | null,
|
|
76
|
-
"memoryUsage": number | null,
|
|
77
|
-
"tables": number | null
|
|
70
|
+
description: `Get the current status of the SQLite database connection.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
{
|
|
74
|
+
"isOpen": boolean,
|
|
75
|
+
"filePath": string | null,
|
|
76
|
+
"memoryUsage": number | null,
|
|
77
|
+
"tables": number | null
|
|
78
78
|
}`,
|
|
79
79
|
inputSchema: {},
|
|
80
80
|
annotations: {
|
|
@@ -93,17 +93,17 @@ Returns:
|
|
|
93
93
|
// ─── sqlite_query ──────────────────────────────────────────────
|
|
94
94
|
server.registerTool("sqlite_query", {
|
|
95
95
|
title: "Query SQLite Database",
|
|
96
|
-
description: `Execute a read-only SQL query (SELECT) on the currently open database.
|
|
97
|
-
|
|
98
|
-
Args:
|
|
99
|
-
- sql (string): The SQL SELECT statement to execute.
|
|
100
|
-
- params (object, optional): Named parameters for the query (e.g. { ":id": 1 }).
|
|
101
|
-
|
|
102
|
-
Returns:
|
|
103
|
-
{ "columns": string[], "rows": unknown[][], "rowCount": number }
|
|
104
|
-
|
|
105
|
-
Error Handling:
|
|
106
|
-
- Throws if no database is open. Use sqlite_open first.
|
|
96
|
+
description: `Execute a read-only SQL query (SELECT) on the currently open database.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
- sql (string): The SQL SELECT statement to execute.
|
|
100
|
+
- params (object, optional): Named parameters for the query (e.g. { ":id": 1 }).
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
{ "columns": string[], "rows": unknown[][], "rowCount": number }
|
|
104
|
+
|
|
105
|
+
Error Handling:
|
|
106
|
+
- Throws if no database is open. Use sqlite_open first.
|
|
107
107
|
- Returns SQL error message if the query is invalid.`,
|
|
108
108
|
inputSchema: {
|
|
109
109
|
sql: z
|
|
@@ -140,17 +140,17 @@ Error Handling:
|
|
|
140
140
|
// ─── sqlite_execute ────────────────────────────────────────────
|
|
141
141
|
server.registerTool("sqlite_execute", {
|
|
142
142
|
title: "Execute SQL Statement",
|
|
143
|
-
description: `Execute a write SQL statement (INSERT, UPDATE, DELETE, CREATE, DROP, ALTER) on the currently open database.
|
|
144
|
-
|
|
145
|
-
Args:
|
|
146
|
-
- sql (string): The SQL statement to execute.
|
|
147
|
-
- params (object, optional): Named parameters for the statement.
|
|
148
|
-
|
|
149
|
-
Returns:
|
|
150
|
-
{ "changes": number, "lastInsertRowid": number }
|
|
151
|
-
|
|
152
|
-
Error Handling:
|
|
153
|
-
- Throws if no database is open. Use sqlite_open first.
|
|
143
|
+
description: `Execute a write SQL statement (INSERT, UPDATE, DELETE, CREATE, DROP, ALTER) on the currently open database.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
- sql (string): The SQL statement to execute.
|
|
147
|
+
- params (object, optional): Named parameters for the statement.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
{ "changes": number, "lastInsertRowid": number }
|
|
151
|
+
|
|
152
|
+
Error Handling:
|
|
153
|
+
- Throws if no database is open. Use sqlite_open first.
|
|
154
154
|
- Returns SQL error message if the statement is invalid.`,
|
|
155
155
|
inputSchema: {
|
|
156
156
|
sql: z
|
|
@@ -187,12 +187,12 @@ Error Handling:
|
|
|
187
187
|
// ─── sqlite_list_tables ────────────────────────────────────────
|
|
188
188
|
server.registerTool("sqlite_list_tables", {
|
|
189
189
|
title: "List SQLite Tables",
|
|
190
|
-
description: `List all user tables in the currently open SQLite database.
|
|
191
|
-
|
|
192
|
-
Returns:
|
|
193
|
-
{ "tables": string[] }
|
|
194
|
-
|
|
195
|
-
Error Handling:
|
|
190
|
+
description: `List all user tables in the currently open SQLite database.
|
|
191
|
+
|
|
192
|
+
Returns:
|
|
193
|
+
{ "tables": string[] }
|
|
194
|
+
|
|
195
|
+
Error Handling:
|
|
196
196
|
- Throws if no database is open. Use sqlite_open first.`,
|
|
197
197
|
inputSchema: {},
|
|
198
198
|
annotations: {
|
|
@@ -220,22 +220,22 @@ Error Handling:
|
|
|
220
220
|
// ─── sqlite_describe_table ─────────────────────────────────────
|
|
221
221
|
server.registerTool("sqlite_describe_table", {
|
|
222
222
|
title: "Describe SQLite Table",
|
|
223
|
-
description: `Describe the schema of a specific table in the currently open SQLite database.
|
|
224
|
-
|
|
225
|
-
Args:
|
|
226
|
-
- table_name (string): Name of the table to describe.
|
|
227
|
-
|
|
228
|
-
Returns:
|
|
229
|
-
{
|
|
230
|
-
"name": string,
|
|
231
|
-
"columns": [
|
|
232
|
-
{ "cid": number, "name": string, "type": string, "notnull": boolean, "defaultValue": unknown, "pk": boolean }
|
|
233
|
-
],
|
|
234
|
-
"rowCount": number
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
Error Handling:
|
|
238
|
-
- Throws if no database is open. Use sqlite_open first.
|
|
223
|
+
description: `Describe the schema of a specific table in the currently open SQLite database.
|
|
224
|
+
|
|
225
|
+
Args:
|
|
226
|
+
- table_name (string): Name of the table to describe.
|
|
227
|
+
|
|
228
|
+
Returns:
|
|
229
|
+
{
|
|
230
|
+
"name": string,
|
|
231
|
+
"columns": [
|
|
232
|
+
{ "cid": number, "name": string, "type": string, "notnull": boolean, "defaultValue": unknown, "pk": boolean }
|
|
233
|
+
],
|
|
234
|
+
"rowCount": number
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
Error Handling:
|
|
238
|
+
- Throws if no database is open. Use sqlite_open first.
|
|
239
239
|
- Returns error if the table does not exist.`,
|
|
240
240
|
inputSchema: {
|
|
241
241
|
table_name: z
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "easy-sqlite-mcp",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "A high-performance Model Context Protocol (MCP) server for SQLite database interaction.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"mcp",
|
|
7
|
-
"mcp-server",
|
|
8
|
-
"sqlite",
|
|
9
|
-
"database",
|
|
10
|
-
"better-sqlite3"
|
|
11
|
-
],
|
|
12
|
-
"author": "chenkumi",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/chenkumi/easy-sqlite-mcp.git"
|
|
17
|
-
},
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/chenkumi/easy-sqlite-mcp/issues"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/chenkumi/easy-sqlite-mcp#readme",
|
|
22
|
-
"files": [
|
|
23
|
-
"dist",
|
|
24
|
-
"skills",
|
|
25
|
-
"README.md"
|
|
26
|
-
],
|
|
27
|
-
"type": "module",
|
|
28
|
-
"main": "dist/index.js",
|
|
29
|
-
"bin": {
|
|
30
|
-
"easy-sqlite-mcp": "dist/index.js"
|
|
31
|
-
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"start": "node dist/index.js",
|
|
34
|
-
"dev": "tsx watch src/index.ts",
|
|
35
|
-
"build": "tsc",
|
|
36
|
-
"clean": "rimraf dist"
|
|
37
|
-
},
|
|
38
|
-
"engines": {
|
|
39
|
-
"node": ">=18"
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
43
|
-
"better-sqlite3": "^
|
|
44
|
-
"zod": "^3.23.8"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/better-sqlite3": "^7.6.12",
|
|
48
|
-
"@types/node": "^22.10.0",
|
|
49
|
-
"tsx": "^4.19.2",
|
|
50
|
-
"typescript": "^5.7.2"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "easy-sqlite-mcp",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "A high-performance Model Context Protocol (MCP) server for SQLite database interaction.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"mcp-server",
|
|
8
|
+
"sqlite",
|
|
9
|
+
"database",
|
|
10
|
+
"better-sqlite3"
|
|
11
|
+
],
|
|
12
|
+
"author": "chenkumi",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/chenkumi/easy-sqlite-mcp.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/chenkumi/easy-sqlite-mcp/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/chenkumi/easy-sqlite-mcp#readme",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"skills",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "dist/index.js",
|
|
29
|
+
"bin": {
|
|
30
|
+
"easy-sqlite-mcp": "dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"start": "node dist/index.js",
|
|
34
|
+
"dev": "tsx watch src/index.ts",
|
|
35
|
+
"build": "tsc",
|
|
36
|
+
"clean": "rimraf dist"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
43
|
+
"better-sqlite3": "^12.9.0",
|
|
44
|
+
"zod": "^3.23.8"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/better-sqlite3": "^7.6.12",
|
|
48
|
+
"@types/node": "^22.10.0",
|
|
49
|
+
"tsx": "^4.19.2",
|
|
50
|
+
"typescript": "^5.7.2"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sqlite-mcp
|
|
3
|
-
description: A skill specialized in operating SQLite databases. Use this skill when users mention "query database", "read .db or .sqlite files", "store structured data in SQLite", or need to perform SQL operations. This skill provides functionality to open/close databases, execute SQL queries (SELECT), perform write operations (INSERT/UPDATE/DELETE), and explore table schemas.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# SQLite MCP Skill
|
|
7
|
-
|
|
8
|
-
This skill allows you to interact with SQLite databases through a series of MCP tools.
|
|
9
|
-
|
|
10
|
-
## Core Workflow
|
|
11
|
-
|
|
12
|
-
### 1. Open Database
|
|
13
|
-
Before any operation, you must use `sqlite_open` to open the database file.
|
|
14
|
-
- **Tool**: `sqlite_open`
|
|
15
|
-
- **Parameters**: `file_path` (Absolute or relative path)
|
|
16
|
-
|
|
17
|
-
### 2. Explore Structure (Optional)
|
|
18
|
-
If the database content is unclear, you can list tables or view table definitions first.
|
|
19
|
-
- **List Tables**: `sqlite_list_tables`
|
|
20
|
-
- **View Structure**: `sqlite_describe_table` (requires `table_name`)
|
|
21
|
-
|
|
22
|
-
### 3. Data Operation
|
|
23
|
-
- **Read Data**: Use `sqlite_query` to execute `SELECT` statements.
|
|
24
|
-
- **Write Data**: Use `sqlite_execute` to execute `INSERT`, `UPDATE`, `DELETE`, or DDL statements (e.g., `CREATE TABLE`).
|
|
25
|
-
- **Parameterized Queries**: It is recommended to use the `params` parameter (e.g., `{ ":id": 1 }`) to prevent SQL injection.
|
|
26
|
-
|
|
27
|
-
### 4. Check Status
|
|
28
|
-
You can use `sqlite_status` at any time to confirm the current database path and connection status.
|
|
29
|
-
|
|
30
|
-
### 5. Close Database
|
|
31
|
-
After work is finished, use `sqlite_close` to release resources.
|
|
32
|
-
|
|
33
|
-
## Best Practices
|
|
34
|
-
- **Security First**: Prioritize parameterized queries over direct SQL string concatenation.
|
|
35
|
-
- **Transaction Management**: Ensure logical consistency for multi-step write operations.
|
|
36
|
-
- **Path Handling**: Ensure correct path formatting (supports `/` or `\\`).
|
|
37
|
-
- **Error Handling**: If an operation fails, check `sqlite_status` to ensure the database is correctly opened.
|
|
1
|
+
---
|
|
2
|
+
name: sqlite-mcp
|
|
3
|
+
description: A skill specialized in operating SQLite databases. Use this skill when users mention "query database", "read .db or .sqlite files", "store structured data in SQLite", or need to perform SQL operations. This skill provides functionality to open/close databases, execute SQL queries (SELECT), perform write operations (INSERT/UPDATE/DELETE), and explore table schemas.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SQLite MCP Skill
|
|
7
|
+
|
|
8
|
+
This skill allows you to interact with SQLite databases through a series of MCP tools.
|
|
9
|
+
|
|
10
|
+
## Core Workflow
|
|
11
|
+
|
|
12
|
+
### 1. Open Database
|
|
13
|
+
Before any operation, you must use `sqlite_open` to open the database file.
|
|
14
|
+
- **Tool**: `sqlite_open`
|
|
15
|
+
- **Parameters**: `file_path` (Absolute or relative path)
|
|
16
|
+
|
|
17
|
+
### 2. Explore Structure (Optional)
|
|
18
|
+
If the database content is unclear, you can list tables or view table definitions first.
|
|
19
|
+
- **List Tables**: `sqlite_list_tables`
|
|
20
|
+
- **View Structure**: `sqlite_describe_table` (requires `table_name`)
|
|
21
|
+
|
|
22
|
+
### 3. Data Operation
|
|
23
|
+
- **Read Data**: Use `sqlite_query` to execute `SELECT` statements.
|
|
24
|
+
- **Write Data**: Use `sqlite_execute` to execute `INSERT`, `UPDATE`, `DELETE`, or DDL statements (e.g., `CREATE TABLE`).
|
|
25
|
+
- **Parameterized Queries**: It is recommended to use the `params` parameter (e.g., `{ ":id": 1 }`) to prevent SQL injection.
|
|
26
|
+
|
|
27
|
+
### 4. Check Status
|
|
28
|
+
You can use `sqlite_status` at any time to confirm the current database path and connection status.
|
|
29
|
+
|
|
30
|
+
### 5. Close Database
|
|
31
|
+
After work is finished, use `sqlite_close` to release resources.
|
|
32
|
+
|
|
33
|
+
## Best Practices
|
|
34
|
+
- **Security First**: Prioritize parameterized queries over direct SQL string concatenation.
|
|
35
|
+
- **Transaction Management**: Ensure logical consistency for multi-step write operations.
|
|
36
|
+
- **Path Handling**: Ensure correct path formatting (supports `/` or `\\`).
|
|
37
|
+
- **Error Handling**: If an operation fails, check `sqlite_status` to ensure the database is correctly opened.
|