@vurb/prisma-gen 3.12.1 → 3.12.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.
Files changed (2) hide show
  1. package/README.md +86 -86
  2. package/package.json +67 -67
package/README.md CHANGED
@@ -1,86 +1,86 @@
1
- <p align="center">
2
- <h1 align="center">@vurb/prisma-gen</h1>
3
- <p align="center">
4
- <strong>MCP Tools from Prisma Schema — Vurb.ts</strong> — A framework for creating MCP servers from Prisma databases<br/>
5
- Prisma Generator → MCP tools with field-level security · Tenant isolation · PII redaction · OOM protection
6
- </p>
7
- </p>
8
-
9
- <p align="center">
10
- <a href="https://www.npmjs.com/package/@vurb/prisma-gen"><img src="https://img.shields.io/npm/v/@vurb/prisma-gen?color=blue" alt="npm" /></a>
11
- <a href="https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="License" /></a>
12
- <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node" />
13
- <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-compatible-purple" alt="MCP" /></a>
14
- <a href="https://vurb.vinkius.com/"><img src="https://img.shields.io/badge/Vurb.ts-framework-0ea5e9" alt="Vurb.ts" /></a>
15
- </p>
16
-
17
- ---
18
-
19
- > **MCP Tools from Prisma Schema — Vurb.ts**, the Model Context Protocol framework for building production MCP servers. A compile-time Prisma Generator that reads `schema.prisma` annotations and emits hardened MCP Presenters and ToolBuilders — with field-level security, tenant isolation, and OOM protection baked into the generated code.
20
-
21
- ## Quick Start
22
-
23
- ```prisma
24
- generator mcp {
25
- provider = "vurb-prisma-gen"
26
- output = "../src/tools/database"
27
- }
28
-
29
- model User {
30
- id String @id @default(uuid())
31
- email String @unique
32
- passwordHash String /// @vurb.hide
33
- stripeToken String /// @vurb.hide
34
- creditScore Int /// @vurb.describe("Score 0-1000. Above 700 is PREMIUM.")
35
- tenantId String /// @vurb.tenantKey
36
- }
37
- ```
38
-
39
- ```bash
40
- npx prisma generate
41
- # → src/tools/database/userPresenter.ts
42
- # → src/tools/database/userTools.ts
43
- # → src/tools/database/index.ts
44
- ```
45
-
46
- ## Features
47
-
48
- | Feature | Description |
49
- |---------|-------------|
50
- | **Egress Firewall** | `@vurb.hide` physically excludes columns from the generated Zod response schema — SOC2 at compile time |
51
- | **Semantic Descriptions** | `@vurb.describe("...")` injects domain semantics into generated Zod fields |
52
- | **Tenant Isolation** | `@vurb.tenantKey` injects tenant filters into every query's WHERE clause |
53
- | **OOM Guard** | Pagination enforced with `take` (capped at 50) and `skip` — unbounded queries are structurally impossible |
54
- | **Inversion of Control** | Generates `ToolBuilder` + `Presenter` files, not a server. You wire them in |
55
-
56
- ## Schema Annotations
57
-
58
- | Annotation | Effect |
59
- |---|---|
60
- | `/// @vurb.hide` | Excludes the field from the generated Zod response schema |
61
- | `/// @vurb.describe("...")` | Adds `.describe()` to the Zod field — LLM reads this as a business rule |
62
- | `/// @vurb.tenantKey` | Injects the field into every query's `WHERE` clause from `ctx` |
63
-
64
- ## Installation
65
-
66
- ```bash
67
- npm install @vurb/prisma-gen vurb zod
68
- ```
69
-
70
- ### Peer Dependencies
71
-
72
- | Package | Version |
73
- |---------|---------|
74
- | `vurb` | `^2.0.0` |
75
- | `zod` | `^3.25.1 \|\| ^4.0.0` |
76
- | `prisma` | `^6.0.0` |
77
-
78
- ## Requirements
79
-
80
- - **Node.js** ≥ 18.0.0
81
- - **Vurb.ts** ≥ 2.0.0 (peer dependency)
82
- - **Prisma** ≥ 6.0.0
83
-
84
- ## License
85
-
86
- [Apache-2.0](https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE)
1
+ <p align="center">
2
+ <h1 align="center">@vurb/prisma-gen</h1>
3
+ <p align="center">
4
+ <strong>MCP Tools from Prisma Schema — Vurb.ts</strong> — A framework for creating MCP servers from Prisma databases<br/>
5
+ Prisma Generator → MCP tools with field-level security · Tenant isolation · PII redaction · OOM protection
6
+ </p>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@vurb/prisma-gen"><img src="https://img.shields.io/npm/v/@vurb/prisma-gen?color=blue" alt="npm" /></a>
11
+ <a href="https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="License" /></a>
12
+ <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node" />
13
+ <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-compatible-purple" alt="MCP" /></a>
14
+ <a href="https://vurb.vinkius.com/"><img src="https://img.shields.io/badge/Vurb.ts-framework-0ea5e9" alt="Vurb.ts" /></a>
15
+ </p>
16
+
17
+ ---
18
+
19
+ > **MCP Tools from Prisma Schema — Vurb.ts**, the Model Context Protocol framework for building production MCP servers. A compile-time Prisma Generator that reads `schema.prisma` annotations and emits hardened MCP Presenters and ToolBuilders — with field-level security, tenant isolation, and OOM protection baked into the generated code.
20
+
21
+ ## Quick Start
22
+
23
+ ```prisma
24
+ generator mcp {
25
+ provider = "vurb-prisma-gen"
26
+ output = "../src/tools/database"
27
+ }
28
+
29
+ model User {
30
+ id String @id @default(uuid())
31
+ email String @unique
32
+ passwordHash String /// @vurb.hide
33
+ stripeToken String /// @vurb.hide
34
+ creditScore Int /// @vurb.describe("Score 0-1000. Above 700 is PREMIUM.")
35
+ tenantId String /// @vurb.tenantKey
36
+ }
37
+ ```
38
+
39
+ ```bash
40
+ npx prisma generate
41
+ # → src/tools/database/userPresenter.ts
42
+ # → src/tools/database/userTools.ts
43
+ # → src/tools/database/index.ts
44
+ ```
45
+
46
+ ## Features
47
+
48
+ | Feature | Description |
49
+ |---------|-------------|
50
+ | **Egress Firewall** | `@vurb.hide` physically excludes columns from the generated Zod response schema — SOC2 at compile time |
51
+ | **Semantic Descriptions** | `@vurb.describe("...")` injects domain semantics into generated Zod fields |
52
+ | **Tenant Isolation** | `@vurb.tenantKey` injects tenant filters into every query's WHERE clause |
53
+ | **OOM Guard** | Pagination enforced with `take` (capped at 50) and `skip` — unbounded queries are structurally impossible |
54
+ | **Inversion of Control** | Generates `ToolBuilder` + `Presenter` files, not a server. You wire them in |
55
+
56
+ ## Schema Annotations
57
+
58
+ | Annotation | Effect |
59
+ |---|---|
60
+ | `/// @vurb.hide` | Excludes the field from the generated Zod response schema |
61
+ | `/// @vurb.describe("...")` | Adds `.describe()` to the Zod field — LLM reads this as a business rule |
62
+ | `/// @vurb.tenantKey` | Injects the field into every query's `WHERE` clause from `ctx` |
63
+
64
+ ## Installation
65
+
66
+ ```bash
67
+ npm install @vurb/prisma-gen vurb zod
68
+ ```
69
+
70
+ ### Peer Dependencies
71
+
72
+ | Package | Version |
73
+ |---------|---------|
74
+ | `vurb` | `^2.0.0` |
75
+ | `zod` | `^3.25.1 \|\| ^4.0.0` |
76
+ | `prisma` | `^6.0.0` |
77
+
78
+ ## Requirements
79
+
80
+ - **Node.js** ≥ 18.0.0
81
+ - **Vurb.ts** ≥ 2.0.0 (peer dependency)
82
+ - **Prisma** ≥ 6.0.0
83
+
84
+ ## License
85
+
86
+ [Apache-2.0](https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE)
package/package.json CHANGED
@@ -1,67 +1,67 @@
1
- {
2
- "name": "@vurb/prisma-gen",
3
- "version": "3.12.1",
4
- "description": "Prisma Generator for Vurb. Reads schema annotations (@vurb.hide, @vurb.describe, @vurb.tenantKey) and emits hardened Presenters and ToolBuilders with field-level security, tenant isolation, and OOM protection.",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "bin": {
9
- "vurb-prisma-gen": "./dist/generator.js"
10
- },
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.js",
14
- "types": "./dist/index.d.ts"
15
- }
16
- },
17
- "scripts": {
18
- "build": "tsc",
19
- "test": "vitest run",
20
- "prepublishOnly": "npm run build"
21
- },
22
- "keywords": [
23
- "mcp",
24
- "prisma",
25
- "generator",
26
- "vurb",
27
- "zod",
28
- "mva",
29
- "presenter",
30
- "ai",
31
- "llm",
32
- "tenant-isolation",
33
- "code-generator"
34
- ],
35
- "author": "Renato Marinho",
36
- "repository": {
37
- "type": "git",
38
- "url": "git+https://github.com/vinkius-labs/vurb.ts.git",
39
- "directory": "packages/prisma-gen"
40
- },
41
- "bugs": {
42
- "url": "https://github.com/vinkius-labs/vurb.ts/issues"
43
- },
44
- "homepage": "https://vurb.vinkius.com/",
45
- "files": [
46
- "dist",
47
- "README.md"
48
- ],
49
- "engines": {
50
- "node": ">=18.0.0"
51
- },
52
- "publishConfig": {
53
- "access": "public"
54
- },
55
- "dependencies": {
56
- "@prisma/generator-helper": "^6.0.0"
57
- },
58
- "peerDependencies": {
59
- "@vurb/core": "^3.8.0",
60
- "zod": "^3.25.1 || ^4.0.0"
61
- },
62
- "devDependencies": {
63
- "@types/node": "^25.3.0",
64
- "@vurb/core": ">=3.8.0"
65
- },
66
- "license": "Apache-2.0"
67
- }
1
+ {
2
+ "name": "@vurb/prisma-gen",
3
+ "version": "3.12.2",
4
+ "description": "Prisma Generator for Vurb. Reads schema annotations (@vurb.hide, @vurb.describe, @vurb.tenantKey) and emits hardened Presenters and ToolBuilders with field-level security, tenant isolation, and OOM protection.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "vurb-prisma-gen": "./dist/generator.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "test": "vitest run",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "keywords": [
23
+ "mcp",
24
+ "prisma",
25
+ "generator",
26
+ "vurb",
27
+ "zod",
28
+ "mva",
29
+ "presenter",
30
+ "ai",
31
+ "llm",
32
+ "tenant-isolation",
33
+ "code-generator"
34
+ ],
35
+ "author": "Renato Marinho",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/vinkius-labs/vurb.ts.git",
39
+ "directory": "packages/prisma-gen"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/vinkius-labs/vurb.ts/issues"
43
+ },
44
+ "homepage": "https://vurb.vinkius.com/",
45
+ "files": [
46
+ "dist",
47
+ "README.md"
48
+ ],
49
+ "engines": {
50
+ "node": ">=18.0.0"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "dependencies": {
56
+ "@prisma/generator-helper": "^6.0.0"
57
+ },
58
+ "peerDependencies": {
59
+ "@vurb/core": "^3.8.0",
60
+ "zod": "^3.25.1 || ^4.0.0"
61
+ },
62
+ "devDependencies": {
63
+ "@types/node": "^25.3.0",
64
+ "@vurb/core": ">=3.8.0"
65
+ },
66
+ "license": "Apache-2.0"
67
+ }