mcpField
S
scratchattach-mcp

scratchattach-mcp

Local
github.com/uukelele-scratchScience & Education14Updated 13w ago

About scratchattach-mcp

scratchattach-mcp lets agents interact with Scratch’s social features and create or edit Scratch projects. It combines account and community actions with a project workflow for building and publishing goboscript projects.

Key features

  1. 01Manage sessions and profile settings
  2. 02Read profiles, projects, inbox, and comments
  3. 03Follow users and interact with projects
  4. 04Create, edit, build, and publish projects
  5. 05Manage project costumes and sounds

Use cases

  1. 01Review Scratch profiles and project comments
  2. 02Update account details or follow users
  3. 03Edit and publish a Scratch project
  4. 04Add assets and build a project as an SB3

MCP support

The MCP server exposes Scratch social and project operations as tools for agents. It also provides project editing guidance and goboscript documentation through MCP.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

scratchattach-mcp

An MCP server that allows any agent to connect to Scratch.

The agent can access the Scratch platform to interact with site features (e.g. social features), or code Scratch projects live.


Contents


Install

$ gh repo clone uukelele/scratch-mcp
$ cd scratch-mcp
$ uv sync

If you want your agent to be able to code projects, you will need the goboscript toolchain, in Rust. Usually you can simply get the agent to read the instructions (exposed via MCP) and install it for you; but if you wish to do it manually:

$ rustup toolchain install nightly
$ cargo +nightly install --git https://github.com/aspizu/goboscript    # compiler
$ cargo install --git https://github.com/aspizu/sb2gs sb2gs-cli        # decompiler

These are optional, social_ tools work without the project building toolchain. The agent can run project_check_toolchain to see what's missing if it wishes to create any projects.

If the binaries are not on PATH, you can set GOBOSCRIPT_BIN / SB2GS_BIN.

Configuration

{
  "mcpServers": {
    "scratch": {
      "command": "/home/x/scratch-mcp/.venv/bin/python",
      "args": ["-m", "scratch_mcp"],
      "cwd": "/home/x/scratch-mcp",
      "env": { "PYTHONPATH": "/home/x/scratch-mcp" },
      "timeout": 600000 // compiling / decompiling / publishing can take quite some time
    }
  }
}

All configuration data for the MCP itself persist on the filesystem at ~/.local/share/scratch-mcp/sessions.json. You can override this path with SCRATCH_MCP_DATA_DIR or SCRATCH_MCP_SESSION_FILE environment variables. Only the session ID is stored, not the password, which means sessions can expire eventually.


Tools

* marks a required argument.

Sessions
ToolArgumentsDescription
social_connect_sessionpath_to_env, scratch_username, scratch_password, scratch_session_id, browser_name, rememberLog in via a .env file, username + password, a session id, or a browser cookie. Remembered across restarts by default.
social_list_sessions—List held sessions and which is active.
social_set_active_session*usernameChoose which account subsequent tools act as.
social_verify_sessionusernameAsk Scratch whether a stored session is still valid. Restored sessions are rebuilt offline, so a revoked one looks fine until used.
social_forget_session*username, logoutDrop a session from memory and disk; optionally invalidate it on Scratch.
Profile
ToolArgumentsDescription
social_set_bio*textSet "About me". Max 200 characters.
social_set_whatimworkingon*textSet "What I'm working on". Max 255 characters.
social_set_pfp*fileSet the profile picture from a PNG/JPEG/GIF. Max 500×500.
Reading Scratch
ToolArgumentsDescription
social_get_user_info*username, recent_commentsA user's profile, plus whether you follow them and a preview of their newest profile comments.
social_get_project_info*id, recent_commentsA project's metadata, plus whether you have loved or favourited it and a comment preview.
social_search_projectsquery, sort, limit, offset, languageSearch shared projects, or browse the explore feed when no query is given. Sort by trending, popular or recent.
social_check_inboxlimit, offsetActivity messages, Scratch Team alerts and any pending Scratcher invite. Scratch tracks each with its own unread state, so unread_count alone does not mean an empty inbox — see unread_elsewhere.
Comments

All four accept source of project, studio or profile.

ToolArgumentsDescription
social_get_comments*source, *source_id, limit, offset, page, include_repliesPage through top-level comments.
social_get_comment_replies*source, *source_id, *comment_id, limit, offsetReplies to one top-level comment.
social_post_comment*source, *source_id, *content, parent_id, commentee_idPost a comment. Max 500 characters.
social_reply_to_comment*source, *source_id, *parent_id, *content, commentee_idReply to a comment. parent_id must be a top-level comment.

Projects and studios page by limit + offset and fetch replies separately. Profiles page by page (30 per page, offset ignored) and return replies inline for free. Scratch has only one level of nesting: a reply to a reply is stored against the top-level comment.

Social actions
ToolArgumentsDescription
social_follow_user*username, actioncheck (default), follow, unfollow, toggle.
social_like_project*id, actioncheck (default), like, favourite, both, unlike, unfavourite, removeboth. Love and favourite are independent.
social_add_project_to_studio*project_id, *studio_idAdd a project to a studio.
social_become_scratcherconfirmAccept a pending "become a Scratcher" invitation. Reports eligibility only unless confirm is set, because accepting means agreeing to the Community Guidelines and cannot be undone.

Both action tools default to check, so a call without an explicit action cannot change anything by accident.

Project lifecycle
ToolArgumentsDescription
project_new*path, published_project_id, gitScaffold a new goboscript project and make it active.
project_open*path, published_project_idRegister an existing project directory.
project_download*path, project_id, sb3_path, overwrite, verifyDecompile a Scratch project into editable .gs source, by id or from a local .sb3. Verifies it still compiles.
project_list—List known projects.
project_select*pathChoose the active project.
project_infopathSprites, publish target and compatibility.
project_closepathForget a project. Leaves files on disk.

Downloading by id fetches through your session, so unshared projects work.

Project assets
ToolArgumentsDescription
project_list_assets*sprite, pathList a sprite's declared costumes and sounds.
project_add_costume*sprite, file, svg, name, pathAdd a costume from a file or from raw SVG markup.
project_add_sound*sprite, *file, name, pathAdd an MP3 or WAV.
project_remove_asset*sprite, *kind, *name, pathRemove a costume or sound declaration.

Format and size limits are checked before anything is written: Scratch silently refuses to load a project containing an unsupported audio format.

Building and publishing
ToolArgumentsDescription
project_buildpathCompile to .sb3. Raises with the compiler diagnostics on failure.
project_summarypathWhat the build actually produced: per-sprite block and script counts, costumes, sounds, variables, layer order, asset sizes, and warnings for unused or oversized assets and stale builds.
project_save_to_cloudpath, title, visibility, build, thumbnailBuild and upload, including assets and a thumbnail. Creates the project on first save, then reuses its id. visibility is public, private or unchanged.
project_set_thumbnailfile, pathSet a published project's thumbnail. Omit file to use the Stage backdrop. Scratch only generates thumbnails in its editor, so an uploaded project shows a grey placeholder otherwise.
Reference
ToolArgumentsDescription
project_editing_guide—Read before creating or editing a project: Scratch's hard limits and a goboscript primer.
project_goboscript_docs_helppageThe goboscript docs. No argument lists every page; pass a path for raw markdown.
project_check_toolchain—Whether goboscript and sb2gs are installed and runnable.

How a project gets made

These are instructions for agents accessing the MCP.

  1. Start with project_new or project_download to either create a new project, or to download an existing project and decompile it.
  2. Check your toolchain availability with project_check_toolchain and then view the guide with project_editing_guide. You can read the language docs, if you get stuck, with project_goboscript_docs_help.
  3. Edit the .gs files with your file tools (Read/Edit/Write/etc.).
    • project_add_costume / project_add_sound for assets.
    • project_build, fix any diagnostics, repeat.
    • project_summary to confirm the build contains what you intended.
    • project_save_to_cloud.

Notes and gotchas

  • api.scratch.mit.edu caches for roughly 15 seconds, so a read straight after a write can report the old value.
  • Scratch's search is frequently unavailable, answering 429 from its search cluster or 503 from its cache layer. social_search_projects retries and says plainly when the fault is Scratch's.
  • Relative paths in project_* tools resolve inside the project directory, not the server's working directory.
  • Decompiling is a semantic repair, not a byte-perfect copy. Real projects contain things goboscript cannot express — duplicate variable names in one sprite, two custom blocks that map to the same name, blocks referencing deleted assets. These are renamed or dropped, and every change is reported. We try to fix this using our SB3 normalizer, but please note that not everything is perfect.

Tests

$ .venv/bin/python tests/test_offline.py

No network and no credentials, these tests are just offline tests. So they might be "incomplete" as a way but really we just hope for the best ;).

Credits

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.