cardspecter
CardSpecter — Hollerith 80-Column Keypunch & Mainframe COBOL EBCDIC / COMP-3 Resurrection Studio + MCP Server
Kiroween 2026 (
ResurrectionCategory) — Bringing 1928 IBM 029 80-Column × 12-Row Hollerith Punched Cards and 1959 COBOLDATA DIVISIONFixed-WidthCP037EBCDIC /COMP-3Copybooks back from the crypt to solve modern legacy batch modernization with Kiro Spec-Driven Development, Property-Based Testing, and the Model Context Protocol (MCP).
Live Interactive Keypunch & Hex X-Ray Studio: https://z121245017-ai.github.io/cardspecter/ (zero API keys, zero external CDN calls, instant 1-click historical mainframe decks)
Kiro Workspace Artifacts:
.kiro/specs/hollerith-copybook-engine/,.kiro/steering/,.kiro/hooks/,.kiro/agents/,.kiro/settings/mcp.json
Why Resurrect 80-Column Cards & COMP-3 Copybooks in 2026?
Every night across banking ACH wire clearinghouses, Medicaid institutional adjudication feeds, airline telemetry archives, and state tax pipelines, trillions of dollars still move inside fixed-width binary files shaped by two dead technologies:
1928 IBM 80-Column × 12-Row Punched Cards (
Cols 1–6sequence numbers,Col 7indicator,Cols 8–72Areas A/B,Cols 73–80deck ID, and 12-row zone+digit overpunches).1959 Mainframe COBOL Copybooks (
IBM CP037EBCDIC,COMP-3Packed Decimal BCD nybbles,COMP-4big-endian binary words,OCCURS n TIMESrepeating tables,88-level condition flags, andREDEFINESmemory unions).
When modern engineering teams or AI coding agents inspect these files without a deterministic compiler, three failure modes strike immediately:
The Overpunch Trap: A negative zoned decimal like
-$48,250.75(PIC S9(7)V99 DISPLAY) overpunches0xD0onto the final digit5, producing byte0xD5—which decodes inCP037as'N'("00482507N"), silently corrupting signs or crashing numeric parsers.Off-by-One Byte Drift:
PIC S9(9)V99 COMP-3occupiesfloor(11 / 2) + 1 = 6bytes (not11), whileREDEFINESunions overlay previous siblings without advancing the cursor unless wider. A single 1-byte miscalculation shifts every subsequent field in the record.IEEE-754 Float Corruption: Scaling
123.45 * 100in standard floating point yields12344.999999999998, and 18-digit sovereign settlement amounts exceedNumber.MAX_SAFE_INTEGER.
CardSpecter resurrects the physical tactile clarity of an IBM 029 Keypunch + 3278 Phosphor X-Ray Terminal and pairs it with a zero-dependency BigInt binary codec and MCP Server so humans and AI agents decode, verify, re-encode, and migrate legacy feeds with mathematical certainty.
Related MCP server: @zuupee/mcp-server
Architecture
flowchart LR
subgraph Legacy["Dead Tech Artifacts (1928–1983)"]
DECK["80-Col × 12-Row\nIBM 029 Card Deck"]
CPY["COBOL DATA DIVISION\nCopybook (.cpy)"]
BIN["Raw IBM CP037 +\nCOMP-3 / COMP-4 Dump"]
end
subgraph Engine["CardSpecter Zero-Dep Isomorphic Core (src/)"]
HOL["hollerith.mjs\n12-Bit Optical Reader &\nLace/Sequence Auditor"]
AST["copybook.mjs\nHierarchy + OCCURS +\nREDEFINES Offset Solver"]
COD["codec.mjs\nBigInt COMP-3 / Zoned /\nCOMP-4 + Forensics"]
MIG["migrator.mjs\nJSON Schema + TS +\nPostgreSQL NUMERIC DDL"]
end
subgraph Surfaces["Modern Developer & Agent Surfaces"]
WEB["Live Web Studio\n(docs/index.html)"]
MCP["MCP JSON-RPC Server\n(stdio + --http)"]
CLI["CLI Tool\n(bin/cardspecter.mjs)"]
end
DECK --> HOL --> AST
CPY --> AST --> COD
BIN --> COD --> MIG
HOL --> WEB
COD --> WEB
COD --> MCP
MIG --> MCP
COD --> CLIQuick Start (Zero Install Needed Beyond Node.js >= 20)
git clone https://github.com/z121245017-ai/cardspecter.git
cd cardspecter
# 1. Run full unit + Property-Based Testing (PBT) + live MCP test suite (20 tests, >1,700 generated PBT inputs)
npm test
# 2. Run CLI demo on the 1974 Core Banking ACH Wire & Overdraft deck
npm run demo
# 3. Inspect forensic diagnostics on a damaged lace-punched & BCD-corrupted deck
node bin/cardspecter.mjs demo corrupted_forensic_deck
# 4. Launch the MCP server (stdio by default, or loopback HTTP on port 3849)
node src/mcp-server.mjs --http 3849MCP Tools Exposed (cardspecter-mcp)
Configured automatically for Kiro IDE & Kiro CLI via .kiro/settings/mcp.json:
Tool | Purpose |
| Compiles fixed-80 or free-format COBOL Copybooks into exact byte offsets, record width, Draft 2020-12 JSON Schema, TypeScript types, and PostgreSQL/SQLite |
| Decodes raw |
| Encodes modern JSON into exact fixed-width mainframe wire bytes + formatted 16-column |
| Punches text into 80×12 IBM 029 column bitmasks or optically reads punched cards while auditing sequence monotonicity ( |
| Lists and retrieves 4 built-in historical scenarios ( |
How Kiro Powered This Build (/.kiro Deep Dive)
Spec-Driven Development (
.kiro/specs/hollerith-copybook-engine/):Formalized 6 EARS requirements in
requirements.mdbefore writing binary parsers, deriving explicitREDEFINEShigh-water-mark offset equations and 6 formalCorrectness Propertiesindesign.md.
Property-Based Testing with Shrinking (
tests/pbt.test.mjs):Directly executes Properties 1–6 across 1,700+ deterministically seeded random cases (
CP037256-byte bijection, 80-column Hollerith round-trip,COMP-3odd/even nybble widths &-0normalization, Zoned overpunch/separate signs,REDEFINESunion high-water marks, and compositeOCCURSrecord round-trips).
Layered Steering (
.kiro/steering/):Combines
always-included foundation docs (product.md,tech.md,structure.mdwith#[[file:src/index.mjs]]live references),fileMatchbinary guardrails (binary-ebcdic-rules.md), andauto-activated migration playbooks (legacy-migration-playbook.md).
Event-Driven Agent Hooks (
.kiro/hooks/) & Custom Agent (.kiro/agents/copybook-archaeologist.json):PostFileSavehooks automatically runnpm testand rebuilddocs/index.htmlvianpm run build:studioso the live browser studio never drifts fromsrc/.
License
Released under the MIT License.
Available Tools
5 toolscompile_copybookA
Compile an 80-column punched-card or free-format COBOL DATA DIVISION Copybook into exact byte offsets, total record length, JSON Schema, TypeScript types, and SQL DDL.
Inputs: copybook (required), sqlDialect.
decode_ebcdic_recordB
Deterministically decode a raw IBM CP037 EBCDIC / COMP-3 / COMP-4 hex payload against a COBOL Copybook, returning structured JSON, 88-level condition flags, REDEFINES overlays, byte-by-byte spans, and forensic anomalies.
Inputs: copybook (required), ebcdicHex (required).
encode_ebcdic_recordA
Encode a modern JSON object into an exact fixed-width IBM CP037 EBCDIC / COMP-3 / COMP-4 mainframe wire record.
Inputs: record (required), copybook (required).
inspect_hollerith_deckB
Punch ASCII/COBOL text into authentic 80-column × 12-row IBM 029 Hollerith card bitmasks or optically read 12-bit column arrays while auditing sequence numbers (cols 1-6), indicators (col 7), and lace-card tear hazards.
Inputs: text, deckColumns.
list_legacy_fixturesA
List built-in historical mainframe & punched-card scenarios (1974 Banking ACH, 1969 Lunar Telemetry, 1983 Medicaid OCCURS-3, Damaged Forensic Deck) or fetch one by fixtureId.
Inputs: fixtureId.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct artifact and direction: copybook compilation, EBCDIC encode, EBCDIC decode, Hollerith card punch/read, and fixture listing. The encode/decode pair is inverse rather than overlapping, and the copybook compiler is clearly a schema-generation step feeding the others. No two tools could plausibly be selected for the same task.
All five names follow a strict verb_noun snake_case pattern (compile_copybook, decode_ebcdic_record, encode_ebcdic_record, inspect_hollerith_deck, list_legacy_fixtures). The verbs are well-chosen and the nouns identify the resource unambiguously.
Five tools is a tight, well-scoped surface for a mainframe data-interchange domain, with each tool mapping to a distinct step (compile schema, encode, decode, inspect deck, load fixtures). Nothing feels padded or redundant.
The set covers a full round-trip: compile copybook to schema, encode JSON to wire format, decode wire format back to JSON, plus card-level inspection and sample fixtures. Minor gaps remain, such as validating a record against a copybook without full decode, batch/multi-record processing, or generating a copybook from an existing schema, but these are workaroundable.
Maintenance
Related MCP Connectors
An MCP server that measures MCP client behaviour and converts EBCDIC to ASCII, which nobody needs.
Thermal label MCP server: render, validate, debug and convert ZPL, EPL, TSPL and CPCL labels.
Self-hosted MCP server: 26 deterministic dev, security, and EVM tools.
55-tool cryptography MCP server: hashing, encryption, signatures, PQC, X.509, CMS and COSE.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for file operations with non-UTF-8/Unicode encoding: Cyrillic, CP1251, CP1252, ISO-8859, KOI8 auto-detection2031GPL 3.0
- AlicenseNot gradedqualityDmaintenanceGeneral-purpose MCP server with built-in tools for HTTP, JSON, and datetime operations, supporting pluggable modules and security defaults.MIT
- AlicenseAqualityDmaintenanceMCP server for parsing, validating, building and explaining FIX protocol trading messages — offline, no API keys.4MIT
- AlicenseNot gradedqualityCmaintenanceA local-first MCP server for financial wire message forensics, providing read-only tools to parse, validate, and detect SR2026 address compliance in ISO 8583, SWIFT MT, and ISO 20022 messages.Apache 2.0