c64-debug-mcp 0.1.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +16 -207
- package/package.json +4 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Henrik Olsson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/c64-debug-mcp)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Debug Commodore 64 programs through conversation - AI-powered control of the VICE emulator for 6502 assembly and BASIC.
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
@@ -17,47 +17,22 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that en
|
|
|
17
17
|
|
|
18
18
|
## Requirements
|
|
19
19
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
- Supports: x64sc (C64), x128 (C128), xvic (VIC-20), xpet (PET), and others
|
|
20
|
+
- Node.js >= 22.13.0
|
|
21
|
+
- VICE Emulator (https://vice-emu.sourceforge.io/)
|
|
22
|
+
- MCP-compatible AI assistant (Claude Code, Codex, Windsurf, etc.)
|
|
24
23
|
|
|
25
24
|
## Installation
|
|
26
25
|
|
|
27
|
-
### Option 1: No Installation (Recommended)
|
|
28
|
-
|
|
29
|
-
Use `npx` to automatically run the latest version without installing:
|
|
30
|
-
|
|
31
|
-
**No setup required!** Just configure Claude Desktop (see below).
|
|
32
|
-
|
|
33
|
-
### Option 2: Global Installation
|
|
34
|
-
|
|
35
26
|
```bash
|
|
36
|
-
|
|
27
|
+
claude mcp add c64debug -- npx -y c64-debug-mcp
|
|
37
28
|
```
|
|
38
29
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
npm install c64-debug-mcp
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Usage
|
|
46
|
-
|
|
47
|
-
### With Claude Desktop
|
|
48
|
-
|
|
49
|
-
Add to your Claude Desktop configuration file:
|
|
50
|
-
|
|
51
|
-
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
52
|
-
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
53
|
-
**Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
54
|
-
|
|
55
|
-
#### Recommended: Using npx (no installation, always latest)
|
|
30
|
+
Or add manually to your MCP client config:
|
|
56
31
|
|
|
57
32
|
```json
|
|
58
33
|
{
|
|
59
34
|
"mcpServers": {
|
|
60
|
-
"
|
|
35
|
+
"c64debug": {
|
|
61
36
|
"command": "npx",
|
|
62
37
|
"args": ["-y", "c64-debug-mcp"]
|
|
63
38
|
}
|
|
@@ -65,95 +40,16 @@ Add to your Claude Desktop configuration file:
|
|
|
65
40
|
}
|
|
66
41
|
```
|
|
67
42
|
|
|
68
|
-
#### Alternative: Using global installation
|
|
69
|
-
|
|
70
|
-
```json
|
|
71
|
-
{
|
|
72
|
-
"mcpServers": {
|
|
73
|
-
"c64-debug": {
|
|
74
|
-
"command": "c64-debug-mcp"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### With Other MCP Clients
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
# STDIO mode (for Claude Desktop and similar clients)
|
|
84
|
-
c64-debug-mcp
|
|
85
|
-
|
|
86
|
-
# HTTP mode (for web-based clients)
|
|
87
|
-
c64-debug-mcp-http
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### HTTP Server Configuration
|
|
91
|
-
|
|
92
|
-
The HTTP server can be configured via environment variables:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
C64_DEBUG_HTTP_HOST=127.0.0.1 # Default: 127.0.0.1
|
|
96
|
-
C64_DEBUG_HTTP_PORT=39080 # Default: 39080
|
|
97
|
-
C64_DEBUG_HTTP_PATH=/mcp # Default: /mcp
|
|
98
|
-
C64_DEBUG_HTTP_HEALTH_PATH=/healthz # Default: /healthz
|
|
99
|
-
```
|
|
100
|
-
|
|
101
43
|
## Quick Start
|
|
102
44
|
|
|
103
|
-
1.
|
|
104
|
-
```bash
|
|
105
|
-
x64sc -remotemonitor -remotemonitoraddress 127.0.0.1:6502
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
2. **Configure Claude Desktop** (add to config file):
|
|
109
|
-
```json
|
|
110
|
-
{
|
|
111
|
-
"mcpServers": {
|
|
112
|
-
"c64-debug": {
|
|
113
|
-
"command": "npx",
|
|
114
|
-
"args": ["-y", "c64-debug-mcp"]
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
```
|
|
45
|
+
1. Add MCP server (see Installation above)
|
|
119
46
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
4. **Ask Claude to interact with C64**:
|
|
47
|
+
2. Ask your AI assistant to interact with C64:
|
|
123
48
|
- "What's in memory at $D000?"
|
|
124
49
|
- "Set a breakpoint at $1000"
|
|
125
50
|
- "Load and run my program.prg"
|
|
126
|
-
- "Show me the screen content"
|
|
127
|
-
|
|
128
|
-
## Available Tools
|
|
129
|
-
|
|
130
|
-
### Execution Control
|
|
131
|
-
- `execute` - Pause, resume, step, step_over, step_out, or reset
|
|
132
|
-
- `wait_for_state` - Wait for running/stopped state
|
|
133
|
-
- `program_load` - Load PRG files with optional auto-start
|
|
134
|
-
|
|
135
|
-
### Memory Operations
|
|
136
|
-
- `memory_read` - Read memory by address and length
|
|
137
|
-
- `memory_write` - Write bytes to memory
|
|
138
|
-
- `get_registers` - Get CPU register values
|
|
139
|
-
- `set_registers` - Set CPU register values
|
|
140
51
|
|
|
141
|
-
|
|
142
|
-
- `breakpoint_set` - Create execution or watchpoint breakpoints
|
|
143
|
-
- `breakpoint_clear` - Remove a breakpoint
|
|
144
|
-
- `list_breakpoints` - List all breakpoints
|
|
145
|
-
|
|
146
|
-
### Display & Input
|
|
147
|
-
- `capture_display` - Capture screen to PNG
|
|
148
|
-
- `get_display_state` - Get screen RAM, color RAM, and graphics mode
|
|
149
|
-
- `get_display_text` - Get text screen content
|
|
150
|
-
- `write_text` - Type text with PETSCII support
|
|
151
|
-
- `keyboard_input` - Send key presses/releases/taps
|
|
152
|
-
- `joystick_input` - Send joystick commands
|
|
153
|
-
|
|
154
|
-
### State Monitoring
|
|
155
|
-
- `get_monitor_state` - Get execution state and stop reason
|
|
156
|
-
- `get_session_state` - Get detailed emulator session state
|
|
52
|
+
**Important:** The MCP server launches and controls VICE automatically. Your AI assistant owns the emulator process and can reset or restart it at any time. Don't use VICE manually or create valuable work in the emulator while debugging - any unsaved state may be lost when it resets the machine.
|
|
157
53
|
|
|
158
54
|
## Example Workflows
|
|
159
55
|
|
|
@@ -162,7 +58,7 @@ C64_DEBUG_HTTP_HEALTH_PATH=/healthz # Default: /healthz
|
|
|
162
58
|
```
|
|
163
59
|
You: Load examples/hello.prg and set a breakpoint at $1000
|
|
164
60
|
|
|
165
|
-
|
|
61
|
+
AI assistant will:
|
|
166
62
|
1. Load the program using program_load
|
|
167
63
|
2. Set a breakpoint at $1000 using breakpoint_set
|
|
168
64
|
3. Resume execution until breakpoint is hit
|
|
@@ -174,7 +70,7 @@ Claude will:
|
|
|
174
70
|
```
|
|
175
71
|
You: What's the BASIC program in memory?
|
|
176
72
|
|
|
177
|
-
|
|
73
|
+
AI assistant will:
|
|
178
74
|
1. Read memory from $0801 (BASIC start)
|
|
179
75
|
2. Parse the BASIC tokens
|
|
180
76
|
3. Show you the program listing
|
|
@@ -185,103 +81,16 @@ Claude will:
|
|
|
185
81
|
```
|
|
186
82
|
You: Show me what's on the screen
|
|
187
83
|
|
|
188
|
-
|
|
84
|
+
AI assistant will:
|
|
189
85
|
1. Capture the display using capture_display
|
|
190
86
|
2. Save a PNG image
|
|
191
87
|
3. Describe what's visible
|
|
192
88
|
```
|
|
193
89
|
|
|
194
|
-
## Configuration
|
|
195
|
-
|
|
196
|
-
### Environment Variables
|
|
197
|
-
|
|
198
|
-
- `C64_DEBUG_CONSOLE_LOGS` - Enable verbose logging (1, true, yes, on)
|
|
199
|
-
- `C64_DEBUG_SERVER_NODE` - Path to Node.js executable for smoke tests
|
|
200
|
-
- `C64_DEBUG_HTTP_*` - HTTP server configuration (see above)
|
|
201
|
-
|
|
202
|
-
### VICE Connection
|
|
203
|
-
|
|
204
|
-
The MCP server connects to VICE on `localhost:6502` by default. Ensure VICE is started with:
|
|
205
|
-
|
|
206
|
-
```bash
|
|
207
|
-
x64sc -remotemonitor -remotemonitoraddress 127.0.0.1:6502
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
Or add to your `~/.vice/vicerc`:
|
|
211
|
-
|
|
212
|
-
```
|
|
213
|
-
RemoteMonitor=1
|
|
214
|
-
RemoteMonitorAddress=127.0.0.1:6502
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
## Troubleshooting
|
|
218
|
-
|
|
219
|
-
### "Cannot connect to VICE"
|
|
220
|
-
- Ensure VICE is running with `-remotemonitor` flag
|
|
221
|
-
- Check that port 6502 is not blocked by firewall
|
|
222
|
-
- Verify VICE is listening: `netstat -an | grep 6502`
|
|
223
|
-
|
|
224
|
-
### "Command not found: c64-debug-mcp"
|
|
225
|
-
- Ensure global npm bin directory is in PATH: `npm config get prefix`
|
|
226
|
-
- Or use npx: `npx c64-debug-mcp`
|
|
227
|
-
|
|
228
|
-
### Node version errors
|
|
229
|
-
- This package requires Node.js >= 22.13.0
|
|
230
|
-
- Check version: `node --version`
|
|
231
|
-
- Install latest: https://nodejs.org/
|
|
232
|
-
|
|
233
|
-
## Development
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
# Clone repository
|
|
237
|
-
git clone https://github.com/henols/c64-debug-mcp.git
|
|
238
|
-
cd c64-debug-mcp/packages/c64-debug-mcp
|
|
239
|
-
|
|
240
|
-
# Install dependencies
|
|
241
|
-
npm install
|
|
242
|
-
|
|
243
|
-
# Build
|
|
244
|
-
npm run build
|
|
245
|
-
|
|
246
|
-
# Run tests
|
|
247
|
-
npm run smoke:http
|
|
248
|
-
|
|
249
|
-
# Type check
|
|
250
|
-
npm run check
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
## Architecture
|
|
254
|
-
|
|
255
|
-
- **TypeScript** with strict type checking
|
|
256
|
-
- **Zod** for schema validation
|
|
257
|
-
- **Mastra MCP** framework for protocol implementation
|
|
258
|
-
- **VICE Binary Monitor Protocol** for emulator communication
|
|
259
|
-
|
|
260
|
-
## Contributing
|
|
261
|
-
|
|
262
|
-
Contributions are welcome! Please:
|
|
263
|
-
|
|
264
|
-
1. Fork the repository
|
|
265
|
-
2. Create a feature branch
|
|
266
|
-
3. Make your changes with tests
|
|
267
|
-
4. Submit a pull request
|
|
268
|
-
|
|
269
90
|
## License
|
|
270
91
|
|
|
271
|
-
MIT
|
|
272
|
-
|
|
273
|
-
## Resources
|
|
274
|
-
|
|
275
|
-
- [Model Context Protocol Specification](https://spec.modelcontextprotocol.io/)
|
|
276
|
-
- [VICE Emulator](https://vice-emu.sourceforge.io/)
|
|
277
|
-
- [VICE Binary Monitor Protocol](https://vice-emu.sourceforge.io/vice_13.html#SEC338)
|
|
278
|
-
- [Smithery MCP Registry](https://smithery.ai/)
|
|
279
|
-
|
|
280
|
-
## Acknowledgments
|
|
281
|
-
|
|
282
|
-
Built with the [Model Context Protocol](https://modelcontextprotocol.io) by Anthropic.
|
|
283
|
-
Powered by [VICE](https://vice-emu.sourceforge.io/) - the Versatile Commodore Emulator.
|
|
92
|
+
MIT - see [LICENSE](LICENSE) file
|
|
284
93
|
|
|
285
|
-
|
|
94
|
+
**Made with ❤️ for C64 developers and AI-assisted retro coding**
|
|
286
95
|
|
|
287
|
-
|
|
96
|
+
*"The C64 never gets old, it just gets smarter" 🎮*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c64-debug-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Model Context Protocol server for C64 debugging via VICE emulator",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/henols/c64-debug-mcp.git"
|
|
20
|
-
"directory": "packages/c64-debug-mcp"
|
|
19
|
+
"url": "git+https://github.com/henols/c64-debug-mcp.git"
|
|
21
20
|
},
|
|
22
21
|
"bugs": "https://github.com/henols/c64-debug-mcp/issues",
|
|
23
22
|
"homepage": "https://github.com/henols/c64-debug-mcp#readme",
|
|
@@ -39,7 +38,8 @@
|
|
|
39
38
|
"build": "tsup src/stdio.ts src/http.ts --format esm,cjs --dts --no-splitting --clean",
|
|
40
39
|
"check": "tsc --noEmit",
|
|
41
40
|
"prepublishOnly": "npm run build && npm run check",
|
|
42
|
-
"dev:http": "C64_DEBUG_CONSOLE_LOGS=1 /home/henrik/.nvm/versions/node/v22.13.0/bin/node
|
|
41
|
+
"dev:http": "C64_DEBUG_CONSOLE_LOGS=1 /home/henrik/.nvm/versions/node/v22.13.0/bin/node node_modules/tsx/dist/cli.mjs watch src/http.ts",
|
|
42
|
+
"release": "bash scripts/release.sh"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@mastra/core": "^1.15.0",
|