zapql-mcp 0.1.1 → 0.1.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 +35 -22
- package/dist/config/database.js +1 -1
- package/dist/config/database.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,44 +4,57 @@ Autonomous SQL Server query optimizer via the [Model Context Protocol](https://m
|
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
|
-
### 1.
|
|
7
|
+
### 1. Get an API key
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
npm install
|
|
11
|
-
npm run build
|
|
12
|
-
```
|
|
9
|
+
Sign up at [zapql.com](https://www.zapql.com) and create an API key on the dashboard.
|
|
13
10
|
|
|
14
|
-
### 2.
|
|
11
|
+
### 2. Add to your editor
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
**Cursor** — add to `.cursor/mcp.json`:
|
|
17
14
|
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"zapql": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["zapql-mcp"],
|
|
21
|
+
"env": {
|
|
22
|
+
"ZAPQL_API_KEY": "<key from zapql.com dashboard>",
|
|
23
|
+
"SQL_CONNECTION_STRING": "Server=your-server;Database=your-db;User Id=your-user;Password=your-pass;TrustServerCertificate=true"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
27
28
|
```
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
30
|
+
**Claude Desktop** — edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
32
31
|
|
|
33
32
|
```json
|
|
34
33
|
{
|
|
35
34
|
"mcpServers": {
|
|
36
35
|
"zapql": {
|
|
37
|
-
"command": "
|
|
38
|
-
"args": ["
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["zapql-mcp"],
|
|
38
|
+
"env": {
|
|
39
|
+
"ZAPQL_API_KEY": "<key from zapql.com dashboard>",
|
|
40
|
+
"SQL_CONNECTION_STRING": "Server=your-server;Database=your-db;User Id=your-user;Password=your-pass;TrustServerCertificate=true"
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
```
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
### 3. Restart your editor
|
|
48
|
+
|
|
49
|
+
ZapQL tools will appear automatically. Ask your AI agent to "connect to my database and find the slowest queries."
|
|
50
|
+
|
|
51
|
+
### Optional environment variables
|
|
52
|
+
|
|
53
|
+
```env
|
|
54
|
+
LITELLM_API_KEY=your-openai-key # BYOK — use your own LLM for optimization
|
|
55
|
+
LITELLM_MODEL=gpt-4 # default: gpt-4
|
|
56
|
+
ZAPQL_TOP_N=20 # max optimization suggestions
|
|
57
|
+
```
|
|
45
58
|
|
|
46
59
|
---
|
|
47
60
|
|
package/dist/config/database.js
CHANGED
|
@@ -22,7 +22,7 @@ function getDatabasePath() {
|
|
|
22
22
|
*/
|
|
23
23
|
function ensureDatabaseDirectory() {
|
|
24
24
|
const dbPath = getDatabasePath();
|
|
25
|
-
const dbDir =
|
|
25
|
+
const dbDir = (0, path_1.dirname)(dbPath);
|
|
26
26
|
if (!(0, fs_1.existsSync)(dbDir)) {
|
|
27
27
|
(0, fs_1.mkdirSync)(dbDir, { recursive: true });
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/config/database.ts"],"names":[],"mappings":";;;;;AASA,0CAEC;AAKD,0DAOC;AAKD,gDAiDC;AA7ED,oEAAsC;AACtC,+
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/config/database.ts"],"names":[],"mappings":";;;;;AASA,0CAEC;AAKD,0DAOC;AAKD,gDAiDC;AA7ED,oEAAsC;AACtC,+BAAwC;AACxC,2BAA6B;AAC7B,2BAA2C;AAC3C,iEAAyE;AAEzE;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO,IAAA,cAAO,EAAC,IAAA,YAAO,GAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB;IACrC,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,IAAA,cAAO,EAAC,MAAM,CAAC,CAAC;IAE9B,IAAI,CAAC,IAAA,eAAU,EAAC,KAAK,CAAC,EAAE,CAAC;QACvB,IAAA,cAAS,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB;IAChC,uBAAuB,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IAEjC,MAAM,EAAE,GAAG,IAAI,wBAAQ,CAAC,MAAM,CAAC,CAAC;IAEhC,yCAAyC;IACzC,EAAE,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAEtC,8BAA8B;IAC9B,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BP,CAAC,CAAC;IAEH,IAAA,sDAA+B,EAAC,EAAE,CAAC,CAAC;IAEpC,8CAA8C;IAC9C,EAAE,CAAC,IAAI,CAAC;;;GAGP,CAAC,CAAC;IAEH,OAAO,EAAE,CAAC;AACZ,CAAC"}
|