Skip to content

Sources Overview

Bridgent normalizes different shapes of "definitions you already have" into a single MCP tool surface. Pick the source that matches your codebase; the runtime (transport, CLI, hosts) is the same regardless.

Capability matrix

From ZodFrom OpenAPIFrom PrismaFrom DrizzleFrom tRPCFrom GraphQL
Statusshipped (@bridgent/core)shipped (@bridgent/source-openapi)shipped (@bridgent/source-prisma)shipped (@bridgent/source-drizzle)shipped (@bridgent/source-trpc)roadmap
Min codedefineTool per toolawait fromOpenApi({ spec })await fromPrisma({ client })await fromDrizzle({ db, tables })fromTrpc({ router })
Tools come fromeach defineTool calleach operation in the speceach model × 5 read methodseach table × findManyrouter proceduresresolver fields
Namingauthor-provided nameoperationId (slugified) or ${method}_${path}<namespace?><modelCamel>_<method><namespace?><table>_find_many<toolPrefix>_<procedure_path>TBD
Filteringnot applicableallow / allowOperations / denyOperations / pathFilter / respectExtensionsallow / modelFilter / allowTools / denyToolstableFilterprocedureFilterTBD
Authauthor-provided in runBearer or API keyreuse PrismaClient's datasource credsreuse Drizzle's db connectionapp-owned createContext
Read / Writeauthor-controlledread-only by default; opt-in via allow.mutatingread-only by default; audited writes require writes.allowToolsread-only findManyqueries by default; mutations require allow.tools

When to pick which

  • From Zod — you already have a function and want to expose exactly that, with the precise input shape you want the LLM to see. Smallest possible surface.
  • From OpenAPI — you have an HTTP API documented with a spec. Bridgent generates one tool per operation; you control which subset.
  • From Prisma — you want the LLM to read a database safely, with optional audited writes. Default is read-only with row caps, soft timeouts, and Bytes-field stripping.
  • From Drizzle — you want a lightweight read-only table surface over an existing Drizzle database.
  • From tRPC — you already model application operations as tRPC procedures and want to expose query procedures without rewriting schemas.

Roadmap

  • From GraphQL — operations and field-level resolvers as tools.

GraphQL is scoped for a later release; track progress in the GitHub repo.

Mixing sources

A single Bridgent server can stitch tools from multiple sources together:

ts
import { createStdioServer, defineTool } from '@bridgent/core'
import { fromOpenApi } from '@bridgent/source-openapi'
import { fromPrisma } from '@bridgent/source-prisma'
import { PrismaClient } from '@prisma/client'
import { z } from 'zod'

const client = new PrismaClient()

await createStdioServer({
  name: 'mixed',
  version: '0.0.1',
  tools: [
    ...await fromPrisma({ client, namespace: 'db_' }),
    ...await fromOpenApi({
      spec: 'https://api.example.com/openapi.json',
      namespace: 'api_',
    }),
    defineTool({
      name: 'echo',
      inputSchema: z.object({ msg: z.string() }),
      run: ({ msg }) => msg,
    }),
  ],
})

Use namespace on each generated batch to avoid name collisions; duplicates throw fail-fast at startup.

Released under the MIT License.