Inspiration The inspiration for FrankenStack was born from a frustrating reality: millions of insurance companies still depend on IBM AS/400 systems from the 1980s to process claims. It’s a process that typically requires 45 minutes of manual work on TN5250 terminals, tedious weather data verification, and manual fraud detection.

We asked ourselves: What if we could "resurrect" these legacy systems by connecting them to modern AI agents, without replacing them? Like Dr. Frankenstein, we wanted to breathe new life into "dead" technology using the most advanced tools available: the MCP protocol, GPT-4 Vision, and real-time weather APIs.

The Halloween theme was perfect: creating a "technological chimera" that stitches the ancient with the cutting-edge.

What it does FrankenStack reduces insurance claim processing from 45 minutes to under 5 minutes by:

Automatic Extraction: Pulls claim data directly from emails.

Legacy Bridge: Connects to AS/400 via a custom MCP server that translates TN5250 protocols to JSON.

Fraud Validation: Cross-references data with the NOAA API (Hurricane in Mexico City? Fraud detected).

Visual Analysis: Uses GPT-4 Vision to assess damage photos.

Automated Decisioning: The agent decides to APPROVE, INVESTIGATE, or REJECT based on evidence.

Full Audit Trail: Every action is logged in a SQLite database.

Immersive Visualization: Everything is displayed in a 3D Frankenstein-style laboratory with Tesla coils that activate when claims are processed.

How we built it We used a hybrid approach powered by Kiro:

Phase 1 - Vibe Coding: Rapid prototyping of the MCP server and agent logic using natural language. Kiro generated 300+ lines of the AS400MCPServer in minutes.

Phase 2 - Spec-Driven Development: For critical components, we created structured specs (requirements.md → design.md → tasks.md) which Kiro used as executable documentation.

Phase 3 - Steering Docs: We established global rules that Kiro followed throughout the codebase:

Mandatory 5000ms timeouts on MCP methods.

Winston logger instead of console.log.

Typed errors (CustomError extends Error).

Deterministic mocks with seedrandom.

Phase 4 - Agent Hooks: We implemented 5 automated hooks acting as the system's "reflexes" (e.g., on-fraud-detected, on-claim-approved).

Tech Stack: React + Three.js (UI), Express + Prisma (backend), OpenAI GPT-4 (AI), MCP protocol (Legacy Bridge).

Challenges we ran into MCP Server Rate Limiting: It took 4 iterations with Kiro to correctly implement the Token Bucket algorithm. Early attempts were either too vague or over-engineered (unnecessary circuit breakers).

Hardcoded vs. Real Data: We discovered 70% of our initial UI was showing fake data. We had to build real endpoints (/api/health, /api/metrics, /api/audit) and wire them up.

Geographically Accurate Weather: The system was assigning hurricanes to Mexico City. We implemented logic that respects real geography (only US coasts can trigger hurricane scenarios).

AI Chat Hallucinations: The "Séance Chat" feature was inventing data. We solved this with explicit system prompts that include real DB context and strict rules.

p5.js + React Integration: Unifying the topology canvas with React overlays required a 200+ line spec to handle state synchronization correctly.

Accomplishments that we're proud of Achieved a real reduction in claim processing time (45min → <5min).

Built a production-ready MCP server with rate limiting, typed errors, winston logging, and correlation IDs.

Developed intelligent fraud detection that cross-references location + weather + user description.

Created a complete audit trail where every agent decision is logged with context.

Designed an immersive UI with a 3D lab, Tesla coils, and a functional retro terminal.

Documented development: 4 major refactoring iterations are recorded as evidence of the process with Kiro.

What we learned Specificity in prompts = Quality in code: "Add timeout" fails; "Use Promise.race with Token Bucket at 5 req/s" works perfectly.

Hybrid Approach: Vibe coding is great for exploration, but Specs are essential for production-grade code.

Steering Docs are powerful guardrails: They prevent anti-patterns before they even appear in the code.

Hooks are the nervous system: Automating responses to events eliminates manual intervention and human error.

Legacy doesn't mean obsolete: With the right translation layer (MCP), 40-year-old systems can seamlessly integrate with modern AI.

What's next for FrankenStack Real AS/400 Connection: Currently using a TN5250 simulation; the next step is connecting to a physical mainframe.

Expanded Data Sources: Integrating vehicle databases, claim history, and public records for enhanced fraud detection.

Multi-tenant Architecture: Allowing multiple insurance carriers to use the system with their own configurations.

Mobile App: Enabling field adjusters to process claims on-site with real-time photo analysis.

Fine-tuned AI Model: Training a specific model on historical insurance fraud data.

Open Sourcing the MCP Server: Publishing the AS/400-to-JSON bridge as a library so others can revive their legacy systems.

Built With

Share this project:

Updates