microbit-makecode-mcp
Lets Claude write MakeCode programs for the BBC micro:bit, view them as blocks, test them in the simulator, compile and save .hex files, and flash a connected board over USB.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@microbit-makecode-mcp make button A show a heart and button B show the temperature, then test it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
microbit-makecode-mcp
MCP server that lets Claude (Claude Code / Claude Desktop) and other MCP clients program the BBC micro:bit in Microsoft MakeCode (makecode.microbit.org): write the program, see it as blocks, fix compile errors, try it in the simulator, add extensions, save .hex files and flash the board over USB.
It works in the browser you already have open (Chrome or Edge): it attaches to it, uses its MakeCode tab (opening one if needed) and drives the editor the way its own buttons do. It never launches a browser of its own, so your MakeCode projects, settings and paired micro:bit stay where they are. It needs no firmware on the board and no private API.
How it differs from other micro:bit MCP servers: those talk to a board over USB serial (show text on the LEDs, read sensors) or build C++ CODAL firmware. This one is for writing MakeCode programs, the blocks and JavaScript that students and teachers use.
Install
No install step is needed: MCP clients run it with npx microbit-makecode-mcp (Node.js 18+). To work on the code instead:
git clone https://github.com/nguyenquocan0101/microbit-makecode-mcp
cd microbit-makecode-mcp
npm install
npm run buildRelated MCP server: byob
Allow the connection (once per browser)
Requires Chrome 144+ (or a recent Edge).
In your browser open
chrome://inspect/#remote-debugging(Edge:edge://inspect/#remote-debugging).Turn on Allow remote debugging for this browser instance.
The first time the server attaches, the browser asks whether to allow it: click Allow.
The server finds the browser through the DevToolsActivePort file the browser writes into its profile folder (Chrome, Chrome Beta/Canary, Edge, Brave, Cốc Cốc, Chromium), then tries port 9222. If nothing is reachable, every tool says which case it is: no browser open, or remote debugging still off.
Register with Claude
Claude Code
claude mcp add microbit -- npx -y microbit-makecode-mcpClaude Desktop: add to claude_desktop_config.json (%APPDATA%\Claude\ on Windows)
{
"mcpServers": {
"microbit": { "command": "npx", "args": ["-y", "microbit-makecode-mcp"] }
}
}Then ask, for example: "Make a micro:bit program: button A shows a heart, button B shows the temperature. Test it in the simulator, then flash it."
Tools
Tool | What it does |
| Attaches to your browser, opens MakeCode if needed; reports project, view, extensions, simulator, micro:bit connection, open dialogs |
| Screenshot of the MakeCode window |
| Block APIs as TypeScript signatures with their block text. No argument: namespaces. With |
| Reads the open program as MakeCode TypeScript |
| Replaces the program, shows it as blocks (or JavaScript when it has no block form) and returns compile errors |
| Creates a new project, optionally with code (your other projects are kept) |
| Adds an extension: built-in ( |
| Starts / stops the on-screen micro:bit simulator |
| Compiles and saves a |
| Opens a |
| Connects the micro:bit over WebUSB through MakeCode's pairing dialog |
| Compiles and flashes the connected micro:bit (connects first if needed); returns compile errors instead when there are any |
Programs are MakeCode TypeScript, which MakeCode shows as blocks:
input.onButtonPressed(Button.A, function () {
basic.showIcon(IconNames.Heart)
})
basic.forever(function () {
led.toggle(2, 2)
basic.pause(500)
})set_code replaces the whole program of the open project. Claude is told to read it first with get_code or to start with new_project when it may hold your work; MakeCode's own undo and project history still apply.
USB and the first connect
WebUSB lets a page open a device only after a person picks it. The first connect_device (or flash) clicks through MakeCode's pairing dialog and the browser then shows its device chooser under the address bar: select the micro:bit and click Connect. Later connects reuse that permission. If the chooser is left unanswered, the tool reports it and closes the pairing dialog.
Environment variables
Variable | Purpose |
| Attach to this DevTools endpoint instead of discovering one (e.g. |
| Editor URL (default |
| Browser profile folders to look in for |
Development
npm run smoke runs every tool through the MCP protocol against a throwaway browser:
chrome --headless=new --remote-debugging-port=9333 --user-data-dir=$env:TEMP\mkmcp-profile
$env:MAKECODE_CDP_URL = "http://127.0.0.1:9333"; npm run smokeLimits
MakeCode has no public API for a top-level page, so the server uses the editor's internal methods. If a MakeCode update changes them, tools fail with a clear "MakeCode internals changed" error instead of doing something wrong.
Programs are read and written as TypeScript; Python projects can be opened but not edited as Python.
The
flashpath has been checked up to the WebUSB device chooser; flashing a real board has not been tested yet.
License
Available Tools
13 toolsadd_extensionA
Add a MakeCode extension to the open project: a built-in one (servo, bluetooth, devices, datalogger...), a GitHub repo (owner/repo, e.g. microsoft/pxt-neopixel), or a search term (e.g. maqueen, cutebot). Then use list_blocks with its namespace.
Inputs: name (required).
connect_deviceB
Connect a micro:bit over USB (WebUSB) through MakeCode's pairing dialog. The first time, the user must select the micro:bit in the browser's chooser; later connects reuse it.
Inputs: timeoutSeconds.
flashA
Compile the program and flash it onto the connected micro:bit (replaces the program on the board). Connects first if needed (see connect_device). Returns compile errors instead of flashing when there are any.
Inputs: no named parameters.
get_codeA
Read the open project's program as MakeCode TypeScript (blocks are stored as this code).
Inputs: no named parameters.
list_blocksA
Block APIs available in the open project (core plus added extensions) as TypeScript signatures with their block text. Without namespace: namespaces and block counts. With namespace (e.g. basic, input, led, music, radio, pins, or an extension's namespace): its functions.
Inputs: namespace.
new_projectB
Create a new MakeCode project (the user's other projects are kept in MakeCode's list), optionally with a program. Returns compile errors when code is given.
Inputs: name (required), code, view.
open_fileA
Open a MakeCode project file from this computer as a new project: .hex (made by MakeCode), .mkcd, .ts or .py.
Inputs: path (required).
run_simulatorA
Start MakeCode's on-screen micro:bit simulator with the current program (use screenshot to see it).
Inputs: no named parameters.
save_hexA
Compile the program and save the .hex file on this computer. The file can be copied to the MICROBIT drive to flash it, and opened again with open_file (it contains the source).
Inputs: path (required).
screenshotB
Screenshot of the MakeCode window (blocks, simulator, dialogs).
Inputs: no named parameters.
set_codeA
Replace the open project's whole program with MakeCode TypeScript, show it as blocks, and compile it. Returns compile errors (fix and call again until errors is empty) and whether it converted to blocks. Overwrites the program: call get_code first if it may hold the user's work, or use new_project.
Inputs: code (required), view.
statusA
Attach to the user's open browser (Chrome/Edge with remote debugging allowed), open the MakeCode micro:bit tab if needed, and report its state: project name, editor view, extensions, simulator, micro:bit connection, open dialogs.
Inputs: no named parameters.
stop_simulatorB
Stop the on-screen simulator.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools target a distinct resource+action pair (get_code/set_code, run_simulator/stop_simulator, save_hex/flash, connect_device). The few overlaps — set_code vs new_project both injecting a program, and flash vs connect_device (flash connects implicitly) — are explicitly clarified in the descriptions. An agent can select correctly, though it must read carefully for the code-writing and device-flashing pairs.
The dominant pattern is verb_noun (list_blocks, get_code, set_code, new_project, add_extension, run_simulator, save_hex, open_file, connect_device), which is predictable and readable. A handful of deviations — bare nouns 'status' and 'screenshot', and the bare verb 'flash' — are natural terms but break the pattern slightly.
13 tools is squarely in the well-scoped range and each one maps to a real workflow step: attach, inspect, read/write code, extensions, simulate, save, open, connect, flash. There is no filler or redundant tool in the set.
The core lifecycle — attach, read code, replace code, new project, add extensions, list blocks, simulate, save .hex, open files, pair and flash a device — is fully covered with no dead ends. Minor gaps exist: no way to remove an extension, no listing/switching among MakeCode's existing projects, and no serial/console output reading during simulation or flashing.
Maintenance
Related MCP Connectors
Build, run, debug, test and ship Chrome, Firefox, Edge and Safari extensions from your AI agent.
Let AI agents use your real, signed-in Chrome: tabs, clicks, forms, screenshots and video.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Lets your AI build and edit websites and apps in Xodia, an AI builder and visual editor for real code (Vite, React, Tailwind CSS or plain HTML in your own git repo): read and write site files, create pages and CMS collections, make database tables and visitor sign-in on the built-in Xodia database or your own Supabase, write server tasks, run typecheck, design, link and security checks, take screenshots, manage forms and translations, and pick up change requests the user sends from the visual editor. 67 tools. Sign in once with your Xodia account (OAuth). Free plan, no card needed. Setup: https://xodia.ai/ai/mcp
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceLets any MCP-speaking AI agent drive your everyday Chrome browser, opening pages, reading them, clicking, typing, taking screenshots, and inspecting DevTools console, network, storage and performance data with your existing sign-ins. Risky actions like submitting or paying require your explicit approval, and agents are confined to their own tab group with secrets hidden.Apache 2.0- AlicenseNot gradedqualityAmaintenanceLets AI coding tools directly control the user's already-open, logged-in Chrome to read pages, navigate, click, type, screenshot, inspect network/storage, and automate browser tasks through local MCP tools.1 npmISC
- AlicenseNot gradedqualityAmaintenanceLets AI coding tools drive the real Chrome browser you already have open and logged into — navigating, reading pages, clicking, filling forms, capturing screenshots, and inspecting network, console, and storage state. It works through a Chrome extension rather than a remote-debugging port, so no extra debugging prompt appears and nothing else on the machine can hijack your logged-in browser.1 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI coding tools to control your real, already-logged-in Chrome browser through local MCP tools for navigation, reading, screenshots, form filling, cookies, tabs, network inspection, and more. It works via a Chrome extension rather than a remote-debugging port, keeping all communication on your machine.1 npmISC