Skip to content
/ medr Public

An AI-Agentic UI framework that bridges the gap between LLM planning and React rendering via a type-safe MCP bridge

Notifications You must be signed in to change notification settings

jugnush/medr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP-Enabled Dynamic Renderer

User / App
   |
   v
Is intent valid?
 ├─ NO  → Reject / Clarify
 └─ YES → Fetch MCP Constraints
            |
            v
        Schema Found?
 ├─ NO  → Fail Safely
 └─ YES → LLM Planner
            |
            v
     Structured JSON?
 ├─ NO  → Fail Safely
 └─ YES → Validation Gateway
            |
            v
        Rules Pass?
 ├─ NO  → Block Render
 └─ YES → Deterministic Renderer → Final UI


## Project Overview

The MCP-Enabled Dynamic Renderer is a system architecture designed to bridge the gap between high-level user intent and low-level React component rendering. By utilizing the Model Context Protocol (MCP), the system ensures that dynamically generated interfaces are strictly validated, accessible, and contextually accurate according to defined metadata.
---

## Technical Pillars

### 1. Intent Processing
This module captures high-level user requirements and extracts essential contextual metadata. It defines the operational mode (e.g., "premium" vs "standard") and identifies the primary objectives before any logic is executed.

### 2. Constraint Discovery
The system establishes a real-time connection with an MCP Server to retrieve component definitions and prop requirements. This step ensures that the renderer has access to the current "source of truth" regarding component schemas and design system constraints.

### 3. Logic Orchestration
A planning layer transforms the initial intent and retrieved metadata into a structured JSON UI plan. This serves as the blueprint for the layout, mapping requirements to specific component structures.

### 4. Validation Layer
A critical safety gate that verifies the generated plan before it reaches the UI. The system checks the plan against:
* Prop Integrity: Matches data against required types and structures.
* Accessibility Standards: Ensures semantic standards and ARIA requirements are met.
* Business Logic: Enforces rules based on the user's current session or account level.

### 5. React Integration
The final layer dynamically injects validated props into the React component tree. This results in a high-performance visual output that is fully integrated into the application lifecycle.

---

## System Workflow

1. User provides intent via the application interface.
2. The Agent retrieves specific component constraints from the MCP Server.
3. The Planner generates a structured UI schema based on those constraints.
4. Validation logic inspects the schema for errors or property mismatches.
5. React renders the final component using the validated property set.

About

An AI-Agentic UI framework that bridges the gap between LLM planning and React rendering via a type-safe MCP bridge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors