Foldline
概览
作者提供的说明(英文原文)
Render HTML canvas animations to MP4 fast on a Mac, with 66 code-made film styles for agents.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i1 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新★ –
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 游戏、体育、美食与学习
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:1 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 需要你自己填写:
FOLDLINE_PYTHON,PLAYWRIGHT_CHROME
你需要
- npm已安装 Node.js(用于 npx 命令)
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"foldline": {
"command": "npx",
"args": [
"-y",
"foldline-mcp"
],
"env": {
"FOLDLINE_PYTHON": "your-value",
"PLAYWRIGHT_CHROME": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add foldline --env FOLDLINE_PYTHON=your-value --env PLAYWRIGHT_CHROME=your-value -- npx -y foldline-mcp运行前请先填写空着的值。
或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"foldline": {
"command": "npx",
"args": [
"-y",
"foldline-mcp"
],
"env": {
"FOLDLINE_PYTHON": "your-value",
"PLAYWRIGHT_CHROME": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"foldline": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"foldline-mcp"
],
"env": {
"FOLDLINE_PYTHON": "your-value",
"PLAYWRIGHT_CHROME": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
需要你填写的值
FOLDLINE_PYTHONenvPython for the voice, music and sheet tools (default: the library .venv, then ~/lemo-opuscar/.venv)PLAYWRIGHT_CHROMEenvA chrome-headless-shell to use instead of the one Playwright installs
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月9日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 alireza12t 验证,该账户拥有此仓库
- … 尚未检查
仍在维护
我们还没有从 GitHub 读取这个仓库
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“游戏、体育、美食与学习”中的其他服务器比较i
- 星标数多于此分类中其他 1317 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 1317 个服务器的 100% 更新
- 基础检查结果等于或优于此分类中其他 1317 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Foldline 安全吗?
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于–,最新版本(1.0.0)于今天进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:diglabo(漢字・算数の学習), Foodbe, Gameye
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Foldline
Render HTML canvas animations to MP4, fast, on a Mac.
With the full lemo-opuscar library of 66 film styles made in code.
Made for Unfold, an animated "What if" channel in a paper pop-up book style.
https://github.com/user-attachments/assets/05724852-c9ae-4762-90a9-634315b2b016
▶ Watch on YouTube · download the MP4 · read the deep dive on Medium
Made with Foldline itself: every frame drawn in code, a local text-to-speech voice, music synthesised in code. It renders in 34 s. Source in examples/foldline-explainer .
What it is
Foldline turns a web page that draws a film in code into an H.264 MP4. You write an HTML page with a and a render(t) function. Foldline opens it in headless Chrome, draws every frame, and encodes the video inside the page with WebCodecs on the Mac's hardware encoder, so frames never leave the GPU. On an M1 Pro, an 8.4-minute 1080p 60 fps video renders in 161 s instead of 426 s (see Results). It's open source and free for non-commercial use, and it works well with coding agents like Claude Code.
Foldline is a project by Alireza Toghiani, built for the Unfold channel. It isn't a GitHub fork. It ships the full lemo-opuscar library by LemoLab:
- all 66 film styles in
styles/, each with a style prompt and a demo film made in code - the toolkit in
core/(render, voice, music, mix) - the guides
DIRECTOR.md,TECHNIQUE.mdandMY-STYLES.md - lemo's Claude Code plugin in
plugin/
lemo's original README is kept as LEMO-README.md. It has the style list, how to make a style your own, and the full requirements.
What Foldline adds is a faster video renderer, core/render/video.mjs, and an MCP server for coding agents, core/mcp/server.mjs.
What's new vs lemo-opuscar
- The page encodes the video itself. By default
video.mjsencodes H.264 inside the page with WebCodecs, on the Mac's hardware encoder. Each frame goes from the canvas to the encoder on the GPU. No screenshot, no JPEG, no ffmpeg decode. - It works when the film draws into one visible ` ` of the render size. 35 of the 66 lemo demos do, and Unfold's videos do.
- Automatic fallback. If the page doesn't fit that, or the browser has no hardware H.264 encoder, it falls back to the screenshot path with the Mac hardware encoder (VideoToolbox). If that isn't available either, it uses x264.
- `FOLDLINE_ENC=auto|wc|vt|x264` picks the encoder.
autois the default.x264is lemo's original path.LEMO_ENCstill works. - `FOLDLINE_MBPS` sets the bitrate for the WebCodecs path, in Mbit/s (default 20).
- New flag `--audio ` muxes a sound file in (AAC 192k). It runs as a second ffmpeg pass from the finished mp4. The renderer refuses to finish if the file is missing its video or audio stream.
- Output is standard bt709 limited-range H.264 mp4.
- MCP server in
core/mcp/: agents get the styles, guides, renders and sound tools as MCP tools with short results. See MCP server.
Everything else in the library works the way lemo describes it.
How it compares
Foldline is a renderer plus a style library, not a framework or a timeline editor. You write the page, Foldline renders it.
| Foldline | lemo-opuscar (original) | Remotion | Motion Canvas | HyperFrames | |
|---|---|---|---|---|---|
| You write | an HTML page with render(t) | an HTML page with render(t) | React components | TypeScript scenes | HTML, CSS and seekable animations (GSAP, Lottie, three.js and others) |
| How frames are made | Chrome draws the canvas, and the page hands each frame to the encoder (WebCodecs). Frames stay on the GPU. | Chrome draws the page, and each frame is taken as a JPEG screenshot | Chrome draws each frame, and FFmpeg encodes them | the browser saves each frame as an image file (PNG, JPEG or WebP) | headless Chrome (Puppeteer) seeks each frame, and FFmpeg encodes them |
| Video encoder by default | Mac hardware H.264, falling back to VideoToolbox, then x264 | x264 (software) | FFmpeg, H.264. Hardware encoding (VideoToolbox on Mac, NVENC) is available but off by default. | none built in: you turn the images into a video yourself, for example with ffmpeg | FFmpeg |
| Ready-made looks | 66 film styles, each with a demo film (lemo's library) | the same 66 film styles | starter templates | none in the core | about 450 blocks and components, plus design templates |
| Code licence | PolyForm Noncommercial: free for non-commercial use, commercial licence on request (lemo's original code stays MIT) | MIT | Remotion License: free for individuals, non-profits and companies of up to 3 employees, paid above that | MIT | Apache-2.0 |
| Speed, measured here | 2.5x faster than lemo on its Pixel RPG demo, 2.6x faster on an 8.4 min film | the baseline | not measured here | not measured here | not measured here |
Sources, checked Nov 6 2026: Remotion's encoding and hardware acceleration docs, Motion Canvas's rendering docs and the HyperFrames README. Projects change, so check their docs for the latest. Foldline's speed numbers are in Results.
Install
You need:
- macOS on Apple Silicon (recommended). The fast path needs Chrome's hardware H.264 encoder. Other systems fall back to the screenshot path.
- Node 20+
- ffmpeg 7+
- Python 3.11+, for the voice and music tools
git clone https://github.com/alireza12t/foldline.git
cd foldline npm ci node node_modules/playwright-core/cli.js install chromium-headless-shell
The last line installs the headless Chrome the renderer uses, the same way lemo's setup script does it. To use a different Chrome or headless-shell executable, set PLAYWRIGHT_CHROME=/path/to/chrome-headless-shell.
For the Python tools (sound effects, mix, subtitles, voice), lemo's setup script makes the .venv in tiers. Run it from the repo folder:
| Command | Adds |
|---|---|
sh plugin/skills/lemo-opuscar/scripts/setup.sh deps | npm packages, headless browser, Python .venv core tier |
sh plugin/skills/lemo-opuscar/scripts/setup.sh deps voice | Kokoro, edge-tts, faster-whisper, and the Kokoro model |
sh plugin/skills/lemo-opuscar/scripts/setup.sh deps music | numba, for pluck.py |
Optional big assets
These aren't in git. Fetch them only when a film needs them. tools/fetch.sh downloads them from lemo-opuscar's assets release on GitHub.
| Command | What it gets | Size |
|---|---|---|
sh tools/fetch.sh voice | Kokoro TTS model (English, offline) into core/tts/ | about 354 MB |
sh tools/fetch.sh hdri | Poly Haven HDRIs for the 3D styles into core/assets/polyhaven/ | 12 MB |
sh tools/fetch.sh instruments | one sample library (freepats, karoryfer, salamander, vcsl, vsco2ce, or all) | 70 to 400 MB each |
Full sizes and details are in TECHNIQUE.md §1.
Usage
Run every command from the repo folder.
Render a library demo
node core/render/video.mjs styles/rubber-hose/demo --fps 24 --out out/rubber-hose.mp4
Some demos need a one-time setup in their own folder first:
npm ciif the demo has apackage.jsonnode fetch_fonts.mjsif it has one
Render your own page
node core/render/video.mjs my-film --size 1080x1920 --fps 60 --audio my-film/mix.wav --out my-film/out/video.mp4
my-film is any folder with an index.html that follows the page contract below.
Stills
node core/render/still.mjs <dir> 3 20 --out <dir>
This writes review JPEGs at 3 s and 20 s. See core/README.md for --range and --prefix.
Flags
| Flag | Default | Meaning |
|---|---|---|
--fps | 24 | frames per second |
--size WxH | 1920x1080 | render size, even numbers |
--workers | 3 | parallel browsers; up to 6 for a single render |
--out | /out/video.mp4 | output file; each parallel render needs its own |
--q 'k=v&…' | none | reaches the page as location.search |
--audio | none | mux a sound file in (AAC 192k); new in Foldline |
Environment variables
| Variable | Default | Meaning |
|---|---|---|
FOLDLINE_ENC | auto | auto (WebCodecs, else VideoToolbox, else x264), wc, vt, or x264 (lemo's original path). LEMO_ENC still works |
FOLDLINE_MBPS | 20 | bitrate in Mbit/s for the WebCodecs path |
LEMO_VTQ | 72 | quality for the VideoToolbox screenshot path |
The rest of lemo's variables (PLAYWRIGHT_CHROME, LEMO_ANGLE, RENDER_SLOTS and more) are listed in core/README.md.
The page contract
This comes from lemo. Each film is a folder with an index.html that sets:
window.DUR = 54.2; // film length in seconds
window.render = (t) => { ... }; // draw the frame at t seconds; may be async window.READY = true; // set once fonts and assets are loaded
For the fast path, draw the whole film into one visible of the render size. Any other page still renders, through the screenshot path.
Using it with a coding agent
lemo's plugin and skill are for Claude Code. How to install them, and how to ask for a film, is in LEMO-README.md, How to use. The plugin installs lemo's own library into ~/lemo-opuscar. lemo's setup script uses the clone you're standing in when it's a library, so to work with Foldline's renderer, start your agent inside this folder (lemo's "clone the repo" option).
MCP server
Foldline has an MCP server, so Claude Code, Codex, Cursor and other agents can call its tools directly instead of reading the guides and running commands by hand. It's on npm as foldline-mcp, and it's listed in the MCP Registry as io.github.alireza12t/foldline.
You need Node 20+, ffmpeg (brew install ffmpeg) and Chrome's headless shell, installed once with npx playwright-core@1.63.0 install chromium-headless-shell. The server tells you if one is missing.
Claude Code, as a plugin:
claude plugin install foldline --marketplace alireza12t/foldline
or as a plain MCP server:
claude mcp add --scope user foldline -- npx -y foldline-mcp
Codex, in ~/.codex/config.toml:
[mcp_servers.foldline]
command = "npx" args = ["-y", "foldline-mcp"]
Cursor (~/.cursor/mcp.json), Claude Desktop and most other clients:
{ "mcpServers": { "foldline": { "command": "npx", "args": ["-y", "foldline-mcp"] } } }
VS Code (.vscode/mcp.json):
{ "servers": { "foldline": { "command": "npx", "args": ["-y", "foldline-mcp"] } } }
To use your own clone instead of npm, point the command at it: `node /path/to/foldline/core/mcp/server.mj
只显示了开头部分;其余内容请在仓库中阅读