mcp-c64
Provides tools for assembling 6502 assembly language programs, tokenizing BASIC programs, and running them in an emulator, all targeting the Commodore 64 platform.
Click on "Install 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., "@mcp-c64assemble hello.asm and run 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.
mcp-c64

An MCP server for developing BASIC and Assembly Language programs for the Commodore 64
Optimal C64 development stack
REPL - A minimal command line client for interacting directly with the MCP server.
MCP Server working with the ability to:
Assemble 6502 assembly language programs to .prg format
Tokenize BASIC programs to .prg format
Launch and run .prg format programs in the emulator
REQUIREMENTS
Install
Node + npm - Javascript runtime environment
Install the latest stable Node release (comes with npm).
VICE - The Versatile Commodore Emulator
Read the Manual
Includes emulator and tokenizer/detokenizer (petcat)
64Tass - The 6502 assembler for C64
Read the Manual
Install
MacOSX -
brew install tass64Windows - Download the latest binary
Configure
Create .env file
Create file
.envin the root of your project.If you have downloaded the project source, you can copy
.env-example
Add / modify vars
ASSEMBLER- pointing to the64tassassembler executable (full path if not in PATH)TOKENIZER- pointing to thepetcattokenizer executable (full path if not in PATH)EMULATOR- pointing to thex64scemulator executable (full path if not in PATH)ASM_PATH- pointing to your assembly source folderBASIC_PATH- pointing to your basic source folder
Example .env file
ASSEMBLER=64tass
TOKENIZER=/Users/zaphod/vice/bin/petcat
EMULATOR=/Users/zaphod/vice/x64sc.app/Contents/MacOS/x64sc
ASM_PATH=./asm/hello
BASIC_PATH=./basic/tokenExample mcp.json file for Cursor
{
"mcpServers": {
"mcp-c64": {
"command": "npx",
"args": ["-y", "mcp-c64"],
"env": {
"ASSEMBLER": "64tass",
"TOKENIZER": "/Users/zaphod/vice/bin/petcat",
"EMULATOR": "/Users/zaphod/vice/x64sc.app/Contents/MacOS/x64sc",
"ASM_PATH": "/Users/zaphod/Projects/retro-game/asm/",
"BASIC_PATH": "/Users/zaphod/Projects/retro-game/basic/"
}
}
}
}Example mcp.json file for VSCode
{
"mcp": {
"servers": {
"mcp-c64": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-c64"
],
"env": {
"ASSEMBLER": "64tass",
"TOKENIZER": "/Users/zaphod/vice/bin/petcat",
"EMULATOR": "/Users/zaphod/vice/x64sc.app/Contents/MacOS/x64sc",
"ASM_PATH": "/Users/zaphod/Projects/retro-game/asm/",
"BASIC_PATH": "/Users/zaphod/Projects/retro-game/basic/"
}
}
}
}
}Example configuration for Github Copilot
{
"servers": {
"mcp-c64": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-c64"],
"env": {
"ASSEMBLER": "64tass",
"TOKENIZER": "/Users/zaphod/vice/bin/petcat",
"EMULATOR": "/Users/zaphod/vice/x64sc.app/Contents/MacOS/x64sc",
"ASM_PATH": "/Users/zaphod/Projects/retro-game/asm/",
"BASIC_PATH": "/Users/zaphod/Projects/retro-game/basic/"
}
}
}
}The REPL
A minimal MCP Client which allows you to interact with the mcp-c64 server. It doesn't invoke LLMs but rather allows you to invoke the tools as an LLM would.
Running the REPL
Invoke with
npm run replYou will see a menu of available commands.
MCP Interactive Client
=====================
Connected to mcp-c64 server via STDIO transport
Available commands:
help - Show this help
list-tools - List available tools
call-tool <name> [args] - Call a tool with optional JSON arguments
quit - Exit the program
> The list-tools command
Lists the available tools in the MCP server.
These are the tools that the LLM could call, and the descriptions it would see
> list-tools
Available tools:
- assemble_program: Assemble an assembly language program.
Only the .asm source filename is required in file parameter, output .prg and .map files will be generated.
Any additional args such as -a, -cbm-prg, etc. should be supplied in an array in the args parameter.
- tokenize_program: Tokenize a BASIC program.
Only the .bas source filename is required in file parameter, output .prg file will be generated.
Any additional args such as -w2, etc. should be supplied in an array in the args parameter.
- run_program: Run an assembled or tokenized program.
The .prg filename is required in file parameter, and the program's path is required in path parameter.
Any additional args such as -console, etc. should be supplied in an array in the args parameter.
>The call-tool command
Allows you to call a tool on the MCP server just as the LLM would
You pass the tool name and its arguments as a JSON string
assemble_program tool
Uses
64tassto assemble a 6502 assembly language programTo target the Commodore 64 using Unicode or standard ASCII input, include the
-aand-cbm-prgargumentsRefer to the
64tasscommand line options reference for more info on configuring the assembler behaviors
> call-tool assemble_program {"file":"hello_world.asm", "args": ["-a", "--cbm-prg"]}
Calling tool 'assemble_program' with args: { file: 'hello_world.asm', args: [ '-a', '--cbm-prg' ] }
Tool result:
{
output: '64tass Turbo Assembler Macro V1.60.3243\n' +
'64TASS comes with ABSOLUTELY NO WARRANTY; This is free software, and you\n' +
'are welcome to redistribute it under certain conditions; See LICENSE!\n' +
'\n' +
'Assembling file: asm/hello/hello_world.asm\n' +
'Output file: asm/hello/hello_world.prg\n' +
'Passes: 2\n',
error: '',
status: 0
}
>tokenize_program tool
Uses the
petcatcommand included with the VICE emulatorTo tokenize a Unicode or standard ASCII file for the Commodore 64, include the
-w2argumentSee the
petcatcommand line options reference for more info on configuring the tokenizer input and output behaviorSee the C64-Wiki for PETSCII control characters that can be used in BASIC strings for such things as cursor movement and character color
> call-tool tokenize_program {"file":"token_test.bas", "args": ["-w2","-v"]}}
Calling tool 'tokenize_program' with args: { file: 'token_test.bas', args: [ '-w2', '-v' ] }
Tool result:
{
output: '/Users/zaphod/Projects/retro-game\n',
error: '\nLoad address 0801\nControl code set: enabled\n\n',
status: 0
}
> run_program tool
Uses the
x64scexecutable included with the VICE emulator packageTo take a screenshot on exit, include the
-exitscreenshotargument followed by a file name argumentSee the
x64sccommand line options reference for more info on configuring the emulator behavior
> call-tool run_program {"file":"token_test.prg", "path":"/Users/zaphod/Projects/retro-game/basic/token", "args": ["-exitscreenshot","token_test.png"]}
Calling tool 'run_program' with args: {
file: 'token_test.prg',
path: '/Users/zaphod/Projects/retro-game/basic/token',
args: [ '-exitscreenshot', 'token_test.png' ]
}
Tool result:
{ output: '', error: '', status: 0 }
> This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cliffhall/mcp-c64'
If you have feedback or need assistance with the MCP directory API, please join our Discord server