ScratchyCat format

A plain-text way to describe a Scratch project. Write it, send it, open the result in Scratch. Free for anyone, no account needed.

mcphttps://scratchycat.lovable.app/mcp

The three tools

scratchycat_docs

Returns this whole format reference so the AI knows exactly what it can write.

check_scratchycat

Validates the text and reports sprites, costumes and block counts. Nothing is uploaded.

build_sb3

Compiles the text, packs the images as costumes, and returns a download link valid for 10 days.

Full reference

SCRATCHYCAT FORMAT v1
=====================
ScratchyCat is a plain-text format that turns directly into a real Scratch
project (.sb3). You write the text yourself, send it to the build tool, and you
get back a download link for a Scratch file you can open at scratch.mit.edu or
in the offline editor.

RULES
- One statement per line.
- Indentation (2 spaces) creates nesting inside repeat / forever / if blocks.
- Text values go in "double quotes". Numbers are bare.
- Blank lines and lines starting with # are ignored.
- Reporters (values that compute something) go in (parentheses).
- Conditions go in <angle brackets>.

SKELETON
  project "Catch the Apple"

  stage
    backdrop "sky" from https://example.com/sky.png

  sprite "Cat"
    x 0
    y -80
    size 100
    direction 90
    costume "cat-a" from https://example.com/cat-a.png
    costume "cat-b" from https://example.com/cat-b.png
    variable "score" = 0

    when flag clicked
      set "score" to 0
      say "Catch it!" for 2 seconds
      forever
        next costume
        wait 0.2 seconds

IMAGES / COSTUMES
  costume "name" from https://example.com/pic.png
  backdrop "name" from https://example.com/bg.png
Any public PNG, JPG, GIF or SVG URL works (max 8 MB each, 60 per project).
A sprite with no costume gets a plain generated one.

HAT BLOCKS (start a script; must be at the top of a script)
  when flag clicked
  when "space" key pressed
  when this sprite clicked
  when i receive "message"

MOTION
  move 10 steps
  turn right 15 degrees
  turn left 15 degrees
  go to x 0 y 0
  glide 1 seconds to x 100 y 50
  point in direction 90
  change x by 10
  change y by -10
  set x to 0
  set y to 0
  if on edge, bounce

LOOKS
  say "Hello!"
  say "Hello!" for 2 seconds
  think "Hmm..."
  think "Hmm..." for 2 seconds
  switch costume to "cat-b"
  next costume
  switch backdrop to "sky"
  change size by 10
  set size to 100
  change ghost effect by 25
  set ghost effect to 0
  clear graphic effects
  show
  hide
  go to front

CONTROL
  wait 1 seconds
  repeat 10
  forever
  repeat until <condition>
  wait until <condition>
  if <condition> then
  if <condition> then
  else
  stop all
  stop this script

EVENTS
  broadcast "go"
  broadcast "go" and wait

VARIABLES
  variable "score" = 0        (declare, inside a sprite block)
  set "score" to 0
  change "score" by 1
  show variable "score"
  hide variable "score"

SENSING
  ask "What's your name?" and wait

CONDITIONS  <...>
  <touching "Apple">          also: "edge", "mouse-pointer"
  <"space" key pressed>
  <mouse down>
  <(var "score") > 10>
  <(var "score") < 10>
  <(var "score") = 10>
  <not <mouse down>>
  <<mouse down> and <touching "edge">>
  <<mouse down> or <touching "edge">>

REPORTERS  (...)
  (var "score")
  (pick random 1 to 10)
  (x position) (y position) (direction) (size) (costume number)
  (answer) (timer) (mouse x) (mouse y)
  (join "score: " (var "score"))
  (length of "hello")
  (letter 1 of "hello")
  (round (var "score"))
  ((var "score") + 1)   also - * / and mod
Reporters can be used anywhere a number or text is expected:
  move (pick random 1 to 20) steps
  say (join "Score: " (var "score"))

FULL EXAMPLE
  project "Apple Catch"

  sprite "Cat"
    y -100
    costume "cat" from https://example.com/cat.png
    variable "score" = 0

    when flag clicked
      set "score" to 0
      show variable "score"
      forever
        set x to (mouse x)
        if <touching "Apple"> then
          change "score" by 1
          broadcast "caught"

  sprite "Apple"
    costume "apple" from https://example.com/apple.png

    when flag clicked
      forever
        go to x (pick random -220 to 220) y 170
        repeat until <(y position) < -160>
          change y by -6

    when i receive "caught"
      say "Yum!" for 0.5 seconds

BUILDING
Send the whole text to the build tool. You get back a download link for the
.sb3 file. Links stay alive for 10 days, then the file disappears.

Opening your file

Download the .sb3, then in Scratch choose File → Load from your computer. It works in the online editor and the offline one.