{"_id":"@ahmedshaikh/db-query-mcp","name":"@ahmedshaikh/db-query-mcp","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ahmedshaikh/db-query-mcp","version":"0.1.0","type":"module","description":"Query SQLite database files as an MCP server — structured rows, table/schema introspection, read-only by default. No more sqlite3 shell escaping.","bin":{"agent-db":"dist/cli.js"},"engines":{"node":">=22"},"scripts":{"serve":"tsx src/server.ts","db":"tsx src/cli.ts","build":"tsc","test":"node --import tsx --test --test-force-exit test/*.test.ts","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","zod":"^3.23.8"},"devDependencies":{"@types/node":"^20.11.0","tsx":"^4.7.0","typescript":"^5.4.0"},"license":"MIT","author":{"name":"ahmedshaikh"},"keywords":["mcp","model-context-protocol","claude","agent","ai","sqlite","sql","database","query"],"repository":{"type":"git","url":"git+https://github.com/RaziStuff/db-query-mcp.git"},"homepage":"https://github.com/RaziStuff/db-query-mcp#readme","bugs":{"url":"https://github.com/RaziStuff/db-query-mcp/issues"},"publishConfig":{"access":"public"},"gitHead":"a75b9d2732e565c35e603033ba2446ffb6478042","_id":"@ahmedshaikh/db-query-mcp@0.1.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-eYyB4m5Gdt3mZFFcGMNwemDHfR7KZnY/NIeKRjKHBSWV6ld8fGnMleja63JgrL4aBKl+N11ItUl+MgSwHRmkSA==","shasum":"c727d5352c2e97eac0068332999fcd456ffdfdc1","tarball":"https://registry.npmjs.org/@ahmedshaikh/db-query-mcp/-/db-query-mcp-0.1.0.tgz","fileCount":6,"unpackedSize":9825,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDhlu6G7R75vtbMyMX0TauzNjCNj/c1/mw4HHM6mmTxAgIgdZYlWD9pnuft71HGb5z0lBULsCQ4c6rk9iLtCxnbcCk="}]},"_npmUser":{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"},"directories":{},"maintainers":[{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/db-query-mcp_0.1.0_1782701035878_0.8696732922419816"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-29T02:43:55.768Z","0.1.0":"2026-06-29T02:43:56.000Z","modified":"2026-06-29T02:43:56.230Z"},"maintainers":[{"name":"ahmedshaikh","email":"ahmed@shaikh1.com"}],"description":"Query SQLite database files as an MCP server — structured rows, table/schema introspection, read-only by default. No more sqlite3 shell escaping.","homepage":"https://github.com/RaziStuff/db-query-mcp#readme","keywords":["mcp","model-context-protocol","claude","agent","ai","sqlite","sql","database","query"],"repository":{"type":"git","url":"git+https://github.com/RaziStuff/db-query-mcp.git"},"author":{"name":"ahmedshaikh"},"bugs":{"url":"https://github.com/RaziStuff/db-query-mcp/issues"},"license":"MIT","readme":"# db-query\n\nQuery SQLite `.db` files and get **structured rows** — instead of shelling out to\n`sqlite3` with awkward escaping and re-parsing tabular text. **Read-only by\ndefault** for safety.\n\n```\nquery({ db_path: \"app.db\", sql: \"SELECT type, count(*) n FROM events WHERE ts > ? GROUP BY type\", params: [cutoff] })\n→ { columns: [\"type\", \"n\"], row_count: 4, rows: [ { type: \"click\", n: 812 }, … ] }\n```\n\n## Tools\n\n- **`query(db_path, sql, params?)`** — structured `{ columns, rows, row_count, truncated }`. Use `?` placeholders + `params`. Writes are **blocked** unless the server runs with `DB_QUERY_WRITE=1`.\n- **`tables(db_path)`** — every table + its columns (name/type).\n- **`schema(db_path, table?)`** — the `CREATE` DDL.\n\n`db_path` can be omitted if the server is started with a `DB_QUERY_DB` default.\n\n## Safety\n\nRead-only by default: only `SELECT` / `EXPLAIN` / read `PRAGMA` / `WITH …`-select\nstatements run; anything mutating is rejected with a clear message. Set\n`DB_QUERY_WRITE=1` to allow writes. Rows are capped at 1000 (with `truncated` flagged).\n\n## Setup\n\n```bash\nnpm install   # Node 22+ (uses the built-in node:sqlite — no native build)\nnpm test\n```\n\n```bash\nclaude mcp add db-query -- node /abs/path/db-query/dist/server.js\n# CLI: agent-db tables app.db\n#      agent-db query app.db \"SELECT * FROM users LIMIT 5\"\n```\n\n## Honest limits\n\n- SQLite only (it's what `node:sqlite` speaks).\n- Read-only is enforced by statement inspection, not a sandbox — robust for the\n  common cases, but `DB_QUERY_WRITE=1` is the real boundary if you need writes.\n- 1000-row cap per query (use `LIMIT`/`WHERE` to scope; `truncated` tells you).\n","readmeFilename":"README.md","_rev":"1-63296ccca916a40ae602480c0680fcfd"}