| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Invoke | /marionette:setup |
| Category | cocode-flutter |
| Complexity | simple |
/marionette setup โ Marionette ์ฒ์ ํ ๋ฒ ์ค์นํ๊ธฐ#
ํ๋ง๋๋ก#
์คํ ์ค์ธ Flutter ์ฑ์ Claude๊ฐ ์ง์ "๋ณด๊ณ ๋ง์ง ์ ์๊ฒ" ์ฐ๊ฒฐํด ์ฃผ๋ ์ต์ด ์ค์น ์์ ์ ๋๋ค. ๋ฆฌ๋ชจ์ปจ(Marionette)์ ์ฒ์ ํ ๋ฒ ํ์ด๋งํด ๋๋ฉด, ์ดํ๋ถํฐ Claude๊ฐ ๊ทธ ๋ฆฌ๋ชจ์ปจ์ผ๋ก ์ฑ ํ๋ฉด์ ๋ณด๊ณ ๋ฒํผ์ ๋๋ฅผ ์ ์๊ฒ ๋ฉ๋๋ค.
๋๊ฐยท์ธ์ ์ฐ๋์#
- Marionette๋ฅผ ์ฒ์ ์ค์นํ ๋ (์ด ์ฑ์์ ํ ๋ฒ๋ง ํ๋ฉด ๋จ)
marionette_mcp๋ฒ์ ์ ์ฌ๋ ธ์ ๋, ๋ค์ ์คํํด ์ต์ ์ํ๋ก ๋ง์ถ๊ณ ์ถ์ ๋- CoUI ๋์์ธ ์์(๋ฒํผ, ์ ๋ ฅ์ฐฝ ๋ฑ)๊ฐ ์๋ก ์ถ๊ฐ๋ผ์ ์ฐ๊ฒฐ ์ค์ ์ ๊ฐฑ์ ํด์ผ ํ ๋
๐ ๋ช ๋ฒ์ ๋ค์ ์คํํด๋ ์์ ํฉ๋๋ค(idempotent โ ๊ฐ์ ์์ ์ ๋ฐ๋ณตํด๋ ๋ง๊ฐ์ง์ง ์์).
๋ฌด์์ ํด์ฃผ๋์#
- Marionette MCP ์๋ฒ๋ฅผ ์ค์นํ๊ณ Claude Code์ ๋ฑ๋กํฉ๋๋ค.
- ๋์ Flutter ์ฑ์
marionette_flutterํจํค์ง๋ฅผ ์ฐ๊ฒฐํฉ๋๋ค. - ์ฑ์
main.dart์ CoUI ์์๋ฅผ ์ธ์ํ๋ ์ด๊ธฐํ ์ค์ (MarionetteBinding)์ ์ฌ์ด ์ค๋๋ค. -
๋ง์ง๋ง์ผ๋ก ์ฐ๊ฒฐ์ด ์ ๋๋์ง ํ์ธ(smoke test)ํ๊ณ , ์ฒซ ํ๋ฉด ์คํฌ๋ฆฐ์ท์
.claude/docs/marionette/<์๊ฐ>/screens/00.png์ ์ ์ฅํฉ๋๋ค.
์ด๋ป๊ฒ ์ฐ๋์#
# 1) MCP ์๋ฒ ์ค์น (์ด๋์๋ ์ธ ์ ์๋ ์ ์ญ ์ค์น ๊ถ์ฅ)
dart pub global activate marionette_mcp
# 2) Claude Code์ ๋ฑ๋ก
claude mcp add --transport stdio marionette -- marionette_mcp
# 3) ๋์ ์ฑ์ Flutter ํจํค์ง ์ถ๊ฐ
flutter pub add marionette_flutter
# 4) ์ฑ ์คํ ํ ์ฐ๊ฒฐ ํ์ธ
/marionette connect --uri=ws://127.0.0.1:9101/ws
/marionette smoke --routes=/
claude mcp list | grep marionette๋ฅผ ์คํํ์ ๋connected๊ฐ ๋ณด์ด๋ฉด ๋ฑ๋ก์ด ์ ๋ ๊ฒ์ ๋๋ค.-
์ฑ์
flutter run์ผ๋ก ๋์ฐ๋ฉด ํ๋ฉด์ws://...๋ก ์์ํ๋ ์ฃผ์๊ฐ ๋จ๋๋ฐ, ์ด ์ฃผ์๋ฅผ ์--uri=์ ๋ฃ์ด ์ค๋๋ค.
์์์ ๋ฌด์จ ์ผ์ด ๋ฒ์ด์ง๋์#
- MCP ์๋ฒ ์ค์น โ Marionette MCP๋ฅผ ์ ์ญ ๋๋ ํ๋ก์ ํธ์ ๊น์ ๋ก๋๋ค.
- Claude Code์ ๋ฑ๋ก โ Claude๊ฐ ์ด ์๋ฒ๋ฅผ ํตํด ์ฑ๊ณผ ๋ํํ๋๋ก ์ฐ๊ฒฐํฉ๋๋ค.
-
์ฑ์ ํจํค์ง ์ถ๊ฐ โ ๋์ Flutter ์ฑ์
marionette_flutter(ํ์ ์marionette_logger)๋ฅผ ๋ถ์ ๋๋ค. - ์ด๊ธฐํ ์ค์ ์ฌ๊ธฐ โ
main.dart์ CoUI ์์๋ฅผ ์ธ์ํ๋ ์ค์ ์ ๋ฃ์ด, ๋ฒํผ/์ ๋ ฅ๊ฐ์ด ๊ฒ์ ๊ฐ๋ฅํด์ง๋๋ก ํฉ๋๋ค. - ์ฑ ์คํ ํ ์ฃผ์ ๋ณต์ฌ โ ์ฑ์ ๋์ ๋์จ
ws://...์ฃผ์๋ฅผ ๋ณต์ฌํฉ๋๋ค. - ์ฐ๊ฒฐ ํ์ธ โ
connect๋ก ๋ถ๊ณsmoke๋ก ์ ์ ๋์๊ณผ ์คํฌ๋ฆฐ์ท ์ ์ฅ๊น์ง ํ ๋ฒ์ ์ ๊ฒํฉ๋๋ค.
๋ฆด๋ฆฌ์ฆ ๋น๋์์๋ ๋์ํ์ง ์์ต๋๋ค(๊ฐ๋ฐ ๋ชจ๋ ์ ์ฉ). Flutter Web์ pub.dev ๊ธฐ์ค 0.6.0๋ถํฐ ์ง์ ํ๋ซํผ์ ํฌํจ๋์ด ์์ง๋ง, ์ด ์ ์ฅ์์์ CoUI Web ์กฐํฉ์ผ๋ก ์ง์ ๊ฒ์ฆ๋ ์ ์ ์์ง ์์ผ๋ ์ฒ์์ ํ ๋ฒ ์คํ ์ฒดํฌ๋ฅผ ๊ถ์ฅํฉ๋๋ค.
CoUI์ ์ ์์๊ฐ ์๊ธฐ๋ฉด main.dart์ isInteractiveWidget ๋ชฉ๋ก์ ์ถ๊ฐํ๊ณ ํซ ๋ฆฌ๋ก๋ํ๋ฉด ๋ฉ๋๋ค.
marionette_flutter(์ฑ)์ marionette_mcp(์๋ฒ)๋ ๊ฐ์ ์ ์ฅ์์์ lockstep์ผ๋ก ๋ฐฐํฌ๋๋ฏ๋ก, ๋ ๋ฒ์ ์ด ๋ค๋ฅด๋ฉด
connect ์ ๋ฒ์ ๋ถ์ผ์น ์ค๋ฅ๊ฐ ๋ฉ๋๋ค โ ํญ์ ๊ฐ์ ๋ฒ์ (์: ^0.6.0)์ผ๋ก ๋ง์ถ์ธ์.
โ๏ธ ์์ธ ์ต์ ยท์คํ ๋ช ์ธ (๊ฐ๋ฐ์ / AI ์์ด์ ํธ์ฉ)
Steps#
1. Install the MCP server#
# Global tool (recommended โ works from anywhere)
dart pub global activate marionette_mcp
# OR project-local dev_dependency
dart pub add dev:marionette_mcp2. Register the MCP server with Claude Code#
claude mcp add --transport stdio marionette -- marionette_mcpVerify with claude mcp list | grep marionette (should print connected).
3. Add the Flutter package to the target app#
cd path/to/your/flutter/app
flutter pub add marionette_flutter
flutter pub add marionette_logger # if your app uses the `logger` package4. Initialise MarionetteBinding with CoUI configuration#
Replace your main.dart initialisation block with the snippet from
skills/marionette/TEMPLATES.md (section 1). Key points:
- Guard the binding with
kDebugMode && !FLUTTER_TESTto avoid colliding with the test binding. - Pass a
MarionetteConfigurationthat lists every CoUI primitive inisInteractiveWidget. - Wire
extractTextso button labels and input values are searchable. - Optional: pass a
LogCollectorsoget_logsreturns useful output.
5. Run the app and copy the VM Service URI#
flutter runLook for a line like:
The Flutter DevTools debugger and profiler on iPhone 15 Pro is available at:
http://127.0.0.1:9101?uri=ws://127.0.0.1:9101/wsCopy the ws://... portion.
6. Sanity check#
# From any Claude Code session
/marionette connect --uri=ws://127.0.0.1:9101/ws
/marionette smoke --routes=/Expected output:
[โ] connected
[โ] interactive elements: 14
[โ] screenshot saved: .claude/docs/marionette/ < ts > /screens/00.pngPlatform Notes#
- Release builds: Marionette does not work in release mode (VM Service is disabled). Use
cc-flutter-pixel-loopinstead. - Flutter Web: listed as a supported platform on pub.dev as of 0.6.0 (previously unverified) โ spot-check CoUI wiring the first time; fall back to Playwright in
cc-flutter-dev:figma:analyzeif it misbehaves. - Multiple apps at once:
marionette_clinamed-instance mode supports it; see upstream docs. - Version alignment:
marionette_flutter,marionette_mcp, andmarionette_cliare released in lockstep from the same monorepo โ pin them to the same version. A mismatch makesconnectfail with a version error.
When CoUI Changes#
Every time CoUI adds a primitive, append it to the isInteractiveWidget callback in your main.dart and re-hot-reload. The Marionette plugin in this repo lists the current CoUI primitive set in skills/marionette/TEMPLATES.md; PRs welcome when new primitives land.