@nifrajs/mcp-db 1.13.0 → 2.1.0

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 (2) hide show
  1. package/README.md +29 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @nifrajs/mcp-db
2
+
3
+ Expose an allowlisted SQLite schema as a fail-closed MCP server, with opt-in read-only queries.
4
+
5
+ ```sh
6
+ bun add @nifrajs/mcp-db
7
+ ```
8
+
9
+ ```ts
10
+ import { Database } from "bun:sqlite"
11
+ import { serveDatabaseAsMcp } from "@nifrajs/mcp-db"
12
+
13
+ const mcp = serveDatabaseAsMcp(new Database("app.db"), {
14
+ tables: ["habits", "entries"],
15
+ })
16
+ ```
17
+
18
+ Only `list_tables` and `describe_table` are exposed by default, restricted to the explicit table
19
+ allowlist. `run_query` requires an authorization hook and is guarded by SQLite query-only mode,
20
+ single-statement/read-only checks, query-plan verification, and bounded output. D1 is not supported
21
+ because it cannot provide the same engine-level read-only guarantee.
22
+
23
+ ## For AI agents
24
+
25
+ Start with [`LLM.md`](./LLM.md) — this package's contract card (the exports you call + its footguns),
26
+ one cheap read instead of the whole corpus. For the wider framework: the repo's
27
+ [`AGENTS.md`](../../AGENTS.md) is the copy-paste quick reference, and
28
+ [`llms-full.txt`](../../llms-full.txt) is the full machine-readable corpus. Run `nifra check` as the
29
+ done-gate, or `nifra mcp` to give the agent live project tools.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nifrajs/mcp-db",
3
- "version": "1.13.0",
3
+ "version": "2.1.0",
4
4
  "description": "Serve a SQLite database as a fail-closed MCP server — allowlisted schema tools by default, opt-in read-only queries with plan verification.",
5
5
  "keywords": [
6
6
  "bun",
@@ -35,7 +35,7 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@nifrajs/mcp": "1.13.0"
38
+ "@nifrajs/mcp": "2.1.0"
39
39
  },
40
40
  "repository": {
41
41
  "type": "git",