motionworks
Enables designers to refine motion effects by direct manipulation in a running app, sending precise changesets to AI coding agents via MCP for source updates.
README
MotionWorks
A direct-manipulation motion design layer for projects built with AI coding agents.
MotionWorks runs over your local app so you can select a real element, tune motion by feel, replay it, compare against the original, and apply the result. Adjustable values live in CSS custom properties, so the browser can preview them immediately and the local daemon can write precise changes back to source.
Describe to create. Manipulate to refine.
Quick start
Install the single package and initialize the project:
npm install -D motionworks
npx motionworks init
init adds .motionworks/ to .gitignore, removes a stale MotionWorks MCP entry if one exists, and writes a generated MOTIONWORKS.md guide plus a short reference stanza for Claude Code and Codex. In React projects it also confirms the package install when needed.
Start your app and the MotionWorks daemon in separate terminals:
npm run dev
npx motionworks
For React, follow the generated guide to mount MotionWorksProvider once in a development-only, independent React root. For any other page, load the standalone overlay before </body>:
<script src="http://127.0.0.1:52340/motionworks.js"></script>
MotionWorks can also serve a static directory and inject the overlay automatically:
npx motionworks serve .
The CSS contract
Each adjustable value has one canonical declaration in a real stylesheet on the registered element's rule:
.card {
--mw-radius: 120px;
--mw-response: 0.18;
}
React effects register only the schema. The hook reads baselines from CSS; effect code consumes them with readParams and responds to motionworks:change through onParamsChange:
import { useEffect, useRef } from 'react';
import { onParamsChange, readParams, useMotionWorks } from 'motionworks/react';
const schema = {
name: 'Magnetic card',
params: {
radius: { type: 'spatial-radius', label: 'Radius', unit: 'px' },
response: { type: 'temporal-response', label: 'Response' },
},
} as const;
function MagneticCard() {
const ref = useRef<HTMLDivElement>(null);
useMotionWorks(ref, schema);
useEffect(() => {
const el = ref.current;
if (!el) return;
const effect = createMagneticEffect(el, readParams(el, schema.params));
const sync = () => effect.update(readParams(el, schema.params));
const stop = onParamsChange(el, sync);
return () => {
stop();
effect.destroy();
};
}, []);
return <div ref={ref} className="card" />;
}
Plain HTML can register the same schema with data-motionworks and use window.MotionWorks.readParams / window.MotionWorks.onParamsChange.
What happens on Apply
Apply is durable before it is automatic:
- The overlay appends an entry to
.motionworks/changes.json. - The daemon edits the unique matching CSS declaration directly.
- If the declaration is ambiguous, the daemon runs Claude or Codex when available.
- If no agent can complete it, the entry remains pending for Copy prompt and
npx motionworks changes.
The agent changes exactly the listed declarations and acknowledges a manual writeback with npx motionworks ack <id>. npx motionworks status reports the currently selected effect when a designer refers to “this one.”
Package exports
The repository has one publishable package, motionworks:
| Export | Purpose |
|---|---|
motionworks |
Browser-safe schema and journal types |
motionworks/react |
useMotionWorks, MotionWorksProvider, and browser helpers |
motionworks/browser |
Framework-free CSS binding and event helpers, including DEFAULT_VAR_PREFIX |
motionworks/node |
Programmatic daemon, journal, setup, configuration, and static-serving APIs |
motionworks/motionworks.global.js |
Standalone browser bundle |
motionworks CLI |
Daemon, static serving, journal commands, setup, and status |
React and ReactDOM are optional peers; non-React pages use the standalone bundle.
CLI
npx motionworks Start the local daemon
npx motionworks serve <dir> Serve a static site with the overlay
npx motionworks changes [--json|--brief] Show pending journal entries
npx motionworks ack <id>|--all Acknowledge manual writebacks
npx motionworks status Show daemon and current selection
npx motionworks revert <id> Revert an applied entry
npx motionworks init Set up the project and agent guide
Automatic agent execution is enabled when claude or codex is found. Use --no-agent for manual handoff or --agent=claude|codex|off to choose explicitly. The daemon binds to 127.0.0.1:52340; MOTIONWORKS_PORT or --port changes the port.
Development
The repository is an npm workspace with one package under packages/motionworks. It builds with tsup and tests with Vitest.
npm install
npm run build
npm run typecheck
npm test
The completed 0.5.0 bridge rebuild is recorded in docs/plans/bridge-rebuild.md; the maintained architecture and contracts live in docs/.
License
MIT © John Kim
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。