text2animate

text2animate

Turns plain-language descriptions into animated SVGs with a live preview and conversational editing.

Category
访问服务器

README

<div align="center">

text2animate

Turn plain-language descriptions into animated SVGs — and refine them in a live chat, right from your editor.

An MCP server that lets Claude (or any MCP client) compose animated SVGs from text, preview them in a clean floating UI, and iterate on them conversationally.

text2animate preview

</div>


Why

LLMs are good at writing SVG, but "make me an animation" usually produces something stiff and templated. text2animate fixes that two ways:

  1. It bakes in motion-design best practices — layered scenes, natural easing, anticipation/overshoot, seamless loops, restrained palettes — and hands them to the model before it draws anything.
  2. It closes the feedback loop. The result renders instantly in a local preview, and a chat box under the animation lets you say "make the goose have webbed feet and add parallax mountains" — the change applies live, through your own Claude Code session.

No API key, no separate billing — edits run on the model you're already using.

How it works

                    create_animation
   ┌──────────┐   ──────────────────►   ┌──────────────────┐   ──►  Preview UI
   │  Claude  │                          │  text2animate    │        (floating,
   │ (MCP host)│  ◄──────────────────    │  MCP server      │   ◄──   live over SSE)
   └──────────┘    await_edit_request    └──────────────────┘
        ▲          (long-poll for your         │  embeds best practices
        │           typed changes)             │  validates + stores SVG
        └─ apply_patch / apply_edit ───────────┘  serves the local UI

The model is the renderer's brain. Guided by the embedded best practices, it writes a self-contained <svg> with @keyframes/SMIL animation. The server validates it, stores it, and serves a preview. When you type a change, the server queues it and the in-session agent picks it up, edits the SVG, and the preview refreshes.

Install

Option A — Claude Code plugin (recommended)

No clone, no build. In Claude Code:

/plugin marketplace add tom-pettit/text2animate
/plugin install text2animate@tom-pettit

That registers the MCP server (it runs a prebuilt, dependency-free bundle), so just ask:

"Use text2animate to animate a goose waddling through the grass, playful style."

The preview opens automatically at http://127.0.0.1:4321. The CLI equivalent:

claude plugin marketplace add tom-pettit/text2animate
claude plugin install text2animate@tom-pettit

Option B — from source (for development)

git clone https://github.com/tom-pettit/text2animate.git
cd text2animate
npm install

npm install builds the server and auto-registers it in the surrounding workspace's .mcp.json (merging — it never clobbers other servers). Restart Claude Code to pick it up.

[!TIP] Registering somewhere specific, or not at all:

npm run register -- ~/.mcp.json   # a specific config file
npm run unregister                # remove the entry
T2A_NO_AUTO_REGISTER=1 npm install # skip auto-registration

Resolution order: explicit path → T2A_MCP_TARGET env → <repo-parent>/.mcp.json.

Styling the look

Tell it the aesthetic and the server feeds concrete art direction (palette, shape language, motion feel, typography) to the model. Use a preset or any freeform phrase:

"Animate a loading spinner, minimalistic but modern."

Built-in presets: minimal-modern, playful, neon-cyber, flat-corporate, hand-drawn, retro-80s. The chosen style is recorded and shown in the preview's properties panel.

Live editing (the chat box)

Under the animation is a ChatGPT-style box. Type a change and it round-trips through your Claude Code session:

  1. The box queues your request on the server.
  2. The agent's watch loop (await_edit_request) is long-polling — it unblocks with your text and the current SVG.
  3. The agent applies the change; the preview updates live.

Fast iteration. Small tweaks (color, size, timing, text, easing) go through apply_patch — the agent sends a tiny find/replace instead of re-emitting the whole document, so a recolor is ~10 tokens rather than a full regeneration. Structural changes fall back to apply_edit. A bad patch is rejected wholesale (nothing changes) so the request stays open to retry.

To turn it on, tell Claude once: "watch the preview for edits" — it keeps calling await_edit_request. Pairs naturally with /loop, and /fast makes each turn snappier. The box shows a green dot when a watcher is connected, amber when it isn't.

Preview UI

A light, floating interface (no chrome docked to the edges):

  • Artboard — the animation in a 16:9 frame, centered on a warm canvas.
  • Animations panel (left) — everything created this session.
  • Properties panel (right) — style, duration, loop, and Export SVG.
  • Playback (bottom-right) — play/pause (Space) and restart (R); pausing freezes both CSS @keyframes and SMIL timelines.
  • Chat dock (bottom) — the live-edit box plus the watcher status.

Tools, resources & prompts

Tool Purpose
get_best_practices The animation guidelines. Optional style adds concrete art direction.
list_styles List the built-in style presets.
create_animation Render a self-contained animated <svg> in the preview and open it.
list_animations List animations created this session.
await_edit_request Long-poll for a change typed into the preview's chat box.
apply_patch Fast edit: apply small find/replace tweaks in place.
apply_edit Apply a fully regenerated SVG in place.
open_preview Ensure the preview server is running and open it.

Also exposed: an animation-best-practices resource and an animate prompt.

Configuration

Variable Default Meaning
TEXT2ANIMATE_PORT 4321 Preferred preview port (walks upward if taken).
T2A_MCP_TARGET <repo-parent>/.mcp.json Where register writes the MCP entry.
T2A_NO_AUTO_REGISTER Set to skip auto-registration on npm install.

Development

npm run build      # compile TypeScript → dist/
npm run dev        # tsc --watch
npm run typecheck  # tsc --noEmit
npm test           # node:test suite (via tsx)
npm run serve      # run just the preview UI (no MCP stdio channel)

Stack: TypeScript + @modelcontextprotocol/sdk (stdio) for the MCP server, Express + Server-Sent Events for the preview. Animations are self-contained SVGs — no runtime dependencies in the browser.

src/
├─ index.ts          # entry: stdio transport + --web-only mode
├─ config.ts         # ports, timeouts, paths
├─ core/             # framework-free domain logic (unit-tested)
│  ├─ svg.ts         #   validate + patch helpers (pure)
│  ├─ store.ts       #   in-memory animation store
│  └─ edits.ts       #   edit-request queue + long-poll
├─ content/          # styles.ts, best-practices.ts (the guidance)
├─ web/server.ts     # Express preview server + SSE
└─ mcp/server.ts     # MCP tools, resources & prompts
public/              # the preview UI (vanilla HTML/CSS/JS)
test/                # node:test specs for core/
bundle/index.mjs     # prebuilt single-file server for the plugin (generated)
.claude-plugin/      # plugin.json + marketplace.json

The plugin ships a prebuilt bundle (npm run bundle, via esbuild) so it runs on node alone with no install step. CI fails if the committed bundle is stale, so run npm run bundle and commit it whenever src/ changes.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选