Import and Export with MCP

With version 3, import and export run through the connected app's own import pipeline and exporters, so MCP output matches what the app produces. Results are saved as files inside --project-dir, and nothing is downloaded in the browser.

Export

Use export with a format, optional settings and an optional filename:

FormatformatNotes
PNG, JPG, SVGpng, jpg, svgOne frame. Shaders are included.
Image sequenceimage_sequenceOne image per frame.
MP4, WebMmp4, webmDepends on the browser's codecs. Verified in Chromium.
HTML playerhtmlAlways includes playback controls and loops.
Plain text, ANSItext, ansi
JSONjsonSparse: lists only non-empty cells.
React, Inkreact, inkComponents for the web and for terminal apps.
OpenTUIopentuiTypeScript/TSX. Set the name with componentName.
Bubble TeabubbleteaGo, using the type name Model.
Native projectsessionAn .asciimtn file that the app or app_load_project can open.

There is no GIF export. Use WebM, MP4 or an image sequence.

  • get_catalog with family: "export_formats" lists every format's settings and defaults. Settings a format can't honor return an error instead of being silently dropped.
  • Animated formats accept settings.frameRange: "all", or { "start": 12, "end": 35 } in inclusive timeline frames, where end: -1 means the last frame. The result reports the exported range.
  • The result is an artifact with an id and a filePath inside --project-dir. Open the file directly, or page through it with read_artifact. See Large results and artifacts.
  • Palettes export separately with export_palette.

The compatibility exporters with 2.x names, such as export_html and export_video, still work and use the same app exporters when connected.

Import

SourceToolNotes
Image or videoimport_mediaBase64 data plus a mimeType, converted by the app's import pipeline.
Plain textimport_textPlaces text at x, y with an optional style. keepSpaces and clearFirst control blanks.
Trace overlayset_image_traceShows an image behind the canvas as a drawing guide, with opacity, position and scale. It doesn't change cells.
Paletteimport_paletteColor or character palettes.
Projectapp_load_projectA native session object, loaded through the app's importer. Saved .asciimtn files are JSON.

import_media modes

modeResult
new_layer (default)A new layer with its own content frames
replaceReplaces the cells of the target content frame
overlayImages only. Writes non-empty converted cells and leaves the rest of the artwork untouched. Video overlay is rejected.
  • width and height set the converted size in cells.
  • For video, the video object sets the sampling window: startTime and duration in seconds, frameRate in fps, and maxFrames. Omit it to import every source frame. matchFrameRate: true applies the sampled rate to the project.
  • Conversion settings must use the keys listed by get_catalog with family: "tools" (importSettings). Unknown keys are rejected rather than ignored.

The compatibility import_image tool also uses the app pipeline when connected. It overlays non-empty cells and preserves existing art, keeps the 2.x dark-to-bright character order, and rejects options the app can't represent, such as exact source-color backgrounds and brightness dithering.

Example

text
Using ascii-motion, export the whole animation:
- HTML to intro.html
- React as intro-component
- WebM of timeline frames 0–47
- a native session copy
Then list the file paths you wrote.