c64-debug-mcp 1.0.7 → 1.0.9

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/README.md CHANGED
@@ -26,6 +26,25 @@ The MCP server accepts C64 addresses in multiple formats for natural interaction
26
26
 
27
27
  **Note**: Bare hex without prefix (e.g., `D000`) is NOT supported to avoid ambiguity with 4-digit decimals.
28
28
 
29
+ ### Range Support
30
+
31
+ Tools that read memory or set breakpoints support both **address+length** and **start+end** formats:
32
+
33
+ **Address + Length format** (original):
34
+ ```javascript
35
+ memory_read(address="$D000", length=256) // Read 256 bytes starting at $D000
36
+ breakpoint_set(kind="exec", address="$1000", length=1) // Breakpoint at $1000
37
+ ```
38
+
39
+ **Start + End format** (more intuitive for ranges):
40
+ ```javascript
41
+ memory_read(start="$D000", end="$D0FF") // Read from $D000 to $D0FF inclusive
42
+ memory_read(start=198, end=199) // Read addresses 198-199 (2 bytes)
43
+ breakpoint_set(kind="exec", start="$1000", end="$1000") // Breakpoint at $1000
44
+ ```
45
+
46
+ Both formats work with all address representations (decimal, $, 0x).
47
+
29
48
  **Common C64 Addresses**:
30
49
  - `$D000` - SID chip registers (sound)
31
50
  - `$D020` - Border color register
@@ -34,6 +53,24 @@ The MCP server accepts C64 addresses in multiple formats for natural interaction
34
53
  - `$0800` - Common program start
35
54
  - `$C000` - BASIC ROM start
36
55
 
56
+ ## Address Ranges
57
+
58
+ For operations that work with memory ranges (like `memory_read` and `breakpoint_set`), you can specify ranges in two ways:
59
+
60
+ **Option 1: Address + Length**
61
+ ```javascript
62
+ memory_read(address="$0400", length=256) // Read 256 bytes from $0400
63
+ breakpoint_set(kind="exec", address="$1000", length=16) // Break on $1000-$100F
64
+ ```
65
+
66
+ **Option 2: Start + End (inclusive)**
67
+ ```javascript
68
+ memory_read(start="$0400", end="$04FF") // Read from $0400 to $04FF (256 bytes)
69
+ breakpoint_set(kind="exec", start="$1000", end="$100F") // Break on $1000-$100F
70
+ ```
71
+
72
+ Both formats work identically and support all address formats (decimal, hex).
73
+
37
74
  ## Byte Value Formats
38
75
 
39
76
  The MCP server accepts byte values (0-255) in multiple formats for natural C64-style input:
package/dist/http.cjs CHANGED
@@ -3636,10 +3636,27 @@ var setRegistersTool = createViceTool({
3636
3636
  });
3637
3637
  var readMemoryTool = createViceTool({
3638
3638
  id: "memory_read",
3639
- description: "Reads a memory chunk by start address and length. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3640
- inputSchema: import_zod4.z.object({
3641
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3642
- length: import_zod4.z.number().int().positive().max(65535).describe("Size of the data chunk to read in bytes")
3639
+ description: "Reads a memory chunk. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3640
+ inputSchema: import_zod4.z.union([
3641
+ import_zod4.z.object({
3642
+ address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3643
+ length: import_zod4.z.number().int().positive().max(65535).describe("Number of bytes to read")
3644
+ }),
3645
+ import_zod4.z.object({
3646
+ start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3647
+ end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3648
+ })
3649
+ ]).transform((input) => {
3650
+ if ("start" in input && "end" in input) {
3651
+ if (input.end < input.start) {
3652
+ throw new Error("End address must be greater than or equal to start address");
3653
+ }
3654
+ return {
3655
+ address: input.start,
3656
+ length: input.end - input.start + 1
3657
+ };
3658
+ }
3659
+ return input;
3643
3660
  }).refine((input) => input.address + input.length <= 65536, {
3644
3661
  message: "address + length must stay within the 64K address space",
3645
3662
  path: ["length"]
@@ -3719,15 +3736,36 @@ var listBreakpointsTool = createViceTool({
3719
3736
  });
3720
3737
  var breakpointSetTool = createViceTool({
3721
3738
  id: "breakpoint_set",
3722
- description: "Creates an execution breakpoint or read/write watchpoint. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3739
+ description: "Creates an execution breakpoint or read/write watchpoint. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3723
3740
  inputSchema: import_zod4.z.object({
3724
3741
  kind: breakpointKindSchema,
3725
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3726
- length: import_zod4.z.number().int().positive().default(1).describe("Size of the breakpoint range in bytes"),
3727
3742
  condition: import_zod4.z.string().optional(),
3728
3743
  label: import_zod4.z.string().optional(),
3729
3744
  temporary: import_zod4.z.boolean().default(false),
3730
3745
  enabled: import_zod4.z.boolean().default(true)
3746
+ }).and(
3747
+ import_zod4.z.union([
3748
+ import_zod4.z.object({
3749
+ address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3750
+ length: import_zod4.z.number().int().positive().default(1).describe("Size of the breakpoint range in bytes")
3751
+ }),
3752
+ import_zod4.z.object({
3753
+ start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3754
+ end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3755
+ })
3756
+ ])
3757
+ ).transform((input) => {
3758
+ if ("start" in input && "end" in input) {
3759
+ if (input.end < input.start) {
3760
+ throw new Error("End address must be greater than or equal to start address");
3761
+ }
3762
+ return {
3763
+ ...input,
3764
+ address: input.start,
3765
+ length: input.end - input.start + 1
3766
+ };
3767
+ }
3768
+ return input;
3731
3769
  }),
3732
3770
  dataSchema: import_zod4.z.object({
3733
3771
  breakpoint: breakpointSchema,
package/dist/http.js CHANGED
@@ -3613,10 +3613,27 @@ var setRegistersTool = createViceTool({
3613
3613
  });
3614
3614
  var readMemoryTool = createViceTool({
3615
3615
  id: "memory_read",
3616
- description: "Reads a memory chunk by start address and length. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3617
- inputSchema: z3.object({
3618
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3619
- length: z3.number().int().positive().max(65535).describe("Size of the data chunk to read in bytes")
3616
+ description: "Reads a memory chunk. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3617
+ inputSchema: z3.union([
3618
+ z3.object({
3619
+ address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3620
+ length: z3.number().int().positive().max(65535).describe("Number of bytes to read")
3621
+ }),
3622
+ z3.object({
3623
+ start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3624
+ end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3625
+ })
3626
+ ]).transform((input) => {
3627
+ if ("start" in input && "end" in input) {
3628
+ if (input.end < input.start) {
3629
+ throw new Error("End address must be greater than or equal to start address");
3630
+ }
3631
+ return {
3632
+ address: input.start,
3633
+ length: input.end - input.start + 1
3634
+ };
3635
+ }
3636
+ return input;
3620
3637
  }).refine((input) => input.address + input.length <= 65536, {
3621
3638
  message: "address + length must stay within the 64K address space",
3622
3639
  path: ["length"]
@@ -3696,15 +3713,36 @@ var listBreakpointsTool = createViceTool({
3696
3713
  });
3697
3714
  var breakpointSetTool = createViceTool({
3698
3715
  id: "breakpoint_set",
3699
- description: "Creates an execution breakpoint or read/write watchpoint. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3716
+ description: "Creates an execution breakpoint or read/write watchpoint. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3700
3717
  inputSchema: z3.object({
3701
3718
  kind: breakpointKindSchema,
3702
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3703
- length: z3.number().int().positive().default(1).describe("Size of the breakpoint range in bytes"),
3704
3719
  condition: z3.string().optional(),
3705
3720
  label: z3.string().optional(),
3706
3721
  temporary: z3.boolean().default(false),
3707
3722
  enabled: z3.boolean().default(true)
3723
+ }).and(
3724
+ z3.union([
3725
+ z3.object({
3726
+ address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3727
+ length: z3.number().int().positive().default(1).describe("Size of the breakpoint range in bytes")
3728
+ }),
3729
+ z3.object({
3730
+ start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3731
+ end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3732
+ })
3733
+ ])
3734
+ ).transform((input) => {
3735
+ if ("start" in input && "end" in input) {
3736
+ if (input.end < input.start) {
3737
+ throw new Error("End address must be greater than or equal to start address");
3738
+ }
3739
+ return {
3740
+ ...input,
3741
+ address: input.start,
3742
+ length: input.end - input.start + 1
3743
+ };
3744
+ }
3745
+ return input;
3708
3746
  }),
3709
3747
  dataSchema: z3.object({
3710
3748
  breakpoint: breakpointSchema,
package/dist/stdio.cjs CHANGED
@@ -3633,10 +3633,27 @@ var setRegistersTool = createViceTool({
3633
3633
  });
3634
3634
  var readMemoryTool = createViceTool({
3635
3635
  id: "memory_read",
3636
- description: "Reads a memory chunk by start address and length. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3637
- inputSchema: import_zod4.z.object({
3638
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3639
- length: import_zod4.z.number().int().positive().max(65535).describe("Size of the data chunk to read in bytes")
3636
+ description: "Reads a memory chunk. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3637
+ inputSchema: import_zod4.z.union([
3638
+ import_zod4.z.object({
3639
+ address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3640
+ length: import_zod4.z.number().int().positive().max(65535).describe("Number of bytes to read")
3641
+ }),
3642
+ import_zod4.z.object({
3643
+ start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3644
+ end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3645
+ })
3646
+ ]).transform((input) => {
3647
+ if ("start" in input && "end" in input) {
3648
+ if (input.end < input.start) {
3649
+ throw new Error("End address must be greater than or equal to start address");
3650
+ }
3651
+ return {
3652
+ address: input.start,
3653
+ length: input.end - input.start + 1
3654
+ };
3655
+ }
3656
+ return input;
3640
3657
  }).refine((input) => input.address + input.length <= 65536, {
3641
3658
  message: "address + length must stay within the 64K address space",
3642
3659
  path: ["length"]
@@ -3716,15 +3733,36 @@ var listBreakpointsTool = createViceTool({
3716
3733
  });
3717
3734
  var breakpointSetTool = createViceTool({
3718
3735
  id: "breakpoint_set",
3719
- description: "Creates an execution breakpoint or read/write watchpoint. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3736
+ description: "Creates an execution breakpoint or read/write watchpoint. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3720
3737
  inputSchema: import_zod4.z.object({
3721
3738
  kind: breakpointKindSchema,
3722
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3723
- length: import_zod4.z.number().int().positive().default(1).describe("Size of the breakpoint range in bytes"),
3724
3739
  condition: import_zod4.z.string().optional(),
3725
3740
  label: import_zod4.z.string().optional(),
3726
3741
  temporary: import_zod4.z.boolean().default(false),
3727
3742
  enabled: import_zod4.z.boolean().default(true)
3743
+ }).and(
3744
+ import_zod4.z.union([
3745
+ import_zod4.z.object({
3746
+ address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3747
+ length: import_zod4.z.number().int().positive().default(1).describe("Size of the breakpoint range in bytes")
3748
+ }),
3749
+ import_zod4.z.object({
3750
+ start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3751
+ end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3752
+ })
3753
+ ])
3754
+ ).transform((input) => {
3755
+ if ("start" in input && "end" in input) {
3756
+ if (input.end < input.start) {
3757
+ throw new Error("End address must be greater than or equal to start address");
3758
+ }
3759
+ return {
3760
+ ...input,
3761
+ address: input.start,
3762
+ length: input.end - input.start + 1
3763
+ };
3764
+ }
3765
+ return input;
3728
3766
  }),
3729
3767
  dataSchema: import_zod4.z.object({
3730
3768
  breakpoint: breakpointSchema,
package/dist/stdio.js CHANGED
@@ -3610,10 +3610,27 @@ var setRegistersTool = createViceTool({
3610
3610
  });
3611
3611
  var readMemoryTool = createViceTool({
3612
3612
  id: "memory_read",
3613
- description: "Reads a memory chunk by start address and length. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3614
- inputSchema: z3.object({
3615
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3616
- length: z3.number().int().positive().max(65535).describe("Size of the data chunk to read in bytes")
3613
+ description: "Reads a memory chunk. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000). Returns byte values as decimal numbers.",
3614
+ inputSchema: z3.union([
3615
+ z3.object({
3616
+ address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3617
+ length: z3.number().int().positive().max(65535).describe("Number of bytes to read")
3618
+ }),
3619
+ z3.object({
3620
+ start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3621
+ end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3622
+ })
3623
+ ]).transform((input) => {
3624
+ if ("start" in input && "end" in input) {
3625
+ if (input.end < input.start) {
3626
+ throw new Error("End address must be greater than or equal to start address");
3627
+ }
3628
+ return {
3629
+ address: input.start,
3630
+ length: input.end - input.start + 1
3631
+ };
3632
+ }
3633
+ return input;
3617
3634
  }).refine((input) => input.address + input.length <= 65536, {
3618
3635
  message: "address + length must stay within the 64K address space",
3619
3636
  path: ["length"]
@@ -3693,15 +3710,36 @@ var listBreakpointsTool = createViceTool({
3693
3710
  });
3694
3711
  var breakpointSetTool = createViceTool({
3695
3712
  id: "breakpoint_set",
3696
- description: "Creates an execution breakpoint or read/write watchpoint. Address can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3713
+ description: "Creates an execution breakpoint or read/write watchpoint. Use either (address, length) or (start, end) format. Addresses can be decimal (53248) or hex string with prefix ($D000, 0xD000).",
3697
3714
  inputSchema: z3.object({
3698
3715
  kind: breakpointKindSchema,
3699
- address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3700
- length: z3.number().int().positive().default(1).describe("Size of the breakpoint range in bytes"),
3701
3716
  condition: z3.string().optional(),
3702
3717
  label: z3.string().optional(),
3703
3718
  temporary: z3.boolean().default(false),
3704
3719
  enabled: z3.boolean().default(true)
3720
+ }).and(
3721
+ z3.union([
3722
+ z3.object({
3723
+ address: address16Schema.describe("Start address: decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3724
+ length: z3.number().int().positive().default(1).describe("Size of the breakpoint range in bytes")
3725
+ }),
3726
+ z3.object({
3727
+ start: address16Schema.describe("Start address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)"),
3728
+ end: address16Schema.describe("End address (inclusive): decimal (53248) or hex string with prefix ($D000, 0xD000)")
3729
+ })
3730
+ ])
3731
+ ).transform((input) => {
3732
+ if ("start" in input && "end" in input) {
3733
+ if (input.end < input.start) {
3734
+ throw new Error("End address must be greater than or equal to start address");
3735
+ }
3736
+ return {
3737
+ ...input,
3738
+ address: input.start,
3739
+ length: input.end - input.start + 1
3740
+ };
3741
+ }
3742
+ return input;
3705
3743
  }),
3706
3744
  dataSchema: z3.object({
3707
3745
  breakpoint: breakpointSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c64-debug-mcp",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Model Context Protocol server for C64 debugging via VICE emulator",
5
5
  "type": "module",
6
6
  "keywords": [