mib2c-mcp
# mib2c-mcp
An MCP server that lets an AI assistant (Claude, Codex, Cursor, VS Code Copilot or any other MCP app) see and work
the [MIB2 Configurator](https://pqisa.eu/mib2c/) open in your browser: the web app for VW MIB2 head unit skins (ambient
light, climate, car status, parking, energy flow, tyre and traffic sign screens).
The assistant can read what the app shows, switch pages, cars, sides and themes, take screenshots of the head unit
screen, move points, touch areas, parking and energy flow positions (with undo), set the preview situation, and
export and replace images. Saving goes through the app: it shows you the list of changes and waits for you to
confirm (unless you let it save without asking). Everything it does shows up in the app's **MCP › Log**.
Your skin files stay in the browser. This server runs on your computer, listens only on `127.0.0.1`, and talks to
the page over a WebSocket. There is nothing to pair or type in.
> ⚠ Changed skin or startup files might brick the head unit (startup files especially: they run before its screen starts). The INSTRUCTIONS tell the assistant to mention this before suggesting the user saves or installs changed files; `get_startup_program` / `get_startup_steps` carry a short `warning`.
## Requirements
- Node.js 20 or newer, and git (npx fetches the server from GitHub).
- Chrome or Edge with the app open (https://pqisa.eu/mib2c/, signed in with Discord, or your own copy of it).
- An AI app that uses MCP servers (examples below).
## Set up
Add the server to your AI app once, then restart the app (or start a new session): it starts the server by itself.
**Claude Code**
```sh
claude mcp add --scope user mib2c -- npx -y github:TomasSlekys/mib2c-mcp
```
**Codex CLI**
```sh
codex mcp add mib2c -- npx -y github:TomasSlekys/mib2c-mcp
```
Then give it more time in `~/.codex/config.toml` (the first start builds the server, and a save waits while you
confirm it in the app; Codex's defaults are 10 and 60 seconds):
```toml
[mcp_servers.mib2c]
startup_timeout_sec = 120
tool_timeout_sec = 900
```
**Claude Desktop**: Settings › Developer › Edit Config, then add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"mib2c": { "command": "npx", "args": ["-y", "github:TomasSlekys/mib2c-mcp"] }
}
}
```
**Cursor**: the same `mcpServers` block in `~/.cursor/mcp.json`.
**VS Code** (GitHub Copilot, agent mode): in `.vscode/mcp.json` (or the user `mcp.json`):
```json
{
"servers": {
"mib2c": { "type": "stdio", "command": "npx", "args": ["-y", "github:TomasSlekys/mib2c-mcp"] }
}
}
```
On Windows, if an app can't start `npx`, use `"command": "cmd", "args": ["/c", "npx", "-y", "github:TomasSlekys/mib2c-mcp"]`.
## Connect the page
**The first time:** open the app, click **MCP** in its top bar, and click **Allow** when the browser asks whether
the site may access your local network (or this computer). The dot turns green once your AI app is running. The
same menu's **Setup** button walks you through all of this.
**After that:** nothing. The page connects by itself, within a few seconds, whenever your AI app runs this server,
and the MCP log opens at the bottom. Open the app and your skins folder (or a folder holding `skins` and `startanim`) and talk to your assistant.
Why the one click: browsers only let a public website reach `127.0.0.1` after you allow it (Chrome's Local Network
Access), and the app doesn't ask on its own, so visitors who don't use MCP never see the prompt. Chrome remembers
your answer for the site. **Turn off** in the MCP menu stops the page connecting until you turn it on again. The
app run on your own computer (`localhost`) connects without the prompt.
Security: the server only accepts the app's own pages (by their origin, which the browser sets and a web page can't
fake), on `127.0.0.1` only. Programs already running on your computer could also connect, as with any local
server; they could do no more than you can on your own computer anyway.
## Tools
| Tool | What it does |
| --- | --- |
| `status` | Connection state, and how to connect if the page isn't. The assistant calls this first. |
| `get_state` | Skin (and what was opened: the skins folder, or a root folder with `skins/` and `startanim/` and its startup screen files), head unit, theme (and its look, e.g. VW Default), page, mode, car, side, unsaved changes, undo state; `newMarks`: the screens still marked New for this user (a mark clears once the screen is opened, kept in the browser). |
| `list_cars` | The cars a page has pictures for, with names where known. |
| `navigate` | Page or any screen (Navigation, the map screen with its traffic signs: `navigation`, old id `signs` still accepted; the startup screens: `startup` (or one file: `startup:startup_N`), with a root folder holding `skins/` and `startanim/`; Vehicle menu screens, Vehicle settings, Pure Air, the auxiliary heater and its timer screens, Set time (the clock), Set date, the screen-off clock, the driving profile pop-up and its settings, hybrid information and low battery messages, the control bar push-ups, the car's other pop-ups (`popup:<view>`: E-traction charging, the tyre pressure store question and its help, parking failures and camera views, unavailable while driving; the Sound pop-ups `popup:Psvse` … `popup:Psvst` (volume bars) and `popup:Psassna`; the Climate pop-ups `popup:Pca` (air distribution), `popup:Pct`, `popup:Picsv` (seat heating) and its messages; `popup:Pmcmo` the mini parking pop-up on the parking page), Start-stop and the car's start-stop pop-ups (`startstop-details`, `startstop-notice`), the vehicle status messages list, the Menu (the MENU key's carousel or grid), Settings (the system setup's lists: `settings`, `settings:<screen>`, with WLAN `settings:wlan…` / `settings:hotspot…` and Network `settings:network…`, `settings:sim-lock`), Media Control (`mediacontrol`: the screen the unit picks; `mediacontrol:main`, `:player`, `:browser`, `:setup`, `:popup`; its tablets, track and WLAN in `get_page_preview` / `set_page_preview`), Images (`pictureviewer`: the picture; `pictureviewer:browser`, `:sources`, `:setup`, and the overlays `:end`, `:cd`, `:wait`), App-Connect (`appconnect`, `appconnect:<screen>`: the phone, Android Auto / CarPlay / CarLife / MirrorLink, information, settings and the pop-ups by view, e.g. `appconnect:Psid`; `connected`, `mirrorlinkApps` in `get_page_preview` / `set_page_preview`), Software update (`swdl`, `swdl:<screen>`: the installed versions, source / release / device / module, the notes, progress, result and restarts, the logs, the service mode `swdl:service`; `abort` in `get_page_preview`), Radio (`radio`, `radio:<screen>`: FM / AM / DAB, station lists, settings, preset grids and the pop-ups by view, e.g. `radio:Tot`; stations and logos are samples), Setup wizard (`wizard`, `wizard:<screen>`: the configuration wizard's pages, the online configuration wizard and the pop-ups by view; `module` in `get_page_preview`), Soon screens…), car, side, View / Edit mode, theme, head unit UI, screen view. |
| `list_controls`, `press`, `set_control` | The page's own controls: the head unit screen's buttons and sliders, the menu, the side panels, popups. List them (id, label, place, state), click one (by id, label or screen point), or set a slider, field or list. Save buttons, confirmations, the MCP menu, sign-in and reports are left out. |
| `screenshot` | The page's screen as PNG at the screen's own resolution; `labels` names every point and touch area, `region` + `zoom` shows a part up close, `file` writes it to disk. |
| `get_scene_data` | The zone file of the ambient light / climate / car status page: points, touch areas, names, images. |
| `move_items`, `set_points`, `align_items`, `distribute_items` | Move or place points, touch areas or corners (each call is one undo step). |
| `reset_items`, `revert_file` | Put items, or a whole file, back as saved (one undo step). |
| `copy_points` | Copy positions to the other side (mirrored) or another car (scaled to its picture). |
| `undo`, `redo` | Step back and forward through position edits, per data file. |
| `get_parking_data`, `move_parking`, `set_parking_preview` | The parking layout file (sectors, pieces, positions) and its preview (obstacles, faults, guide lines, the warning bar text, the Mute / Auto brake / camera buttons, the pop-up's side panel, the area view's title by `displayView` and its split variant for the camera views, `extCamExists` / `extCamAvailable`, the right bar's mode list by `displayMode` and `areaModes.supported`, the 3D view (`displayMode` 11, `areaModes.level` / `imageIndex`) and the display settings (`areaModes.displaySettings`, `displaySlider`), the mini parking pop-up over the screen shown (`miniOps`)…). |
| `get_energy_data`, `move_energy`, `set_energy_preview` | The energy flow file (car, battery, engine, e-motor, tracks) and its situation; the animations' phase and the screen's opening (play it, or hold one moment). |
| `get_preview`, `set_preview` | What the car reports on the interior pages (nothing is written); climate: preset, fan, temperatures (`fahrenheit` for a car in °F), air colour or `styleUnknown` (vents coloured by the set temperature), `open` (the preset / fan profile drop-down or the heater push-up over the screen). |
| `find_vehicle_messages` | Search the unit's 453 vehicle messages. |
| `get_dev_info`, `list_screen_items`, `find_item_at`, `list_strings` | Firmware facts about the shown screen: view name, class, model name, view id, state machine states, button events and where they lead, datapool values; every drawn item (key, rect, image id → bitmap, string → text, font, colour); strings in other languages. Read-only. |
| `find_view`, `find_string`, `find_image_usage` | Look up firmware views, strings and pictures across all the app's screens. Read-only. |
| `list_images`, `get_image`, `export_image` | Find images by path; get one as PNG, or write it to a file to edit elsewhere. With `theme`, the open theme skin's bitmaps (the Vehicle screens' UI pictures), by index or view image id. With `startup` (`startup_N.boot`) and `index`, a picture of a startup screen file (grey levels on black). |
| `replace_image`, `replace_images`, `revert_image` | Replace one image (also a theme bitmap), or a folder of them matched by file name, from pictures on this computer; take one back. `fit` and `placement` (scale, dx, dy) place the picture as the replace window does. With `startup`, a startup file's picture (stored as grey levels; `undo` / `redo` with `file: "startanim/startup_N.boot"`). |
| `import_startup` | A GIF (its frames) or a folder of picture files (natural name order) onto a startup file's pictures, in order from `start` (`sameSize`: only pictures of that size) or onto chosen `pictures`, fitted and stored as grey levels; the command list stays as it is. With `insertAtMs` they are inserted as new background steps at that moment instead (a GIF keeps its own frame timing, `gifTiming`). One undo step, unsaved until save. |
| `startup_text_line` | A 480 x 100 text line (white on black, grey levels) in one of the open theme's fonts: replaces a picture, or shows as a new text line at 160, 320 from a moment. One undo step. |
| `import_startup_files` | Imports whole `startup_N.boot` files from this computer into the open root folder's startanim: each checked (a broken one refused with the reason), byte-identical ones skipped, to its own number when free, else the next free one (or `number`; an existing one needs `replace`, which keeps a `.backup` on save); the header number follows. Unsaved until save. |
| `get_startup_steps` | A startup file as the Startup page's Simple view shows it: steps (every car), ending (the standard one), dynaudioEnding (the second ending: the cars the sticker test leaves out, inferred Dynaudio), each a background, an optional text line and a time; or fits: false and why. Read-only. |
| `edit_startup_steps` | Edits a startup file as steps in one undo step: add / update / move / delete / duplicate a step, the second ending on / off, a bottom picture of your own (`bottom`: file or picture, fit / original size, bottom / middle / x, y, `applyToSame`, `remove`); rewrites the program in the plain form. For simple files; advanced ones (IF / ELSE, markers, exact replicas) use `edit_startup`. |
| `get_startup_program` | A startup file's program (also a new, unsaved one), `fitsSteps` (whether it reads as steps, else `reason`): header, every command with its args, running number and time, the pictures and what draws them, the length and the structure check (`experimental`: untested on the unit); for a file made from another's structure, `source` and `sameAsSource` (or the `differences`). Read-only. |
| `edit_startup` | Edits a startup file's program in one undo step: insert / update / delete / move commands, header fields, step lengths (`wait`), places, moving a draw to a moment, IF STICKER endings, adding / replacing (from files) / copying (exact bytes) / removing pictures. Unsaved until save; changed programs are untested on the unit. |
| `new_startup` | A new startup file `startup_N.boot` from a template or as a copy of another file; saved into startanim by save. Undo takes it back. |
| `get_page_preview`, `set_page_preview` | Startup screen: `file`, `sticker`, `time`, `mine`, `picture`, `selected`, `loop`, `advanced`, `timelineHeight` (the timeline's height in Edit mode), `startupMode` (Edit mode's view: `simple` step cards or `advanced` commands), `step` (the step card selected, `part:index`). The open Vehicle page's preview values (tyres (also the system's state with its message, the collected status, the pressure unit, the SET button), navigation (the traffic signs, drawn in the unit's map screen: status line, control bar, zoom bar; also the split screen, the map moved by hand, the hand near, the stack opened, the zoom bar or the altitude box; a sign is pressable in the split screen), Sport (also the car's units, full scales, the dials it has and invalid values; the lap timer's board, the car moving, its statistics screen's scroll and Reset question), car computer (also what the car reports beside the values: unavailable, invalid or negative ones, and the driving school's turn signals), Eco, Think Blue (also the tips list's and a tip text's scroll, the plug-in hybrid's consumption tabs and their drop-down), E-traction (also the Potential panel and its consumers, km / mi, the screen without BCmE), Offroad, Cockpit (also what each preset holds, the contents the car offers, and the diagnosis pop-ups when its functions aren't available), Pure Air, Auxiliary heater, Set time, the screen-off clock (which clock, the other clocks' variants, time and car values valid, its opening animation held at a time), Driving profile (also the car's functions and options, the hybrid mode selection and its Info list, a low battery that blocks profiles), the control bar push-ups (also the mini player playing: its pause or play icon), Start-stop (also the car's pop-up: `popup` none / details / notice), the vehicle status messages (the messages, the list's scroll), the Menu (which items show, the one in front), Settings (the screen, its list's rows, the system language the screens follow), Vehicle settings (the sub-screen open, its scroll on whole rows, the ESC / traction control row and its value, the car setup's pop-up open: confirmations, messages, waits)). |
| `get_layers`, `set_layers` | The page's layers: show, hide, lock. |
| `get_screen`, `set_screen` | Accent colour, Live, hand near the screen (on Ambient light also the touch area buttons' look and whether an open slider panel stays), Dev view, car status base. |
| `get_status_line`, `set_status_line` | The status line on every screen, °F / 12 h, the audio source playing (the control bar's Media button shows Media or Radio), and the car features. |
| `list_presets`, `try_preset` | Presets others published: check, try on, compare, keep or drop (publishing stays with you). |
| `list_reports` | Reports users left on the screens. Read-only. |
| `swap_images` | Two images trade pictures; on the page that draws them their places (zone file points, parking and energy flow positions) trade too, so the screen looks the same, unless `keepPlaces`. Unsaved until save. |
| `swap_zones` | Two touch areas of the shown zone file trade outlines (places and shapes); each keeps its button id. One undo step. |
| `get_changes`, `check_skin` | Everything save would write, before and after; a check of the edited zone files. |
| `save` | Save every change; you confirm in the app first, unless you let MCP save without asking. |
Everything the assistant does shows up in the app's **MCP › Log**: each action with its time, a plain description,
how it went, and on click what it asked for and got back.
## Options
```
mib2c-mcp [--port <n>]
```
| Setting | Default | |
| --- | --- | --- |
| `--port` / `MIB2C_PORT` | `47391` | WebSocket port on 127.0.0.1. Enter the same port in the app's MCP menu. |
| `MIB2C_ORIGINS` | | More page origins allowed to connect, comma-separated, `*` matches any part (e.g. `https://mib2c.example.home`). Always allowed: `https://pqisa.eu`, `https://mib2c.pqisa.eu` (the old address), `http://localhost:*`, `http://127.0.0.1:*`, `https://*.ddev.site`. |
## Troubleshooting
- **The dot stays amber ("waiting")**: your AI app isn't running, or its server uses another port. Ask your
assistant for `status` (the app starts the server when it starts), and check the port.
- **Red dot ("blocked by the browser")**: the local network prompt was blocked. Click the icon left of the address,
allow Local network (or Loopback network) access for the site, and reload.
- **"Port 47391 is taken"**: another AI app or session already runs mib2c-mcp. Close it, or give this one another port
(`MIB2C_PORT`) and enter that port in the app.
- **"Versions differ"**: update whichever is older: reload the app, or restart your AI app so npx fetches the latest
server.
- **A page on your own address is refused**: add its origin to `MIB2C_ORIGINS`.
- **Only one tab at a time**: a newly connected tab takes over from the previous one.
## How it works
```
AI app ──stdio (MCP)──> mib2c-mcp ──ws://127.0.0.1:47391──> the app's page (the browser)
```
The server turns each tool call into a command for the page (`src/protocol.ts`; the app has the same file in
`src/lib/bridge/protocol.ts`, change both together). The page runs it with the app's own code, so the app's rules,
undo history and save confirmation apply, and sends back the result or a picture. The server only reads files
from your computer for `replace_image`.
The page must say hello within 5 seconds, from an allowed origin, or it is disconnected.
Calls time out after 30 seconds (2 minutes for `replace_image` and `swap_images`, 15 minutes for `save`, which waits for you).
## Development
```sh
npm install
npm test # builds, then runs the tests (node --test)
npm run build
node dist/src/index.js --help
```
To try it against a local copy of the app, run the app's dev server (`npm run dev`, http://localhost:3000 is
allowed) and point your AI app at `node /path/to/mib2c-mcp/dist/src/index.js`.
## Licence
MIT, Copyright (c) 2026 Tomas Slekys. See [LICENSE](LICENSE).
TDQS
Scored across 33 tools
Most tools target a clearly distinct resource+action, and the three parallel editors (zone / parking / energy) are separated by domain-specific verbs (move_items vs move_parking vs move_energy) plus the 'open that page first' hints. The main soft spots are the family of 'take it back' tools (undo, redo, revert_file, revert_image, reset_items) whose boundaries are subtle, and the many get_*_data / set_*_preview pairs, which an agent can still resolve from descriptions.
The overwhelming majority follow a snake_case verb_noun pattern (get_state, list_cars, move_items, replace_images, set_energy_preview). Deviations are minor but present: bare noun-only names like 'status', plus verb-less actions 'save', 'screenshot', 'undo' and 'redo', and inconsistent noun forms across the parallel tools (move_parking / move_energy vs move_items).
At 33 tools this is heavy, driven by three near-parallel data-file editors (get/move/set_preview ×3) plus a separate image pipeline, preview simulation, validation and undo stack. Each tool is defensible for this complex skin-configurator domain, but the surface is on the large side and the repetition inflates it.
Lifecycle coverage is strong: connect, inspect state/scene/changes, edit positions, save with backups, undo/redo, validate with check_skin, inspect/replace/export images, and simulate previews. Notable gaps are creation/deletion of items — there is no tool to add a new point, touch area, flow or sector, only to move or reset existing ones — and no way to create a new skin or car entry.