io.github.drhelius/geartowns โ MCP Server for Geartowns FM Towns Emulator
This MCP server provides Model Context Protocol access for the Geartowns FM Towns emulator. The server is identified by the slug io-github-drhelius-geartowns and is named io.github.drhelius/geartowns. Its purpose is described as enabling MCP integration with the Geartowns FM Towns emulator.
๐ ๏ธ Key Features
MCP server for the Geartowns FM Towns emulator
๐ Use Cases
Integrate the Geartowns FM Towns emulator into MCP-based developer workflows
โก Developer Benefits
Standard MCP interface for accessing context related to the Geartowns FM Towns emulator
โ ๏ธ Limitations
Limited published details provided: no tool list, topics, or readme excerpt were included.
Geartowns is a very accurate, cross-platform Fujitsu FM Towns emulator written in C++ that runs on Windows, macOS, Linux, BSD and RetroArch, with an embedded MCP server for AI debugging and development.
This is an open source project with its ongoing development made possible thanks to the support by these awesome backers. If you find it useful, please consider sponsoring.
Don't hesitate to report bugs or ask for new features by opening an issue.
FM Towns (Model 1/2), 1F/2F, 10F/20F, FM Towns II CX, UX, UG, HG, HR, UR, ME, MA, MX and MF/Fresh, and FM Towns Marty emulation.
CD-ROM drive emulation with cue/bin, iso and chd images, m3u disc playlists and disc swapping, with optional compressed images (zip).
Physical CD-ROM discs on Windows, macOS and Linux.
Floppy disk emulation with two drives supporting d77, d88, hdm, xdf, img and HxC mfm images, m3u playlists, write protection and optional persistence of disk changes.
SCSI hard disks on IDs 0-6 with raw and chd images, blank disk creation and Towns OS installation.
IC memory card slot with raw card images, the JEIDA 4 banked windows, blank card creation and booting from the card.
Save states with 5 slots and rewind support.
Run-ahead support to reduce input latency.
In-game keyboard mapper to bind host keys to the FM Towns keyboard per game.
Video recording to AVI and screenshots.
VGM recorder for the YM3438 and RF5C68 sound chips.
Internal database for automatic media detection and hardware selection if Auto options are selected.
Supported platforms (standalone): Windows, Linux, BSD and macOS.
Supported platforms (libretro): Windows, Linux, macOS, Raspberry Pi, Android, iOS, tvOS, webOS, PlayStation 3, Nintendo GameCube, Nintendo WiiU, Nintendo Switch, Emscripten, Classic Mini systems (NES, SNES, C64, ...), OpenDingux, RetroFW and QNX.
i386 registers, descriptor tables and paging inspectors.
Viewers for CRTC, palettes, framebuffers, sprites, YM3438, RF5C68, CD-ROM, floppy controller and disks, SCSI controller and disks, interrupts, timers, DMA, RTC, keyboard and game ports.
MCP server for AI-assisted debugging with Claude Code, Codex and similar, exposing tools for execution control, memory inspection, hardware status, rewind and more.
Media loading from the command line by adding the CD-ROM, floppy, hard disk or IC memory card image path as an argument.
Media loading using drag & drop.
Support for modern game controllers through gamecontrollerdb.txt file located in the same directory as the application binary.
Tips
Basic Usage
Firmware: Geartowns requires the FM Towns system ROMs to run. Use Emulator โ Firmware... to choose the folder that holds them, with one subfolder or MAME zip per set. See BIOS_README.md for the sets each model needs, where to put them and their checksums.
Machine: Machine โ Model, CPU Speed and Main RAM default to Auto, which picks:
The model, CPU speed and RAM that the game database names for the game.
The FM Towns II HG for 1.44 MB floppy disks.
The FM Towns (Model 1/2) for other content.
CD-ROM Images: Geartowns supports chd, zipped and unzipped cue/bin and iso images, and m3u playlists for multi-disc games. CUE audio tracks can use raw BIN, compatible WAV (44100 Hz, 16-bit, stereo) or Ogg Vorbis files. Change discs from Drives โ CD-ROM.
Floppy Images: Insert floppy disks from Drives โ Floppies, or load them from the command line. Supported images are d77, d88, hdm, xdf, img and mfm, also inside zip files, and m3u playlists.
Portable Mode: Run with --portable, or create an empty file named portable.ini in the same directory as the application binary. On macOS, place the file next to the .app bundle.
Keyboard
Keys type on the FM Towns keyboard while the window has focus. Geartowns keeps only its hotkeys, which use Ctrl+Shift or Ctrl with an F-key; on macOS, Cmd replaces Ctrl in all of them.
Game Focus is for playing: press Ctrl+F10, or go fullscreen with Alt+Enter. The mouse is then locked in the window, and every hotkey is off except Ctrl+F10, Alt+Enter, Ctrl+F1 and Ctrl+F2. The window title shows it's on. Ctrl+F10 leaves it, and so do switching to another window and leaving fullscreen. Outside Game Focus, a mouse plugged into a port follows the pointer while it's over the screen.
Hotkey
Does
Ctrl+F10
Game Focus on and off
Alt+Enter
Fullscreen
Ctrl+F1, Ctrl+F2
Keyboard mapper, key changes off and on
Ctrl+F9
Quit (Cmd+Q on macOS)
Ctrl+Shift+S, Ctrl+Shift+L
Save state, load state
Ctrl+Shift+R, Ctrl+Shift+P
Reset, pause
Every hotkey can be changed in Emulator โ Hotkeys, and its Reset to Defaults brings these back.
The Towns keys a PC keyboard doesn't have are on these host keys, on desktop and libretro:
Host key
FM Towns key
F1-F12 / F13-F20
PF1-PF12 / PF13-PF20
Escape / Pause
BREAK
`
ESC
Print Screen
COPY
Page Up / Page Down
ๅ่ก / ๆฌก่ก
= / [ / ] / \
^ / @ / [ / ยฅ
'
:
Menu
ใฒใใใช
Left Win / Right Win (Cmd on macOS)
็กๅคๆ / ๅคๆ
Right Alt (Option on macOS)
ใใชๆผขๅญ
On a Japanese keyboard, its own ใซใฟใซใ/ใฒใใใช, ๅคๆ, ็กๅคๆ, ยฅ and _ keys drive the Towns ones.
Keyboard Mapper
Press Ctrl+F1 (Cmd+F1 on macOS), or use Input โ Keyboard โ Keyboard Mapper..., to stop the Towns and show its keyboard:
Click a Towns key, then press the host key that should drive it, on its own. It stays selected for more host keys; click it again to deselect it.
Each Towns key lists the host keys that drive it, built-in ones first. Click the x on one to remove it, or right click the Towns key to remove all but the built-in ones.
Red keys are ones no host key reaches, such as ๅฎ่ก, ๅๆถ and the dictionary keys.
Reset All, clicked twice, drops the game's changes.
Press the same hotkey again, or click Close, to go back to the game.
Ctrl+F2 (Cmd+F2 on macOS), or Input โ Keyboard โ Key Mapping, turns the game's changes off and on, for instance to type a name in a game whose letter keys were moved. Every game starts with them on. Both hotkeys can be changed in Emulator โ Hotkeys, and the mapper can also have a gamepad shortcut.
Key Files
The changes are kept for that game only, in a .keys file named after the content (FM Towns.keys with nothing loaded) in the Save Files folder, written when the mapper closes. The file can be edited by hand. Host keys without a line keep their usual job:
A host key takes up to four Towns keys joined with +, pressed in that order, such as ctrl + pf1, or none to do nothing.
Libretro
The mapper hotkeys work in libretro too. RetroArch keeps F1 and F2 for itself, so turn on RetroArch's Game Focus (Scroll Lock by default) first; Geartowns reminds you when a game loads. Click keys with the mouse or a touch screen. The .keys files go to the save directory.
Hard Disks
Up to seven SCSI hard disks can be attached, on IDs 0-6:
1F/2F and later: built-in SCSI interface.
FM Towns (Model 1/2): a SCSI card is fitted while a disk is attached.
FM Towns Marty: no SCSI.
Image Formats
Raw images (hdd, h0-h6, and hdm over 8 MB): 512-byte sectors. Smaller hdm images are floppies.
MAME hard disk chd: read-only. At the first write, Geartowns makes a raw working copy in the Save Files folder and uses it from then on.
Attaching Disks
Desktop: use Drives โ Hard Disks, drag & drop or the command line. With drag & drop and the command line, the extension picks the ID:
h0-h6: that SCSI ID.
hdd and hdm over 8 MB: the first free ID.
Libretro: load the image as content, alone or in an m3u playlist with the CD. Changes go to a working copy in the save directory and the original is never written.
Running machine: attaching or detaching a disk takes effect at the next reset.
Disk Writes and Save States
Writes are saved a few seconds after the machine stops writing.
Save states, rewind and run-ahead hold no disk data. Loading one undoes the disk writes made since then (the last 32 MB of them per disk), and warns when it can't.
Installing Games
With Formatted checked, New Blank Disk... makes a disk partitioned and formatted like Towns OS does, with one empty drive per 127 MB (up to ten). Games booted from their CD can install to it. It holds no system and doesn't boot.
Installing Towns OS
Create a disk with New Blank Disk... and Formatted unchecked.
Boot the Towns OS V2.1 CD and run HD Install from the Tools folder of TownsMENU V2.1.
Eject the CD and reset.
Towns OS V2.1 needs 4 MB of RAM to start from a hard disk. Main RAM on Auto gives at least that while a disk is attached.
Booting From the Hard Disk
A bootable CD boots before the disk.
To boot the disk with a CD inserted, pick it in Geartowns โ Reset and Boot From. This holds the system ROM's boot keys (H and the SCSI ID) through the reset.
The Model 1/2 and Marty ROMs don't read these keys.
Drive Letters
Towns OS keeps hard disk drive letters in the model's CMOS, not on the disk, and only uses the partitions that have one.
Assign Drive Letters on (Drives โ Hard Disks, the default): each reset gives the free letters from D: to the partitions of an attached disk that have none. Letters already set are kept. This lets a disk installed on another model or emulator boot.
Assign Drive Letters off: assign the letters yourself in Towns OS:
Boot the Towns OS V2.1 CD.
Open Settings โ Drive Configuration.
Click the disk's SCSI ID, then Add Drive and Execute.
Eject the CD and reset.
IC Memory Card
Every model has one slot for a battery-backed SRAM card. Towns OS uses the card as a drive.
Images
Raw images (icm): the card's bytes, a whole number of KB up to 64 MB. The file is the card: writes are saved a few seconds after the machine stops writing, and when the card is ejected.
Desktop: use Drives โ IC Memory Card to insert a card, create a blank one, eject it or write protect it. Drag & drop and --card insert one too.
Libretro: set IC Memory Card to Per Game (a card named after the content) or Shared (one card for all content). The card is kept in the save directory and created blank with IC Memory Card Size when missing.
Using the Card in Towns OS
Add DEVICE=\SYS\TICM.SYS /U0 to CONFIG.SYS. At boot the driver shows the card's drive letter, for example E:.
Format the card with TICMFMT E: /S1024, the size in KB.
Towns OS V2.1's TICM.SYS uses at most 8 MB of a card. On the UX and the Marty it also misplaces transfers that cross from the second 1 MB bank of a card into the third, so keep cards there to 2 MB. The UG reaches 1 MB.
Booting From the Card
A card that starts with an IPL4 boot sector boots before the CD, on every model.
Geartowns โ Reset and Boot From โ IC Memory Card holds I, C and M through the reset, which the UX and HR system ROMs read to boot the card before any device they remember.
Save States
Save states, rewind and run-ahead hold no card data. Loading one undoes the card writes made since then, and warns when it can't. A state loads only with a card of the same size in the slot, or with the slot empty if it was empty.
Debugging Features
Docking Windows: In debug mode, you can dock windows together by pressing SHIFT and dragging a window onto another.
Multi-viewport: In Windows or macOS, you can enable "multi-viewport" in the debug menu. You must restart the emulator for the change to take effect. Once enabled, you can drag debugger windows outside the main window.
Single Instance: You can enable "Single Instance" in the Emulator menu. When enabled, opening a file while another instance is running will send it to the running instance instead of starting a new one.
Debug Symbols: The emulator automatically tries to load a symbol file when loading a CD-ROM or floppy image. For example, for path_to_image.cue it tries to load path_to_image.sym. You can also load symbol files using the GUI or the CLI.
Each line defines one symbol as address name, name = address, name EQU address or address type name. The last one is GNU nm output, for example nm -n program.elf > program.sym.
Addresses can be linear or selector:offset.
Comments start with ; or #.
GNU ld and NASM map files can be loaded too.
Command Line Usage
code
geartowns [options] [media_file] [symbol_file]
Arguments:
media_file CD-ROM (.cue .chd .iso), floppy (.d77 .d88 .hdm
.xdf .img .mfm), .m3u playlist, .zip, hard disk
(.hdd .h0-.h6, hard disk .chd, .hdm over 8 MB), or
IC memory card (.icm)
symbol_file Symbol file for debugging
Media:
--cd FILE CD-ROM image or .m3u playlist
--fd1 FILE Floppy image in drive 1
--fd2 FILE Floppy image in drive 2
--card FILE IC memory card image
--load-state SLOT Load save state slot 1-5, or a state file, once the
media is loaded
Machine (for this run only, the saved settings stay):
--model MODEL auto, model1_2, 1f_2f, 10f_20f, cx, ux, ug, hg, hr,
ur, me, ma, mx, mf_fresh, marty
--cpu-mhz MHZ auto, 16, 20, 25, 33, 40, 50, 66, 100
--ram MB auto, 1, 2, 4, 6, 8, 10, 12, 16, 20, 24, 26, 28,
32, 48, 64, 68, 96, 100
--fpu FPU auto, none, 80387 (a 487SX on the 486 models)
--speed-mode MODE auto, compatible, high
Options:
-f, --fullscreen Start in fullscreen mode
-w, --windowed Start in windowed mode with menu visible
--mcp-stdio Auto-start MCP server with stdio transport
--mcp-http Auto-start MCP server with HTTP transport
--mcp-router Enable compact MCP tool routing
--mcp-http-address A HTTP bind address (default: 127.0.0.1)
--mcp-http-port N HTTP port for MCP server (default: 7777)
--headless Run without GUI (requires MCP)
--portable Store configuration and user data beside the
application
-v, --version Display version information
-h, --help Display this help message
MCP Server
Geartowns includes a Model Context Protocol (MCP) server that enables AI-assisted debugging through AI agents like Claude Code, Codex and similar. The server provides tools for execution control, memory inspection, breakpoints, disassembly, hardware status, rewind and more. STDIO and HTTP transports are supported, with STDIO preferred.
For complete setup instructions and tool documentation, see MCP_README.md.
Agent Skills
Geartowns provides Agent Skills that teach AI assistants how to effectively use the emulator for specific tasks:
geartowns-debugging โ Game debugging, code tracing, breakpoint management, hardware inspection, and reverse engineering.
geartowns-romhacking โ Cheat creation, memory searching, data modification, text translation, and game patching.
Install with npx skills add drhelius/geartowns. See the skills README for details.