@vurb/prisma-gen 3.13.1 → 3.14.1
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 +86 -86
- package/package.json +1 -1
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