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 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. Install dependencies
7
+ ### 1. Get an API key
8
8
 
9
- ```bash
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. Configure environment
11
+ ### 2. Add to your editor
15
12
 
16
- Create `~/.zapql/.env`:
13
+ **Cursor** — add to `.cursor/mcp.json`:
17
14
 
18
- ```env
19
- # Required
20
- SQL_CONNECTION_STRING=Server=your-server,1433;Database=your-db;User Id=your-user;Password=your-password;Encrypt=false
21
- ZAPQL_API_KEY=any-string-you-choose
22
-
23
- # Optional — enables AI optimization suggestions
24
- LITELLM_API_KEY=your-openai-or-litellm-key
25
- LITELLM_MODEL=gpt-4 # default: gpt-4
26
- ZAPQL_TOP_N=20 # number of optimization suggestions
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
- ### 3. Add to Claude Desktop
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": "node",
38
- "args": ["/path/to/mcp-server/dist/index.js"]
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
- Restart Claude Desktop. ZapQL tools will appear in the tool panel.
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
 
@@ -22,7 +22,7 @@ function getDatabasePath() {
22
22
  */
23
23
  function ensureDatabaseDirectory() {
24
24
  const dbPath = getDatabasePath();
25
- const dbDir = dbPath.substring(0, dbPath.lastIndexOf('/'));
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,+BAA+B;AAC/B,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,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAE3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xC,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zapql-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "ZapQL — Autonomous SQL Server query optimizer via MCP",
5
5
  "main": "dist/index.js",
6
6
  "files": [