LoopCraft

LoopCraft

MCP-UI Lab

MCP-UI Lab

Visual MCP-UI Integration Platform

What's
The Problem?

What's
The Problem?

What if you could visually discover MCP tools, design custom UI components, map interactions to tool calls, and export production-ready code?

What's
The
Scope?

What's
The
Scope?

It needed to work as a bidirectional MCP client that could connect to any MCP server, render interactive UI resources in chat, and provide a complete visual workflow from tool discovery through code generation.


It also needed to support both local (stdio) and remote (SSE/HTTP) transports with authentication, and real-time validation of parameter mappings.

What's
The Challenge?

What's
The Challenge?

Creating a visual based approach to UI integration with MCP servers.

What's
The Challenge?

Building for and learning about a protocol at the same time.

My Role

AI Design Engineer

My Role

My Role

AI Design Engineer

Solution Preview

Preview Solution

Most MCP tools are command-line focused. LoopCraft treats MCP integration as a visual design problem—you see the tools, design the UI, map the interactions, visualize the flow, and export production code.

Most MCP tools are command-line focused. LoopCraft treats MCP integration as a visual design problem—you see the tools, design the UI, map the interactions, and export production code.

The Stack

The Stack

The Stack

Frontend

Frontend


  • React 19 with TypeScript for type safety across ~11,800 lines of code

  • Zustand for state management with localStorage persistence

  • Radix UI + Tailwind CSS 4 for a modern, accessible interface

  • React Flow + Dagre for auto-layout flow diagrams

  • Monaco Editor for code editing with syntax highlighting

Backend

Backend


  • MCP SDK (@modelcontextprotocol/sdk) for stdio and SSE transports

  • Ollama via ollama-ai-provider-v2 for local LLM with streaming

  • Vercel AI SDK for tool calling and streaming responses

  • MySQL 8.0 (Docker) for user data and template persistence

  • JWT + bcrypt for secure authentication

Frontend


  • React 19 with TypeScript for type safety across ~11,800 lines of code

  • Zustand for state management with localStorage persistence

  • Radix UI + Tailwind CSS 4 for a modern, accessible interface

  • React Flow + Dagre for auto-layout flow diagrams

  • Monaco Editor for code editing with syntax highlighting

Backend


  • MCP SDK (@modelcontextprotocol/sdk) for stdio and SSE transports

  • Ollama via ollama-ai-provider-v2 for local LLM with streaming

  • Vercel AI SDK for tool calling and streaming responses

  • MySQL 8.0 (Docker) for user data and template persistence

  • JWT + bcrypt for secure authentication

What the Hell is MCP?

What the Hell is MCP?

Model Context Protocol

Model Context Protocol

MCP is a standardized way for AI agents to connect to data outside of their environment.


It is a tool AI agents can use.


Instead of just generating text, the AI can say "I need to use a calculator" or "I need to search the web" or "I need to read this file." It pauses, uses that tool, gets the result, and then translates the response to you.

MCP-UI

MCP-UI

MCP-UI lets AI tools show you interactive buttons, forms, and widgets instead of just text.


It's basically adding visual interfaces to AI tools. Instead of everything being a conversation, the AI can pop up actual apps and widgets for you to interact with.

Model Context Protocol

MCP is a standardized way for AI agents to connect to data outside of their environment.


It is a tool AI agents can use.


Instead of just generating text, the AI can say "I need to use a calculator" or "I need to search the web" or "I need to read this file." It pauses, uses that tool, gets the result, and then translates the response to you.

MCP-UI

MCP-UI lets AI tools show you interactive buttons, forms, and widgets instead of just text.


It's basically adding visual interfaces to AI tools. Instead of everything being a conversation, the AI can pop up actual apps and widgets for you to interact with.

Overview

Overview

1

1

Started with a basic Next.js chat interface using @assistant-ui/react. Used ShadCN components. Got Ollama streaming working from my local system. It was a challenge getting the stream animation nailed down. Lot's of stuttering at first.

2

2

Transformed the chat app into an MCP client with MCP-UI rendering. Then I wired up the MCP SDK, handling tool registration dynamically, and getting UI resources to render correctly

3

3

MCP-UI Builder Module: Content Type Architecture

The builder module implements a flexible content rendering system built on three core content types, each with distinct capabilities:

Content Types:

  • rawHtml (default) – Native HTML content rendering

  • externalUrl – Remote resource integration

  • remoteDom – Dynamic DOM manipulation

Each content type supports specific MIME type handling and determines the available configuration options.

Renderer Configuration:

Content type selection cascades to the following renderer options:

  • Auto-resize behavior

  • Sandbox permission controls

  • iframe title attributes

  • Container styling customization

This architecture enables granular control over content rendering while maintaining flexibility across different integration scenarios.

4

4

Component Libraries & Action System Templates

A comprehensive collection of 13 production-ready templates designed for rapid prototyping and deployment:

  • UI Components: Forms, Dashboards, Tables, Galleries, Charts

  • Interactive Examples: AI Assistant Helper, Documentation Viewer, Navigation Panel, Status Notifier, Multi-Action Demo

MCP-UI Action Types

Implemented a complete bidirectional communication system with five core action types:

  1. Tool – Execute MCP tools for form submissions and data operations

  2. Prompt – Send context-aware messages to AI for intelligent assistance

  3. Link – Navigate to external resources including documentation and dashboards

  4. Intent – Trigger application-level actions such as navigation and settings modifications

  5. Notify – Display user feedback with automatic variant detection (success/error states)

This architecture enables rich, interactive experiences with full client-server communication across all action types.

5

5

Flexible Export Options

Built a dual-export system to accommodate different deployment scenarios:

  • Integration Snippet – Generate embeddable code for incorporating MCP-UI components into existing MCP servers

  • Standalone Server – Export complete, production-ready servers in TypeScript or JavaScript with FastMCP integration

FastMCP Export

The FastMCP export option generates a fully configured MCP server using the FastMCP framework—basically a more streamlined, easier to code MCP server starter template.

This enables developers to move from visual UI design to a running MCP server much quicker.

Live Preview System

Developed a real-time preview engine using MCPUIRenderer that renders UI changes instantly in an isolated iframe environment, providing immediate visual feedback during the design process.

Save Settings

Implemented save/load functionality for UI resources, enabling template reusability across projects and facilitating design system consistency.

MCP-UI Function Builder

MCP-UI Function Builder

Key Components

Key Components

Settings Page: User-specific MCP server configuration


Context Tab: Server discovery and tool browsing


Design Tab: Monaco editor with live preview


Actions Tab: Interactive element detection, action mapping, parameter binding


Export Tab: Displays fully integrated code

Summary

Summary

If you've built MCP servers, you know the resource format isn't complicated - but there's friction. You're switching between thinking about your server logic and thinking about HTML/CSS/JavaScript for UIs. Then you're manually typing out all those metadata keys. UI Builder removes that context switch. You stay in "design mode" - pick a template, tweak it, configure options with dropdowns and toggles - then copy-paste the generated code. The code is clean, properly typed, follows MCP-UI spec exactly.


Plus: the live preview means you catch mistakes immediately. No more deploy → test → fix → redeploy loop. You see it working before you even copy the code. That's the whole point of the UI Builder - make MCP-UI accessible and fast, so you spend more time building cool interactions and less time fighting with iframe configs and metadata formats.

Outcomes

Outcomes

Outcomes

Current

Current

There are things that still need refining, like the interface. However, the current state of LoopCraft is a good representation of what things are and where things could head.


current version -> here

Main Intent

Main Intent

The main concept I attempted to express is the importance of the relationship between the server and the agent played out in the user interface.


What does the server instruct the agent to do? What parts of the interface will the agent compose itself? How does this interaction play out in a multi-stage process?

Roadmap

Roadmap


Phase 2: Enhanced Builder (In Progress)

  • Remote DOM Support

    • Full React component support in MCP-UI

    • Web Components framework integration

    • Client-side hydration and state management

  • Visual UI Editor

    • Component library with pre-built blocks


Phase 3: Advanced Features (Planned)

  • Analytics & Monitoring

    • Custom dashboards

  • MCP Orchestration

    • Server chains and workflows

    • Conditional tool execution

    • Event-driven automation

  • Extended Capabilities

    • Advanced debugging tools for MCP protocol

    • Webhook support for external integrations


Phase 4: Ecosystem (Future)

  • Marketplace & Monetization

    • Server marketplace with ratings

  • Platform Extensions

    • Third-party integrations (Zapier, n8n, etc.)

    • AI-powered template generation