Enables control of Commodore 64 Ultimate, Ultimate 64, and Ultimate II+ devices via their REST API, allowing program execution, memory operations, disk management, audio playback, configuration changes, and streaming.
Commodore 64 Ultimate — MCP Server
⚠️ Alpha Release
This is an alpha release. It has been tested with my own Ultimate boards and home network setup, but I have not extensively tested all configuration combinations and API endpoints. Consider this a starting point to play and have fun with! Contributions, bug reports, and feedback are welcome.
A Model Context Protocol (MCP) server for the Commodore 64 Ultimate — the official modern Commodore 64 computer. This server enables AI assistants like Claude, ChatGPT, and Cursor to control your C64 via the Ultimate's REST API.
🎯 What is This?
The Commodore 64 Ultimate
The Commodore 64 Ultimate is an official Commodore product — a brand new Commodore 64 for the modern era. Inside, it uses a revision of the Ultimate 64 FPGA mainboard designed by Gideon Zweijtzer of Gideon's Logic. It's not an emulator — it is a real Commodore 64, cycle-accurate and built with modern technology.
The Commodore 64 Ultimate features USB storage, ethernet, HDMI output, and a powerful REST API for remote control. This MCP server leverages that REST API to let AI assistants interact with the C64 directly.
Also Compatible With
This server also works with other products from Gideon's Logic:
Device | Description |
The original FPGA-based Commodore 64 mainboard by Gideon's Logic. | |
A cartridge for your original Commodore 64 or C128, adding USB storage, ethernet, drive emulation, and more. |
All Ultimate devices expose the same REST API that this MCP server uses.
What Does This MCP Server Do?
This MCP server acts as a bridge between AI assistants and your Commodore 64 Ultimate (or other Ultimate devices), translating natural language commands into API calls. With it, you can:
Load and run C64 programs (PRG, SID, MOD files)
Read/write C64 memory directly
Mount and create disk images (D64, D71, D81)
Control drive emulation
Manage device configuration
Stream audio/video (Ultimate 64 only)
✨ Features
37 Tools covering all major Ultimate device functionality
Dual Transport Modes: STDIO (local) and SSE (remote/hosted)
Docker Support: Easy containerized deployment
Dynamic Connection: Set C64 connection at runtime
Upload PRG via Base64/URL: Run programs from anywhere
Secure by Default: Non-root Docker container
📋 Available Tools
Connection Management
Tool | Description |
| Set the hostname and port of the Ultimate C64 device |
| Get the current connection details |
| Get the REST API version |
Program Execution
Tool | Description |
| Run a program already stored on the Ultimate's filesystem (USB/SD) |
| Load a program into memory without running it |
| Upload and run a PRG from external sources — accepts local file path, base64 data, or URL ( ) |
| Load and run a cartridge file (.crt) |
Audio Playback
Tool | Description |
| Play a SID music file (with optional song number) |
| Play an Amiga MOD music file |
Memory Operations
Tool | Description |
| Read up to 256 bytes from a C64 memory address |
| Write hex data to a C64 memory address |
| Write binary file contents to memory |
Drive & Disk Management
Tool | Description |
| Mount a disk image (D64/D71/D81) on drive A-D |
| Unmount a disk from a drive |
| Turn on a virtual drive |
| Turn off a virtual drive |
| Set drive type: 1541, 1571, or 1581 |
| Load a custom ROM into a drive |
| Create a new D64 disk image (35 or 40 tracks) |
| Create a new D71 disk image |
| Create a new D81 disk image |
| Create a new DNP disk image |
Machine Control
Tool | Description |
| Perform a C64 reset |
| Soft reset (load empty program) |
| Reboot the Ultimate device |
| Power off the Ultimate device |
| Get machine information and status |
| Get current machine state |
Configuration
Tool | Description |
| List all configuration categories |
| Get settings in a category |
| Get a specific setting value |
| Set a configuration value |
| Update multiple settings at once |
| Save configuration to flash |
| Load configuration from flash |
| Reset to factory defaults |
File Operations
Tool | Description |
| Get information about a file on the Ultimate |
Streaming (Ultimate 64 Only)
Tool | Description |
| Start video, audio, or debug streaming |
| Stop an active stream |
📦 Running Programs Remotely
The ultimate_run_prg_binary tool is designed to run PRG files that are not stored on the Ultimate device. This is essential for hosted deployments where the AI assistant needs to upload and run programs from external sources.
Three Input Methods
Parameter | Use Case |
| AI embeds the PRG as base64 in the request — ideal for small programs or AI-generated code |
| Server downloads PRG from any HTTP/HTTPS URL — great for hosted program archives |
| Reads from server's local filesystem — for server-side program storage |
Only one parameter should be provided per call.
Example: Base64-Encoded PRG
The AI can encode a compiled PRG program as base64 and send it directly:
This is particularly powerful for AI-generated demos — the AI can:
Write 6502 assembly code
Compile it (if tools available) or generate machine code directly
Encode the resulting PRG as base64
Send it to run on the actual C64 hardware
Example: URL Download
Point to a PRG hosted anywhere on the internet:
The MCP server downloads the file and uploads it to the Ultimate device.
Example: Server-Local File
If the PRG is on the MCP server's filesystem:
Note: For files already on the Ultimate device's storage (USB, SD card), use
ultimate_run_programinstead.
🚀 Quick Start
Prerequisites
Python 3.11+
A Commodore 64 Ultimate (or Ultimate 64/II+/II+L) on your network
The Ultimate's REST API must be accessible (enabled by default)
Installation
Running the Server
Option 1: Environment Variable (Recommended)
Option 2: Command Line Argument
Option 3: Dynamic Connection
Start without a configured host and set it later via the ultimate_set_connection tool:
The server runs on http://0.0.0.0:8000 by default.
🔌 Transport Modes
SSE Mode (Default) — For Hosted/Remote Access
The default mode uses Server-Sent Events (SSE) for persistent HTTP connections. This is ideal for:
Hosted deployments (cloud, VPS)
Web-based AI assistants
Multi-client scenarios
Endpoints:
Endpoint | Method | Description |
| GET | Establish SSE connection, returns session ID |
| POST | Send JSON-RPC messages |
| POST | Direct PRG upload endpoint (bypasses MCP for large files) |
SSE Connection Flow:
Client connects to
GET /sseServer sends initial event with
session_idand endpoint URLClient sends JSON-RPC requests to
POST /messages?session_id={id}Responses stream back via SSE
STDIO Mode — For Local Use
For local MCP clients (like Cursor or Claude Desktop), use STDIO mode:
🐳 Docker Deployment
Building the Image
Running the Container
Environment Variables
Variable | Description | Example |
| IP address or URL of your Ultimate device |
or
|
⚙️ Client Configuration
Cursor IDE
Add to your Cursor MCP settings (.cursor/mcp.json):
For SSE (Remote) Mode:
For STDIO (Local) Mode:
Claude Desktop
Add to your Claude Desktop configuration:
📡 Direct PRG Upload Endpoint
In addition to the MCP ultimate_run_prg_binary tool, the server exposes a direct REST endpoint for uploading PRG files. This is useful for:
Large files (>100KB) where MCP protocol overhead is undesirable
Non-MCP clients that want to upload programs directly
Automation scripts and CI/CD pipelines
Web applications integrating with the Ultimate device
Endpoint
Supported Content Types
1. Multipart Form Upload (multipart/form-data)
2. Raw Binary Upload (application/octet-stream)
3. Base64 JSON Upload (application/json)
Response
🔧 Configuration File
The config.json file provides default settings:
Note: Environment variables and command-line arguments take precedence over
config.json.
🛠️ API Reference
JSON-RPC Protocol
The server implements the Model Context Protocol (MCP) specification. All communication uses JSON-RPC 2.0.
Example: List Tools
Example: Call Tool
🔐 Security Considerations
The Docker container runs as a non-root user
Network access is required for the Ultimate device API
Consider running behind a reverse proxy for public deployments
Use environment variables for sensitive configuration
🐛 Troubleshooting
Connection Issues
Verify your Commodore 64 Ultimate is powered on and connected to the network
Check the IP address in the Ultimate menu (F2 → Network settings)
Ensure the REST API is enabled (it is by default)
Test connectivity:
curl http://<C64_HOST>/v1/version
"No C64 host configured" Error
This means no connection is set. Either:
Set the
C64_HOSTenvironment variablePass the URL as a command-line argument
Use the
ultimate_set_connectiontool after startup
Large File Uploads
For PRG files larger than ~100KB, consider:
Using the
/upload-prgREST endpoint directlyUsing the
urlparameter inultimate_run_prg_binaryto have the server fetch the file
📜 License
MIT License — see LICENSE for details.
🙏 Acknowledgments
Commodore — For bringing back the Commodore 64 with the official Commodore 64 Ultimate, particular Christian Simpson aka PeriFractic
Gideon Zweijtzer — Creator of the Ultimate 64 mainboard, Ultimate II+, and the entire 1541 Ultimate project. His incredible FPGA engineering powers the Commodore 64 Ultimate and has given the C64 community hardware that bridges vintage computing with modern convenience.
Anthropic — For the Model Context Protocol specification
The Commodore 64 community — Keeping the platform alive since 1982
🔗 Links
Gideon's Logic / Ultimate64.com — Home of the Ultimate hardware
Martijn Bosschaart
📧 martijn@runstoprestore.nl