@airabbit/sqlite-mcp-server 0.1.3 → 0.1.6

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.
Files changed (3) hide show
  1. package/README.md +12 -21
  2. package/build/index.js +14 -1
  3. package/package.json +4 -1
package/README.md CHANGED
@@ -49,6 +49,13 @@ An example SQLite database (`example-small.sqlite`) is included with sample data
49
49
  - `users` table: 3 users (Alice, Bob, Charlie)
50
50
  - `posts` table: 3 posts linked to users
51
51
 
52
+ ### Installation
53
+
54
+ Install from npm:
55
+ ```bash
56
+ npm install -g @airabbit/sqlite-mcp-server
57
+ ```
58
+
52
59
  ### Claude Desktop Configuration
53
60
 
54
61
  Add this to your Claude Desktop config file (usually `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
@@ -57,35 +64,19 @@ Add this to your Claude Desktop config file (usually `~/Library/Application Supp
57
64
  {
58
65
  "mcpServers": {
59
66
  "@airabbit/sqlite-mcp-server": {
60
- "command": "node",
61
- "args": [
62
- "/absolute/path/to/sqlite-mcp-server/build/index.js"
63
- ],
64
- "env": {
65
- "SQLITE_DB_PATH": "/absolute/path/to/your/database.sqlite"
66
- }
67
- }
68
- }
69
- }
70
- ```
71
-
72
- **Example with included database:**
73
- ```json
74
- {
75
- "mcpServers": {
76
- "@airabbit/sqlite-mcp-server": {
77
- "command": "node",
67
+ "command": "npx",
78
68
  "args": [
79
- "/path/to/sqlite-mcp-server/build/index.js"
69
+ "-y",
70
+ "@airabbit/sqlite-mcp-server"
80
71
  ],
81
72
  "env": {
82
- "SQLITE_DB_PATH": "/path/to/sqlite-mcp-server/example-small.sqlite"
73
+ "SQLITE_DB_PATH": "/path/to/your/database.sqlite"
83
74
  }
84
75
  }
85
76
  }
86
77
  }
87
78
  ```
88
79
 
89
- Replace the paths with your actual installation path and database file path.
80
+ **Note:** Replace `/path/to/your/database.sqlite` with the absolute path to your SQLite database file. The `-y` flag auto-installs the package if not already installed.
90
81
 
91
82
 
package/build/index.js CHANGED
@@ -447,7 +447,20 @@ export class SqliteMcpServer {
447
447
  console.error('SQLite MCP server running on stdio');
448
448
  }
449
449
  }
450
- if (import.meta.url === `file://${process.argv[1]}`) {
450
+ function isMainModule() {
451
+ if (!process.argv[1]) {
452
+ return false;
453
+ }
454
+ try {
455
+ const entryPath = fs.realpathSync(process.argv[1]);
456
+ const modulePath = fs.realpathSync(fileURLToPath(import.meta.url));
457
+ return entryPath === modulePath;
458
+ }
459
+ catch {
460
+ return false;
461
+ }
462
+ }
463
+ if (isMainModule()) {
451
464
  const server = new SqliteMcpServer();
452
465
  server.run().catch(console.error);
453
466
  }
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@airabbit/sqlite-mcp-server",
3
- "version": "0.1.3",
3
+ "version": "0.1.6",
4
4
  "description": "Generic SQLite Model Context Protocol (MCP) server",
5
5
  "main": "build/index.js",
6
+ "bin": {
7
+ "sqlite-mcp-server": "build/index.js"
8
+ },
6
9
  "type": "module",
7
10
  "files": [
8
11
  "build/",