DocDealer — Turn typed templates into finished Word documents — through our editor, a REST API, or an MCP agent.

    One schema, three surfaces. Anything that can read it produces a valid DOCX — including AI agents.

    Typed templates
    Zero hallucinations

    One engine. Three front doors.

    The same sealed .docx — whether a person, your code, or an AI fills it in.

    Auto-cycling
    docdealer.app
    Poder generalNotarial template
    Poder type
    Poder general
    Date
    15/01/2025
    Notario
    Salvador Farrés Ripoll
    Comparecientes
    María López Sáez
    Jorge Ibáñez Ruiz
    Ana Torres Vidal
    + Add appearer
    DNI.pdf

    AI filled grantor.name and grantor.dni from the DNI.

    Shared engine
    Validate
    Generate sections
    Export

    Protocolo 2025/1847

    PODER GENERAL DE REPRESENTACIÓN

    En Barcelona, a quince de enero de dos mil veinticinco.

    Ante mí, SALVADOR FARRÉS RIPOLL, Notario del Ilustre Colegio de Cataluña.

    COMPARECE:

    AI generated

    INTERVIENE:

    AI generated

    OTORGA:

    AI generated

    documento.docx

    Formatted, validated, official.

    In production atNotaría FarrésDrafting Spanish notarial deeds — poderes, constituciones, compraventas — from typed templates with strict validation.
    In 30 seconds

    DocDealer is an AI Word document generator built on typed templates, an MCP server and a REST API.

    You define a template (fields, types, validation rules, conditional logic) once. Then anything that knows the schema — a person, a backend service, or an AI agent — produces a validated DOCX or PDF document through the same surface.

    • ·What it is: A schema-bound document generator. Templates declare the shape of the output; the runtime enforces it.
    • ·How you build with it: Create typed templates with required / regex / enum / min-max rules and conditional sections.
    • ·How you call it: Web UI, REST API, MCP server (Model Context Protocol) for AI agents, or autonomous workflows triggered by email or webhook.
    • ·Why it is cheap: A fraction of the cost of an agent loop — one scoped AI call per section instead of 30–100 tool calls.
    • ·Default model: google/gemini-2.5-flash. Bring your own model (Anthropic, OpenAI, Vercel AI Gateway) any time.
    Three ways to interact

    Every template runs on three surfaces — pick the one that fits.

    Why not just an agent?

    Cheaper and faster than a raw agent loop.

    A general-purpose agent re-reads your instructions and re-derives the document structure on every run. DocDealer encodes that structure once, in the template — so each document is a short, grounded, validated generation instead of a long, expensive reasoning loop.

    Structured, not improvised

    Fields, sections and rules are fixed in the template; the model only fills in grounded content.

    Predictable cost

    No open-ended tool-calling loop — one bounded generation per section.

    Validated output

    Every value traces back to your form data or attachments. Zero hallucinations.

    Templates

    Typed templates. Strict rules. Predictable output.

    A template is a schema with fields, validation rules and conditional logic. Once defined, anything that knows the schema — UI, API, or AI agent — can produce a valid document.

    • Field types

      Text, number, date, enum, file, repeating objects. Each field has a type the runtime understands.

    • Validation rules

      Required, min/max, regex, allowed values. Bad data is rejected at the boundary, not 200 lines later.

    • Conditional logic

      Fields and sections appear, hide, or become required based on other answers — defined declaratively in the template.

    • Attachment intelligence

      Mark a file field as analyzable and AI extracts structured data from PDFs and images into the form for you.

    • Versioning & changelog

      Every template change creates a new version with a tracked changelog. Old documents stay pinned to the version they were created with.

    poder-general.template.json
    v3 · stable
    grantor.nametext
    requiredmin: 2
    grantor.dnitext
    requiredregex: ^\d{8}[A-Z]$
    power_typeenum
    GeneralEspecíficoPleitos
    notary_datedate
    requiredmax: today
    attorneys[]object[]
    min: 1visible when: power_type ≠ Pleitos
    dni_documentfile
    mime: pdf | jpganalyze: → grantor.*
    What the engine does

    Schemas in, valid documents out

    Every field has a type and rules. The same schema drives the editor, the validator and the AI — so anything generated matches the template, and what doesn't is flagged at the source.

    Form generated from schema

    The template defines the UI. Sections, field order and conditional visibility are computed from the same source the API consumes.

    AI fills the form, not the prose

    The model writes structured values into typed fields — under the rules in the template. Hallucinations have nowhere to land.

    DOCX & PDF, formatted

    Export in Word with your custom paragraph styles, page setup and headers, or rendered to PDF in one call.

    Validation as a guarantee

    Required fields, regex constraints, allowed values — checked the same way whether a human or an agent built the document.

    terminal
    $ npx @docdealer/mcp-server
    ⚡ DocDealer MCP Server v2.1
    Listening on stdio
    Tools registered:
    ├ create_document list_templates
    └ fill_form export_document
    ✓ Template: Poder General
    ✓ Form: 12 fields populated
    ✓ Document valid — 0 hallucinations_
    MCP

    Native protocol for
    AI agents.

    Expose every template through the Model Context Protocol. Claude, Cursor, your own orchestrator — anything MCP-compatible discovers your templates, reads their schemas and creates documents through tool calls.

    Discoverable templates

    Tools list every template the org has, with their schemas — so the agent picks one and knows what to fill.

    Typed tool calls

    create_document, update_form, generate_section, validate_document, export_document — strongly-typed arguments.

    Returns the artifact

    The DOCX or PDF comes back as a base64 payload the agent can hand back to the user or post to S3.

    Bearer-token auth

    API keys authenticate the MCP session. Per-template allowlists scope what an agent can touch.

    REST API

    Programmatic document creation

    Every UI action is a REST call. Authenticate with a bearer token, POST a template id and a payload, get back a validated document. Same surface your MCP server uses.

    Per-org bearer tokens

    Issue, rename and revoke API keys scoped to an organization. Shown plaintext once on creation.

    Per-template allowlist

    Restrict a key to a subset of templates so a backend service can only touch what it should.

    Scoped permissions

    Fine-grained scopes — read, write, export — granted per key. Least-privilege by default.

    Rotation friendly

    Multiple active keys per org so you can rotate without downtime.

    Real-time Collaboration

    Edit together, in real time

    Multiple users can fill forms and review documents simultaneously thanks to Yjs CRDTs and Hocuspocus over WebSocket, with Redis-backed horizontal scaling.

    RGPD · LOPDGDD

    Built for EU data protection — and Spanish notarial scrutiny.

    Concrete claims grounded in the deployed infrastructure. Customer is the data controller; DocDealer acts as data processor under Article 28 GDPR and signs a DPA on request.

    EU data residency

    All persistent data lives on AWS eu-west-1 (Ireland). Nothing at rest leaves the EU — Postgres, S3, Redis are all in-region.

    Encryption at rest and in transit

    S3 SSE-AES256 for documents and attachments; RDS-managed encryption for Postgres; TLS 1.2+ end-to-end.

    Per-organization tenant isolation

    Data is scoped per organization at the service layer. Bearer tokens are org-scoped with optional per-template allowlists.

    Sub-processors, disclosed

    AWS (infrastructure), Vercel AI Gateway → Google Gemini (zero retention of prompt content), Google Maps (geocoding, query strings not persisted), WorkOS (auth + audit logs).

    Right to erasure

    Deleting an organization removes its documents, attachments, AI analyses and audit trail. Individual users can be removed without affecting org content.

    DPA on request

    Article 28 Data Processing Agreement available before signing. We are the processor; you remain the controller.

    LOPDGDD = Ley Orgánica 3/2018 de Protección de Datos Personales y garantía de los derechos digitales — the Spanish national implementation that complements GDPR. AEPD is the competent supervisory authority. For full legal text contact product@thedocdealer.com.

    Talk to us

    Want to see if DocDealer fits?

    Tell us about you and what you're trying to draft. We read every message; the team replies within one working day.

    We use your details only to reply. No newsletter, no sharing with third parties.

    Build templates. Ship documents.

    Define the schema once. Generate documents from the UI, the API, an MCP agent, or all three.