Skip to content

Connector

The Récit connector is the small public part of Récit: it validates a story written as JSON (its twin) against the published schema, and sends it to the Récit service, which renders it as a deck, a webtoon, a book in PDF or a film. The engine stays on the service; the connector carries only the schema and a client of the service's API.

An alpha, not on npm

The connector is in alpha, and it is not on npm. Its first archive is being prepared and will be handed out by the Récit team (see Getting the alpha). Once you have it, validate works offline; send and render wait for the render routes of the service, which are not online yet.

Getting the alpha

The alpha will ship as one archive, such as recit-connector-0.1.0-alpha.0.tgz (the number is not final), the way the other private packages of Récit ship. Nobody will download it from a registry: the Récit team will hand it to the people it is meant for. Once you have it, install it from the file, in a project or globally:

TerminalBash
npm install ./recit-connector-0.1.0-alpha.0.tgz # in a project: npx recit-connector … npm install --global ./recit-connector-0.1.0-alpha.0.tgz

The archive holds the connector alone. Its only dependencies are zod and the MCP SDK; no package of the engine comes with it.

What the alpha does not do yet:

  • Render on the service. send, render and the MCP tool render_story speak the contract of the service's render routes, which are not online yet; until they are, the alpha validates stories and renders none.
  • Update itself. A new alpha is a new archive, installed the same way over the old one.
  • Keep its interface. Until its first release, a command, an option or an export may change from one alpha to the next; the stability promise of 1.0 does not cover it.

What you need

  • A story twin, a .json file with kind: "story" (or a sidecar with kind: "sidecar"). The schema is published at https://recit.dev/schema/v1/story.json; an editor that reads $schema completes and checks it as you type.
  • To render: the address of the service (RECIT_API_URL) and a personal token of your account with the render:write scope (RECIT_API_TOKEN), created on your account page. Validation needs neither.

From a terminal

TerminalBash
recit-connector validate lorem.story.json recit-connector validate lorem.sidecar.json --sidecar

validate reads the file, checks it against the schema the connector carries, and prints each problem with its path in the document. It never reaches the network.

TerminalBash
export RECIT_API_URL=https://api.lorem.example export RECIT_API_TOKEN=rct_… recit-connector send lorem.story.json --to pptx # prints the render's id and status recit-connector render lorem.story.json --to pdf # waits, then prints the file's link

send and render validate the story first and send nothing when it is invalid. --to is the file to render, one of pdf, pptx or mp4; the format comes from the story itself, and each format renders to its own files only:

Story format--to
deckpdf, pptx
book, webtoonpdf
motion (a film)mp4
Exit statusMeaning
0valid, or the render was accepted (send) or succeeded (render)
1invalid story, refusal of the service, or a failed render
2usage error: unknown command, missing --to, no service set

From an agent

recit-connector-mcp is an MCP server over stdio. Add it to your MCP host (Claude Code, Claude Desktop or any other) with the two variables above; without them, only validation works.

JSONJSON
{ "mcpServers": { "recit": { "command": "recit-connector-mcp", "env": { "RECIT_API_URL": "https://api.lorem.example", "RECIT_API_TOKEN": "rct_…" } } } }
ToolWhat it does
validate_storychecks a twin or a sidecar against the schema, offline
render_storyvalidates a twin, then asks the service to render it to one output
get_renderreads the status of a render, and the link to its file once succeeded

An agent writes the story as JSON, calls validate_story until it is valid, then render_story, and follows the render with get_render until it has succeeded.

From TypeScript

TypeScriptTypeScript
import { createRecitClient, formatIssues, validateStory } from "@recit/connector"; const result = validateStory(story); if (!result.ok) { throw new Error(formatIssues(result.issues)); } const client = createRecitClient({ baseUrl, token }); const { id } = await client.render({ story, output: "pdf" }); const render = await client.waitForRender(id); console.log(render.url);

validateStory(document, "sidecar") checks a sidecar instead. A refusal of the service throws RecitApiError, with its HTTP status and the service's error code.

The service's contract

The connector speaks two routes of the service, with the token in Authorization: Bearer …:

RouteBody or answer
POST /v1/render/jobssends { output, story }; answers 202 { job }
GET /v1/render/jobs/:jobIdanswers { job }
a job{ id, format, output, status, error, bytes, downloadUrl }
a refusal{ error, issues? }: a code, and for a refused story the problems of its schema

status is one of queued, running, succeeded or failed. Once a job has succeeded, downloadUrl is a link to its file valid one hour (read the job again for a fresh one); the connector shows it as url. A failed job names its error (invalid_story, render_failed, timeout, output_too_large or storage_failed). Renders count against the quota of your account: past it, the service answers 429 render_quota_exceeded.

  • Glossary: story, twin, sidecar.
  • Stability: the connector is outside the 1.0 contract until its release.
  • Account: personal tokens.