Skip to main content
Glama
IqbalHere

Visual Loop MCP Server

by IqbalHere

MCP Protocol TypeScript Playwright Judge0 License: MIT Node.js

πŸš€ Quick Start β€’ πŸ“– Documentation β€’ πŸ”§ Configuration β€’ πŸ€– Claude Desktop β€’ πŸ“‘ API Reference


✨ Why Visual Loop?

Most AI coding assistants can write code β€” but they can't see the result. Visual Loop MCP closes that gap by providing a single tool that:

TIP

Think of it asgiving your AI eyes β€” it can now verify layouts, catch visual bugs, and iterate on designs without human intervention.


Related MCP server: RunAutomation MCP Server

πŸ—οΈ Architecture

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚        AI Client             β”‚
                    β”‚   (Claude Desktop / Cursor)  β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                          stdio (JSON-RPC 2.0)
                                   β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚    Visual Loop MCP Server     β”‚
                    β”‚                               β”‚
                    β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
                    β”‚   β”‚   Phase A: Execute     β”‚   β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   β”‚   Code Validation      │───┼────▢│  Judge0/Codebox   β”‚
                    β”‚   β”‚                        β”‚   β”‚     β”‚  (Sandboxed API)  β”‚
                    β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚                               β”‚
                    β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
                    β”‚   β”‚   Phase B: Render      β”‚   β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   β”‚   Visual Screenshot    │───┼────▢│  Playwright       β”‚
                    β”‚   β”‚                        β”‚   β”‚     β”‚  (Headless Chrome) β”‚
                    β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚                               β”‚
                    β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
                    β”‚   β”‚   Phase C: Cleanup     β”‚   β”‚     Temp files removed
                    β”‚   β”‚   Resource Disposal    β”‚   β”‚     Browser closed
                    β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
                    β”‚                               β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
graph LR
    A[πŸ€– AI Client] -->|stdio JSON-RPC| B[πŸ”„ Visual Loop MCP]
    B -->|POST /submissions| C[⚑ Judge0 Codebox]
    B -->|file:// render| D[🌐 Playwright]
    C -->|stdout / stderr| B
    D -->|base64 PNG| B
    B -->|multimodal response| A

    style A fill:#6C63FF,stroke:#4F46E5,color:#fff,stroke-width:2px
    style B fill:#A855F7,stroke:#9333EA,color:#fff,stroke-width:2px
    style C fill:#F59E0B,stroke:#D97706,color:#fff,stroke-width:2px
    style D fill:#10B981,stroke:#059669,color:#fff,stroke-width:2px

πŸ“¦ Prerequisites

Requirement

Version

Purpose

β‰₯ 20.0

Runtime environment

β‰₯ 10.0

Package management

Any

Judge0 container hosting


πŸš€ Quick Start

1️⃣ Start the Judge0 Sandbox

# Pull and run Judge0 CE in Docker
docker run -d -p 2358:2358 --name judge0 judge0/judge0-ce

2️⃣ Install & Build

# Clone the repository
git clone https://github.com/IqbalHere/-Visual-Loop-MCP-Server.git
cd -Visual-Loop-MCP-Server

# Install dependencies
npm install

# Install Playwright Chromium (minimal footprint)
npx playwright install chromium

# Build the TypeScript project
npm run build

3️⃣ Run the Server

CODEBOX_URL=http://localhost:2358 CODEBOX_TOKEN=your_token npm start
$env:CODEBOX_URL = "http://localhost:2358"
$env:CODEBOX_TOKEN = "your_token"
npm start

πŸ”§ Configuration

Variable

Required

Description

CODEBOX_URL

βœ…

Base URL of your Judge0/Codebox instance

CODEBOX_TOKEN

❌

Auth token for the Codebox API (omit if no auth)

NOTE

IfCODEBOX_URL is unset, the server gracefully skips code execution and only performs visual rendering. No crash, no fuss.


πŸ€– Claude Desktop Integration

Add this to your Claude Desktop configuration file:

Platform

Config Path

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "visual-loop": {
      "command": "node",
      "args": ["C:/absolute/path/to/visual-loop-mcp/build/index.js"],
      "env": {
        "CODEBOX_URL": "http://localhost:2358",
        "CODEBOX_TOKEN": "your_token_here"   // optional
      }
    }
  }
}
IMPORTANT

Replace the path inargs with the absolute path to your cloned project. Use forward slashes (/) even on Windows.

After saving, restart Claude Desktop. The execute_and_render tool will appear in the tool picker. πŸŽ‰


πŸ“‘ Tool Reference

execute_and_render

The single, powerful tool exposed by this server.

AI writes code  β†’  Codebox validates logic  β†’  Playwright renders visuals  β†’  AI sees the result

Parameters

Parameter

Type

Required

Default

Description

source_code

string

βœ…

β€”

Raw HTML/CSS/JS source code to execute and render

language_id

number

βœ…

β€”

Judge0 language ID (see table below)

viewport_width

number

❌

1280

Browser viewport width in pixels

viewport_height

number

❌

720

Browser viewport height in pixels

Response Format

The tool returns a multimodal MCP content array containing both text and image:

{
  "content": [
    {
      "type": "text",
      "text": "[Codebox] Status: Accepted (id: 3)\n── stdout ──\nHello, world!\n\nExecution time: 0.012s | Memory: 3456 KB"
    },
    {
      "type": "image",
      "data": "<base64-encoded-PNG-screenshot>",
      "mimeType": "image/png"
    }
  ]
}

πŸ—‚οΈ Supported Languages

Language

ID

Language

ID

🟨 JavaScript (Node.js)

63

🐍 Python 3

71

πŸ”· TypeScript

74

β˜• Java

62

βš™οΈ C++ (GCC)

54

πŸ’Ž Ruby

72

🐹 Go

60

🌐 HTML/CSS

82

TIP

For a complete list of 60+ supported languages, query your Judge0 instance:GET /languages


πŸ›‘οΈ Error Handling

The server is engineered to never crash from tool-level errors. Every failure is caught and returned gracefully:

Scenario

Behavior

πŸ”Œ Codebox timeout / network error

Error details in text response; screenshot still attempted

πŸ–₯️ Playwright crash

Codebox results returned with rendering error note

πŸ’₯ Both fail

Descriptive error text returned; no image block

⚠️ Missing CODEBOX_URL

Codebox phase skipped with warning; rendering proceeds


🧰 Development

# Build and run in one step
npm run dev

# Watch mode with tsx (great for iterating)
npx tsx watch src/index.ts

Project Structure

visual-loop-mcp/
β”œβ”€β”€ πŸ“„ src/
β”‚   └── index.ts          # Main server β€” Codebox + Playwright + MCP
β”œβ”€β”€ πŸ“ build/             # Compiled JavaScript output
β”œβ”€β”€ πŸ“¦ package.json       # Dependencies & scripts
β”œβ”€β”€ βš™οΈ tsconfig.json      # TypeScript configuration
└── πŸ“– README.md          # You are here!

πŸ› οΈ Tech Stack

Technology

Role

Core language with strict type safety

Model Context Protocol server framework

Headless browser automation & screenshots

Sandboxed multi-language code execution

HTTP client for Codebox API

Runtime schema validation


🀝 Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with ❀️ by Iqbal

⭐ Star this repo if you found it useful! ⭐

Available Tools

1 tool
execute_and_renderA

Execute source code via Codebox (Judge0) for logic validation and render it as HTML in a headless browser via Playwright, returning the console output and a screenshot. Use this to write full-stack UI code and instantly verify both its logic and visual appearance.

ParametersJSON Schema
NameRequiredDescriptionDefault
language_idYesJudge0-compatible language ID for Codebox execution. Use 63 for JavaScript (Node.js), 82 for HTML/CSS, etc.
source_codeYesThe raw HTML/CSS/JS source code to execute and render.
viewport_widthNoBrowser viewport width in pixels (default: 1280).
viewport_heightNoBrowser viewport height in pixels (default: 720).

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the process (Codebox execution, Playwright rendering) and outputs (console output, screenshot), but does not disclose potential side effects, execution limits, error behavior, or authentication requirements. This leaves gaps for an AI agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core functionality in the first sentence. Every word is purposeful with no fluff. It is optimally sized for an AI agent to quickly grasp the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The schema covers all parameters, and no output schema exists. However, the description does not specify the format of the console output or screenshot (e.g., base64, plain text). It also omits constraints like timeouts or size limits, which are relevant for code execution tools. This information would be useful for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with each parameter described in the schema. The description adds no additional parameter details beyond what is already in the schema. According to the guidelines, baseline is 3, and no extra value is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes source code via Codebox (Judge0) for logic validation, renders it as HTML via Playwright, and returns console output and a screenshot. The verb 'execute and render' and the specific resource (Codebox and Playwright) make the purpose unambiguous. Without sibling tools, differentiation is not needed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this to write full-stack UI code and instantly verify both its logic and visual appearance,' providing a clear usage context. There are no sibling tools, so no alternatives to exclude, making the guidelines sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedexecute_and_render

TDQS

A4.1/5.0
Disambiguation5/5

Only one tool exists, so there is no possibility of ambiguity or confusion with other tools.

Naming Consistency5/5

With a single tool, naming consistency is not a concern; the name 'execute_and_render' clearly describes its function.

Tool Count3/5

One tool is on the lower end of reasonable count, but it serves a specific combined purpose of execution and rendering, which may justify the minimal surface.

Completeness3/5

The single tool covers both code execution and visual rendering, but lacks separate tools for execution-only or rendering-only tasks, limiting flexibility.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IqbalHere/Visual-Loop-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server