Vibe-Eyes is an MCP server that enables LLMs to "see" what's happening in browser-based games and applications through vectorized canvas visualization and debug information. It uses a client-server architecture to capture, vectorize, and provide visual and debug data to LLMs via the Model Context Protocol (MCP).
mcp.js
)The core server that:
- Receives canvas snapshots via Socket.IO
- Vectorizes images to compact SVG representation (rough approximation)
- Stores debug information (logs, errors, exceptions, timing)
- Exposes the data via Model Context Protocol (MCP)
- Provides HTTP endpoints for direct access
- Processes images sequentially to manage resources
The browser client is available at vibe-eyes-client repository.
A lightweight browser integration that:
- Finds canvas elements in the page
- Captures canvas content as data URLs
- Intercepts console logs and errors
- Catches global unhandled exceptions with stack traces
- Sends data to the Vibe-Eyes server via WebSockets
- Minimizes performance impact on games
- Supports explicit initialization to control when capturing starts
vectorizer.js
)A high-quality SVG vectorization library that:
- Converts raster images to vector SVGs
- Optimizes SVGs for size and clarity
- Preserves visual information while reducing data size
# Clone the repository
git clone https://github.com/monteslu/vibe-eyes.git
cd vibe-eyes
# Install dependencies
npm install
Register the MCP server with your AI agent:
# For Claude Code
claude mcp add
Add the client to your browser application by including the required scripts:
<!-- Include Socket.IO client -->
<script src="https://cdn.socket.io/4.7.4/socket.io.min.js"></script>
<!-- Include Vibe-Eyes client -->
<script src="https://cdn.jsdelivr.net/npm/vibe-eyes-client/dist/index.min.js"></script>
<!-- Initialize the client -->
<script>
const vibeEyes = initializeVibeEyes({
serverUrl: 'ws://localhost:8869',
captureDelay: 1000,
autoCapture: true
});
</script>
The MCP server exposes a tool for LLMs to access the latest visual and debug information via Model Context Protocol (MCP):
getGameDebug({ includeSvg: true/false })
The LLM will receive:
- Recent console logs and errors from the application
- Unhandled exceptions with full stack traces (if any occurred)
- Vectorized SVG approximation of the canvas (if includeSvg
is true)
- Timing and correlation information to connect visual state with logs
{
"name": "vibe-eyes",
"url": "http://localhost:8869",
"tools": [
{
"name": "getGameDebug",
"description": "Retrieves the most recent canvas visualization and debug information from a browser game or application"
}
]
}
For applications that want to reuse the vectorized SVG output:
WebSocket Response: The server includes the SVG directly in WebSocket responses:
js
socket.on('debugCapture', (data, callback) => {
callback({
success: true,
id: "capture_123",
svg: "<svg>...</svg>",
stats: { /* stats data */ }
});
});
HTTP Endpoint: Access the latest capture via the /latest
endpoint:
js
fetch('http://localhost:8869/latest')
.then(res => res.json())
.then(data => {
const svg = data.vectorized?.svg;
});
const vibeEyes = initializeVibeEyes({
serverUrl: 'ws://localhost:8869',
captureDelay: 1000,
maxLogs: 10,
maxErrors: 10,
autoCapture: true
});
vibeEyes.startCaptureLoop();
vibeEyes.stopCaptureLoop();
vibeEyes.captureAndSend();
getGameDebug({
includeSvg: true
})
// Returns
{
success: true,
capture: {
id: "capture_123456789",
timestamp: 1616161616161,
console_logs: [
{ timestamp: 1616161616000, data: ["Player position:", {x: 10, y: 20}] }
],
console_errors: [],
unhandled_exception: {
timestamp: 1616161616100,
message: "Uncaught SyntaxError: Unexpected token ';'",
stack: "SyntaxError: Unexpected token ';'\n at game.js:42:10\n...",
type: "SyntaxError",
source: "game.js",
line: 42,
column: 10
},
vectorized: {
svg: "<svg>...</svg>",
imageType: "png",
stats: {
vectorizeTime: 120,
optimizeTime: 30,
originalSize: 50000,
finalSize: 15000,
sizeReduction: 70
}
}
}
}
# Install CLI globally
npm install -g vibe-eyes
# Use the CLI
vibe-eyes-vectorize input.png output.svg
# With options
vibe-eyes-vectorize photo.jpg --color-precision 10 --max-iterations 100
ISC
An MCP server that enables LLMs to 'see' what's happening in browser-based games and applications through vectorized canvas visualization and debug information.
No releases published
No packages published