convez.ai
MCP ServerDesenvolvimento WebAvançado
playforge-coding

Scratch4JS - SDK para editar projetos Scratch com JavaScript

playforge-coding/scratch4js

Edite Scratch via JavaScript e IA, com preview ao vivo em TurboWarp

Ver no GitHub
InicialPluginScore · de 0 a 100

Monorepo JavaScript com ferramentas para editar projetos Scratch (.sb3) programaticamente, integrar com a API do Scratch, e construir extensões TurboWarp. Inclui um servidor MCP que expõe a superfície de edição como ferramentas para agentes de IA, permitindo automação completa de fluxos de criação e edição de projetos Scratch.

Instalação

$npx convez-ai playforge-coding/scratch4js

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
3
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
v1.2.4
Issues abertas
1
Contribuidores
1

Casos de uso

  • Automação de criação e edição de projetos Scratch via agentes de IA
  • Desenvolvimento de extensões TurboWarp com bundlers webpack/Rollup
  • Construção de IDEs baseadas em navegador para projetos Scratch
  • Integração programática com a API do Scratch (login, download, publicação)

Veredito

Solução robusta e modular para desenvolvedores que precisam automatizar workflows Scratch complexos ou construir ferramentas customizadas. A arquitetura de monorepo bem estruturada e o suporte a MCP o tornam ideal para integração com agentes de IA, mas exige conhecimento sólido de JavaScript e do ecossistema Scratch.

README

A tradução para o português deste README ainda está na fila.

scratch4js

A pnpm monorepo of small, focused JavaScript packages for working with Scratch and TurboWarp — edit .sb3 projects programmatically, talk to the Scratch website, drive it all from an AI agent, and build & bundle TurboWarp extensions.

📖 Documentation: https://playforge-coding.github.io/scratch4js/

Packages

PathPackageWhat it is
packages/scratch4jsscratch4jsThe core library: read/edit .sb3 files with a small, declarative API.
packages/s-api4jss-api4jsA class-based wrapper for the Scratch website API: read public data, and log in to download/edit/publish .sb3.
packages/scratch-mcpscratch-mcpAn MCP server exposing the library's editing surface as tools, plus a TurboWarp live-reload bridge.
packages/tw-plugin-webpacktw-plugin-webpackwebpack/Rspack plugin that bundles a multi-file TurboWarp extension into one IIFE-wrapped file.
packages/tw-plugin-rolluptw-plugin-rollupRollup/Rolldown/Vite plugin that bundles a multi-file TurboWarp extension into one IIFE-wrapped file.
packages/create-tw-extensioncreate-tw-extensionScaffolder (npm create tw-extension) for a new TurboWarp extension project with your choice of bundler.
packages/web-editorbrowser-ide-kitReusable React building blocks for in-browser IDEs: split-pane layout, Monaco, an xterm/WebContainer terminal, file tree.
packages/tw-extension-makertw-extension-makerIn-browser IDE (built on browser-ide-kit) that bundles a TurboWarp extension in a WebContainer and previews it live.
packages/userscriptuserscriptTurboWarp Desktop userscript (ES modules → one IIFE): scratch-mcp live-reload + real-time collaboration over a WebSocket relay.

How they fit together

  AI agent / MCP client
          │  (MCP tools over stdio)
          ▼
   ┌──────────────┐   edits in memory   ┌────────────┐
   │  scratch-mcp │ ──────────────────► │ scratch4js │
   └──────┬───────┘   save → .sb3 file  └────────────┘
          │ WebSocket bridge (localhost:9060)
          ▼  "loadSB3" → fetch /get.sb3
   TurboWarp Desktop + userscript  ──►  live preview

An agent edits a project through scratch-mcp; on save the server writes the .sb3 and signals the userscript, which reloads it into TurboWarp Desktop instantly.

Getting started

pnpm install
pnpm build          # build every package (-r build)
pnpm lint
pnpm fmt            # prettier --write .

Then:

  1. Install the userscript into TurboWarp Desktop (pnpm --filter userscript deploy; per-OS paths in its README).
  2. Run the MCP server and point your MCP client at it.
  3. Open .sb3 files, edit, and save_project to see changes live.

Workspace layout

.
├── packages/
│   ├── scratch4js/          # the core library (+ examples + example.sb3)
│   ├── s-api4js/            # Scratch website API wrapper
│   ├── scratch-mcp/         # the MCP server + live-reload bridge
│   ├── tw-plugin-webpack/   # webpack/Rspack extension bundler plugin
│   ├── tw-plugin-rollup/    # Rollup/Rolldown/Vite extension bundler plugin
│   ├── create-tw-extension/ # extension scaffolder CLI
│   ├── web-editor/          # in-browser IDE building blocks
│   ├── tw-extension-maker/  # in-browser extension IDE
│   └── userscript/          # TurboWarp Desktop userscript: live-reload + collaboration
├── docs/                    # Rspress documentation site
├── pnpm-workspace.yaml
└── package.json             # workspace root (build/lint/fmt delegate to -r)
Ver o original no GitHub

Bom para

Relacionados