arXiv:2608.24944cs.SEAug 2026

Manuscript Offprint

arXiv:2608.24944

Secret MCP: Evidence-Bounded and Context-Isolated Design Specification Generation from Web Screenshots

Yeongjin Jo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Screenshot-to-code systems optimize for a rendered implementation, but screenshots omit the document structure, interaction logic, responsive rules, and provenance needed to distinguish observation from guesswork. Multi-reference prompts introduce an additional risk: evidence or inferred decisions from one reference can contaminate another. We present SECRET MCP, an open-source local system that produces one auditable, implementation-oriented design specification per public web reference. It separates retrieval, evidence preparation, model invocation, storage, and inspection. Long desktop captures are resized to at most 1,200 pixels wide and split into 1,600-pixel tiles with 80-pixel overlap. Evidence records retain prepared- and source-space coordinates and an eight-color measured palette. A 19-section contract requires page inventories, navigation geometry, section bounds, responsive matrices, components, accessibility requirements, acceptance criteria, and explicit labels for MEASURED, OBSERVED, INFERRED, and UNKNOWN claims. References are processed sequentially through a sampler interface. The evaluated Model Context Protocol adapter sends one sampling/createMessage request per reference with includeContext: none; a fresh-process adapter is available when a stronger execution boundary is required.

We evaluate public commit c130c9c at two levels. A live retrieval and fixture-model integration run selected two references after excluding a third, prepared nine evidence images, issued two distinct sampling requests, and produced two documents with zero cross-reference identifier occurrences. A static audit of three bundled, externally generated design indexes found all 19 required sections in every document, one unique reference identifier per document, eight page specifications, 1,943 pixel-valued measurements, and 319 color literals. These tests establish orchestration invariants and syntactic contract compliance, not semantic or visual reconstruction accuracy. The sampler abstraction preserves the same boundaries across direct model APIs and future transports despite the 2026 depreciation of MCP sampling.

Keywords: screenshot-to-code, multimodal code generation, user-interface reverse engineering, provenance, context isolation, Model Context Protocol

1 Introduction

Generating frontend code from an image is now a well-established multimodal task. Early systems mapped screenshots to domain-specific language tokens [1]; later work learned simplified markup from screenshots [5], introduced large synthetic corpora [4, 11], and developed real-world benchmarks with visual, element, layout, and capability-level metrics [9, 2, 6]. These efforts expose a recurring difficulty: a screenshot contains pixels, not the source document object model, CSS, interaction logic, responsive rules, accessibility semantics, or design rationale. A plausible rendering can therefore conceal unsupported assumptions.

The problem becomes harder when a user requests several references at once. A single multimodal context can contain screenshots, metadata, and instructions for multiple works. The model may accidentally transfer a color, route, component, or inferred interaction from one work to another. Even when the final pages look reasonable, a user has little evidence for determining which claim came from which image. A monolithic response also makes retries expensive and complicates partial failure recovery.

SECRET MCP addresses this workflow problem rather than proposing a new vision or language model. It creates a provenance-preserving intermediate artifact, named DESIGN_INDEX, between screenshot evidence and implementation. Each design reference is processed separately, its evidence and request contract are stored, and its document is inspectable without loading another work's document body. The approach is model-agnostic: the server specifies what must be measured and disclosed, while the connected model supplies the analysis.

This paper makes four contributions:

  1. a reference-scoped generation architecture that maintains a one-reference, one-request, one-document invariant and rejects combined fallback when the configured boundary is unavailable;

  2. an evidence preparation scheme for long screenshots that records overlapping tile coordinates, scale mappings, compressed image bytes, and quantized color measurements;

  3. a 19-section specification contract that converts visual observations into page-scoped geometry, components, responsive behavior, accessibility requirements, and falsifiable acceptance criteria while exposing uncertainty; and

  4. a reproducibility evaluation covering build health, live retrieval, exclusion behavior, request isolation, persisted evidence, and syntactic contract compliance of bundled outputs.

The evaluation is deliberately narrow. We do not claim that section counts, coordinate literals, or identifier isolation prove visual fidelity. They verify system invariants and output structure. Controlled human evaluation and rendered-page similarity experiments remain future work.