@vinkius-core/mcp-fusion-prisma-gen
v3.1.31
Published
Prisma Generator for MCP Fusion. Reads schema annotations (@fusion.hide, @fusion.describe, @fusion.tenantKey) and emits hardened Presenters and ToolBuilders with field-level security, tenant isolation, and OOM protection.
Downloads
2,019
Maintainers
Readme
A compile-time Prisma Generator that reads
schema.prismaannotations and emits hardened MCP Fusion Presenters and ToolBuilders — with field-level security, tenant isolation, and OOM protection baked into the generated code.
Quick Start
generator mcp {
provider = "vinkius-prisma-gen"
output = "../src/tools/database"
}
model User {
id String @id @default(uuid())
email String @unique
passwordHash String /// @fusion.hide
stripeToken String /// @fusion.hide
creditScore Int /// @fusion.describe("Score 0-1000. Above 700 is PREMIUM.")
tenantId String /// @fusion.tenantKey
}npx prisma generate
# → src/tools/database/userPresenter.ts
# → src/tools/database/userTools.ts
# → src/tools/database/index.tsFeatures
| Feature | Description |
|---------|-------------|
| Egress Firewall | @fusion.hide physically excludes columns from the generated Zod response schema — SOC2 at compile time |
| Semantic Descriptions | @fusion.describe("...") injects domain semantics into generated Zod fields |
| Tenant Isolation | @fusion.tenantKey injects tenant filters into every query's WHERE clause |
| OOM Guard | Pagination enforced with take (capped at 50) and skip — unbounded queries are structurally impossible |
| Inversion of Control | Generates ToolBuilder + Presenter files, not a server. You wire them in |
Schema Annotations
| Annotation | Effect |
|---|---|
| /// @fusion.hide | Excludes the field from the generated Zod response schema |
| /// @fusion.describe("...") | Adds .describe() to the Zod field — LLM reads this as a business rule |
| /// @fusion.tenantKey | Injects the field into every query's WHERE clause from ctx |
Installation
npm install @vinkius-core/mcp-fusion-prisma-gen @vinkius-core/mcp-fusion zodPeer Dependencies
| Package | Version |
|---------|---------|
| @vinkius-core/mcp-fusion | ^2.0.0 |
| zod | ^3.25.1 \|\| ^4.0.0 |
| prisma | ^6.0.0 |
Requirements
- Node.js ≥ 18.0.0
- MCP Fusion ≥ 2.0.0 (peer dependency)
- Prisma ≥ 6.0.0
