# C64 Bridge

An MCP server that lets an AI client run programs, poke memory, draw graphics and play sound on a Commodore 64, either on real hardware or in VICE.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 40
- Author: chrisgleissner
- License: GPL-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/chrisgleissner/c64bridge
- Updated: 2026-10-15
- HTML: https://affpapa.org/en/nevibecode/mcp/c64-bridge

## What it does

C64 Bridge exposes the Commodore 64 to an agent as a set of grouped MCP tools: `c64_program`, `c64_memory`, `c64_graphics`, `c64_sound` and others. Through them the client runs BASIC, 6510 assembly, PRG and CRT images, reaches into memory, puts pictures on screen and plays audio. Hardware targets are the C64 Ultimate, Ultimate 64 and U2-family cartridges; VICE emulator sessions work too. With both configured, `c64_select_backend` moves between them at runtime, so hardware and emulation fit in one conversation.

The server uses the official TypeScript `@modelcontextprotocol/sdk` and speaks `stdio` for local integration. An optional HTTP bridge is there for manual inspection. Resources and prompts ship alongside the tools.

Node.js 24+ and npm are needed before starting. The backend is chosen through environment variables such as `C64_MODE`, `C64U_HOST`, `C64U_PORT` and the VICE binary path. Point one of those at the wrong place and the connection simply fails. If your C64 work belongs next to your code, this keeps it in the same window.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `LOG_LEVEL`, `C64BRIDGE_CONFIG`, `C64_MODE`, `C64U_HOST`, `C64U_PORT`, `C64U_PASSWORD`, `VICE_BINARY`, `VICE_VISIBLE`, `VICE_WARP`, `GITHUB_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env LOG_LEVEL=<LOG_LEVEL> --env C64BRIDGE_CONFIG=<C64BRIDGE_CONFIG> --env C64_MODE=<C64_MODE> --env C64U_HOST=<C64U_HOST> --env C64U_PORT=<C64U_PORT> --transport stdio c64-bridge -- npx -y c64bridge
```
Replace <…> with your own values. 5 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add c64-bridge --env LOG_LEVEL=<LOG_LEVEL> --env C64BRIDGE_CONFIG=<C64BRIDGE_CONFIG> --env C64_MODE=<C64_MODE> --env C64U_HOST=<C64U_HOST> --env C64U_PORT=<C64U_PORT> -- npx -y c64bridge
```
Replace <…> with your own values. 5 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "c64-bridge": {
            "command": "npx",
            "args": [
                "-y",
                "c64bridge"
            ],
            "env": {
                "LOG_LEVEL": "<LOG_LEVEL>",
                "C64BRIDGE_CONFIG": "<C64BRIDGE_CONFIG>",
                "C64_MODE": "<C64_MODE>",
                "C64U_HOST": "<C64U_HOST>",
                "C64U_PORT": "<C64U_PORT>"
            }
        }
    }
}
```
Replace <…> with your own values. 5 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "c64-bridge": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "c64bridge"
            ],
            "env": {
                "LOG_LEVEL": "<LOG_LEVEL>",
                "C64BRIDGE_CONFIG": "<C64BRIDGE_CONFIG>",
                "C64_MODE": "<C64_MODE>",
                "C64U_HOST": "<C64U_HOST>",
                "C64U_PORT": "<C64U_PORT>"
            }
        }
    }
}
```
Replace <…> with your own values. 5 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LOG_LEVEL=<LOG_LEVEL> -e C64BRIDGE_CONFIG=<C64BRIDGE_CONFIG> -e C64_MODE=<C64_MODE> -e C64U_HOST=<C64U_HOST> -e C64U_PORT=<C64U_PORT> c64-bridge npx -y c64bridge
```
Replace <…> with your own values. 5 more environment variables are in the server README

## When to use it
- Run a BASIC listing on a real Commodore 64 from the chat
- Dump and patch a memory block on hardware or in VICE
- Render a picture and push it to the C64 screen
- Play a SID tune through the emulator
- Move a session from hardware to VICE without restarting

## Example prompts
- Run this PRG on the C64 Ultimate and show me the screen
- Read the memory at that address and print a hex dump
- Render a picture with `c64_graphics` and put it on screen

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
