Skip to main content
Glama
NecroVM 8080 MCP Agent Debugger

NecroVM 8080 MCP Agent Debugger

by Khanhtnq
README.md
# NecroVM 8080: Resurrecting 1974 CP/M Silicon Stitched to Modern MCP Agent Debugging

[![Devpost Kiroween 2026](https://img.shields.io/badge/Devpost-Kiroween%202026-ff6600.svg)](https://kiroween.devpost.com/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Tests: 18/18 Passing](https://img.shields.io/badge/Tests-18%2F18%20Passing-brightgreen.svg)](tests/test_8080.mjs)
[![Zero Dependencies](https://img.shields.io/badge/Dependencies-Zero-blue.svg)](package.json)

> **"Resurrecting 1974 Silicon with 2026 AI Agent Telemetry"**  
> A cycle-accurate Intel 8080 CPU and Digital Research CP/M 2.2 BDOS emulator stitched to Anthropic Model Context Protocol (MCP) tool endpoints inside an authentic green/amber CRT phosphor terminal.

![NecroVM 8080 Banner](assets/thumbnail_1280x800.png)

---

## šŸ† Devpost Kiroween 2026 Official Tracks
- **Best Resurrection ($5,000 USD)**: Faithful silicon restoration of the 1974 Intel 8080 8-bit microprocessor, hardware PSW flags (`[SZ0A0P1C]`), accurate T-state cycles, and Digital Research CP/M 2.2 BDOS syscall trap (`0x0005`).
- **Best Frankenstein ($5,000 USD)**: Stitching 52-year-old CP/M silicon to bleeding-edge 2026 Model Context Protocol (MCP) AI agents via JSON-RPC 2.0 tool definitions (`necro_inspect_registers`, `necro_step_cycles`, `necro_set_breakpoint`, `necro_read_memory_dump`, `necro_assemble_and_load`).
- **Best Costume Contest ($5,000 USD)**: Dual-phosphor P31 Green / P20 Amber CRT styling with scanline shaders, tube curvature, real-time register telemetry, and CP/M console screen.
- **Overall Grand Prize ($30,000 USD)**: Zero external runtime npm dependencies, 100% test coverage across 18 unit/integration tests, pure ES modules running in Node.js and web browsers.

---

## šŸ›ļø Architecture & System Map

```
+-------------------------------------------------------------+
|                2026 AI Agent Ecosystem (MCP)                |
|  necro_inspect_registers | necro_step_cycles | necro_dump    |
+------------------------------+------------------------------+
                               | JSON-RPC 2.0 (Stdio/WS)
+------------------------------v------------------------------+
|                   NecroVM 8080 Engine Core                  |
|                                                             |
|  +-----------------------+     +-------------------------+  |
|  | Intel 8080 CPU Core   |     | CP/M 2.2 BDOS Subsystem |  |
|  | - 64KB RAM (Uint8)    |     | - Trap Vector 0x0005    |  |
|  | - Cycle-accurate ALU  |     | - Console BDOS I/O      |  |
|  | - S, Z, AC, P, CY PSW |     | - Virtual Disk & DMA    |  |
|  +-----------+-----------+     +------------+------------+  |
|              |                              |               |
|  +-----------v------------------------------v------------+  |
|  |             Two-Pass Intel 8080 Macro Assembler        |  |
|  |             Labels, EQU, ORG, DB, DW, Directives       |  |
|  +-------------------------------------------------------+  |
+------------------------------+------------------------------+
                               | Reactive DOM & Audio
+------------------------------v------------------------------+
|              Haunting CRT Phosphor Terminal Web UI          |
|    - P31 Green / P20 Amber  - Live Hex Dump  - Disassembly  |
+-------------------------------------------------------------+
```

---

## ⚔ Quickstart

### 1. Run Automated Test Suite
Ensure Node.js 18+ is installed. Zero `npm install` needed!
```bash
npm test
# Or directly:
node --test tests/test_8080.mjs
```
Output:
```
ā–¶ Intel 8080 CPU Core Test Suite
  āœ” Test 01: NOP instruction advances PC and consumes 4 cycles
  āœ” Test 02: MVI and MOV register transfers
  āœ” Test 03: 16-bit LXI, INX, DCX operations
  āœ” Test 04: ADD, Carry, and Zero Flag Calculation
  āœ” Test 05: SUB, Sign Flag, and Parity Flag
  āœ” Test 06: Logic Operations: ANA, ORA, XRA
  āœ” Test 07: Stack Operations: PUSH and POP PSW
  āœ” Test 08: CALL and RET Subroutine Flow
  āœ” Test 09: Conditional Branching: JNZ vs JZ
  āœ” Test 10: DAD Double Add HL register pair
  āœ” Test 11: Rotates: RLC and RRC bit operations
  āœ” Test 12: Memory Indirect Operations: MVI M, INR M, MOV A, M
  āœ” Test 13: XCHG and XTHL exchange operations
  āœ” Test 14: CP/M 2.2 BDOS Function 2 (C_WRITE) Console Character Output
  āœ” Test 15: CP/M 2.2 BDOS Function 9 (C_WRITESTR) Console String Output
  āœ” Test 16: CP/M 2.2 BDOS Function 15 & 20 Virtual Filesystem F_OPEN & F_READ
  āœ” Test 17: Assembler8080 Two-Pass Assembly and Round-trip Execution
  āœ” Test 18: Model Context Protocol (MCP) Debugger Tool Integration
āœ” Intel 8080 CPU Core Test Suite (18/18 passing)
```

### 2. Launch the MCP Agent Debugger
```bash
node src/mcp_debugger.mjs --stdio
```
The server speaks JSON-RPC 2.0 conforming to Anthropic Model Context Protocol specification:
```json
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"necro_inspect_registers"}}
```

### 3. Launch the CRT Terminal Web UI
Open [`docs/index.html`](docs/index.html) in any modern browser. Supports live assembly editing, single-step execution, and memory hex inspection. Fully self-contained for GitHub Pages deployment.

---

## šŸ“ Repository Structure
```
ā”œā”€ā”€ .kiro/                       # Authentic Kiro governance directory
│   ā”œā”€ā”€ specs/necrovm/           # Requirements, design, and task specs
│   ā”œā”€ā”€ steering/                # Silicon & architecture guidelines
│   ā”œā”€ā”€ hooks/                   # Opcode test-on-save trigger
│   └── settings/                # MCP server configuration
ā”œā”€ā”€ assets/
│   ā”œā”€ā”€ thumbnail_1280x800.png   # Devpost promotional banner
│   └── demo_kiroween_1080p.mp4  # 40s 1080p 30fps demonstration video
ā”œā”€ā”€ docs/                        # Self-contained GitHub Pages terminal UI
│   ā”œā”€ā”€ index.html               # Dual phosphor CRT terminal interface
│   └── src/                     # Packaged ES modules for web demo
ā”œā”€ā”€ src/                         # Pure ES modules core
│   ā”œā”€ā”€ cpu8080.mjs              # Intel 8080 cycle-accurate CPU core
│   ā”œā”€ā”€ cpm_bdos.mjs             # CP/M 2.2 BDOS syscall trap (0x0005)
│   ā”œā”€ā”€ assembler8080.mjs        # Two-pass macro assembler
│   └── mcp_debugger.mjs         # Anthropic MCP JSON-RPC 2.0 server
ā”œā”€ā”€ tests/
│   └── test_8080.mjs            # 18 unit and integration tests
ā”œā”€ā”€ DEVPOST_KIROWEEN_SUBMISSION.md
ā”œā”€ā”€ LICENSE                      # MIT License
└── package.json
```

---

## šŸ“œ License
Distributed under the **MIT License**. See [LICENSE](LICENSE) for details.