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:
| Format | format | Notes |
|---|---|---|
| PNG, JPG, SVG | png, jpg, svg | One frame. Shaders are included. |
| Image sequence | image_sequence | One image per frame. |
| MP4, WebM | mp4, webm | Depends on the browser's codecs. Verified in Chromium. |
| HTML player | html | Always includes playback controls and loops. |
| Plain text, ANSI | text, ansi | |
| JSON | json | Sparse: lists only non-empty cells. |
| React, Ink | react, ink | Components for the web and for terminal apps. |
| OpenTUI | opentui | TypeScript/TSX. Set the name with componentName. |
| Bubble Tea | bubbletea | Go, using the type name Model. |
| Native project | session | An .asciimtn file that the app or app_load_project can open. |
There is no GIF export. Use WebM, MP4 or an image sequence.
get_catalogwithfamily: "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, whereend: -1means the last frame. The result reports the exported range. - The result is an artifact with an
idand afilePathinside--project-dir. Open the file directly, or page through it withread_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
| Source | Tool | Notes |
|---|---|---|
| Image or video | import_media | Base64 data plus a mimeType, converted by the app's import pipeline. |
| Plain text | import_text | Places text at x, y with an optional style. keepSpaces and clearFirst control blanks. |
| Trace overlay | set_image_trace | Shows an image behind the canvas as a drawing guide, with opacity, position and scale. It doesn't change cells. |
| Palette | import_palette | Color or character palettes. |
| Project | app_load_project | A native session object, loaded through the app's importer. Saved .asciimtn files are JSON. |
import_media modes
mode | Result |
|---|---|
new_layer (default) | A new layer with its own content frames |
replace | Replaces the cells of the target content frame |
overlay | Images only. Writes non-empty converted cells and leaves the rest of the artwork untouched. Video overlay is rejected. |
widthandheightset the converted size in cells.- For video, the
videoobject sets the sampling window:startTimeanddurationin seconds,frameRatein fps, andmaxFrames. Omit it to import every source frame.matchFrameRate: trueapplies the sampled rate to the project. - Conversion
settingsmust use the keys listed byget_catalogwithfamily: "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
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.Related
- Export and Import in the app
- Tool reference: Export and Import