imgui-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@imgui-mcpdesign a game HUD with health bar, mana bar, and skill bar"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
The Problem
AI coding agents can generate UI code — but they can't see the result. They write ImGui calls blind, hope the layout works, and never iterate visually. Game UI development needs a feedback loop: place → preview → adjust → repeat.
Related MCP server: Pane
The Solution
imgui-mcp is a Model Context Protocol server that gives any AI agent a live, interactive Dear ImGui canvas with 84 tools, 102 widget types, and a visual feedback loop:
┌──────────────────────────────────────────────────────────────────┐
│ "Build a game HUD with health bar, inventory, and skill bar" │
└───────────────────────────────┬──────────────────────────────────┘
▼
┌─────────────┐ MCP ┌──────────┐ JSON ┌─────────────┐
│ AI Agent │◄──────────►│ server.py │◄────────►│ Live ImGui │
│ (any LLM) │ 84 tools │ 0 deps │ stdin/ │ SDL2+GL │
└─────────────┘ └──────────┘ stdout └──────┬───────┘
▲ │
│ screenshot (BMP) │
└─────────────────────────────────────────────────┘
Agent SEES what it builtThe agent creates widgets, takes a screenshot, sees the rendered result, and iterates — like a developer with eyes.
Features at a Glance
🖼️ Visual Feedback | Screenshot capture (full frame, widget-bound metadata, annotated overlays) — the agent sees its work |
🎮 Game UI Patterns | Health bars, mana bars, inventory grids, dialogue boxes, minimaps, cooldown radials, skill bars, quest trackers, character sheets, notification toasts, tooltip cards |
🖱️ Input Simulation | Click buttons, type text, hover widgets, scroll, press keys — test UI behavior programmatically |
✨ Animation | 7 easing functions, nested-widget property tweens, loop/ping-pong, and JSON round-trip persistence |
🎨 Theming | 7 presets (dark, light, classic, fantasy, sci-fi, retro, minimal) + per-color and per-variable customization |
📐 Layout | 9-point anchor system, resolution presets (720p → 4K + ultrawide + mobile), DPI scaling, safe areas |
🔄 Workflow | Undo/redo (50-deep), named snapshots, save/load/delete layout versions |
🎬 Scenes | Multi-window composition, z-order layers, conditional visibility ( |
📦 Export | Generate production C++, Lua, or complete JSON designs with fonts and live animations |
🖌️ Drawing | Lines, rects, circles, triangles, beziers, polylines, text — direct ImDrawList access |
🧩 102 Widgets | Every Dear ImGui widget + 11 game-specific patterns |
🔌 Zero Dependencies | Python server needs no pip packages. C++ app vendors ImGui. |
🪟 Native Polish | Dark themed Windows title bar, branded taskbar/title-bar icon, and HiDPI-aware windowing |
🔤 Font Stacks | Runtime TTF/OTF loading, Unicode coverage presets, and merged icon/symbol fallback faces |
Quick Start
Option A: Pre-built release (no compiler needed)
Download from Releases:
Linux:
tar -xzf imgui-mcp-*-linux-x64.tar.gz
cd imgui-mcp-*-linux-x64
./setup.sh # configures all 13 IDE/CLI toolsWindows:
Extract zip → double-click install.batOption B: Build from source
git clone https://github.com/SaloQT/imgui-mcp.git
cd imgui-mcp
uv sync # installs the pinned official MCP Python SDK
make build # requires: cmake, g++, libsdl2-dev, libgl1-mesa-dev
./setup.shVerify it works
uv run python demo.py # runs a full feature demonstrationAll 74 MCP Tools
Windows & Widgets (7)
Tool | Description |
| Create a window with title, position, size, and flags (menubar, no_resize, no_move, no_collapse, no_title_bar, always_auto_resize) |
| Add any of 102 widget types to a window — supports nested children for containers |
| Update a widget's value, text, checked state, color, label, or enabled state at runtime |
| Remove a widget by ID |
| Remove a window and all its widgets |
| Get the full state of every window and widget (values, clicked, changed, hovered, focused) |
| Remove all windows and widgets, reset to empty canvas |
Visual Feedback (3)
Tool | Description |
| Capture the current frame as BMP — agent can inspect the image to see what it built |
| Capture with a specific widget's bounding box info for targeted inspection |
| Capture with widget ID overlays drawn on the image for spatial reference |
Input Simulation (7)
Tool | Description |
| Simulate a mouse click on any widget (finds its rect center, injects click events) |
| Focus a widget and type text into it character by character |
| Move the virtual mouse to hover over a widget (triggers tooltips, highlights) |
| Inject mouse wheel scroll into a window |
| Press any key or combo: |
| Set the virtual mouse position in screen coordinates |
| Set keyboard focus to a specific widget for the next frame |
Window & Widget Manipulation (8)
Tool | Description |
| Move a window to new (x, y) coordinates |
| Resize a window to new (w, h) dimensions |
| Offset a widget's position via cursor offset |
| Get a widget's actual rendered bounding box in pixels |
| Get a window's position and size |
| Focus and raise a window to the top |
| Override a widget's dimensions |
| Get all widget bounding boxes in a window as structured data |
Drawing — ImDrawList (1)
Tool | Description |
| Draw on named, composable canvas layers. Calls append by default ( |
Interactive Canvas (10)
Tool | Description |
| Add an invisible interactive shape (rect, circle, ellipse, polygon) that detects hover, click, drag, double-click, and wheel events. Supports transforms (position, rotation, scale). |
| Remove a hit region by id |
| Update a hit region's shape, transform, or interaction flags |
| Drain canvas interaction events (hover, click, drag start/move/end, wheel, double-click) with positions and deltas |
| Update a single draw command in a layer by index — change color, position, thickness without replacing the layer |
| Apply translate, rotate, scale, or opacity to an entire draw layer |
| Bind a widget value to a visual property (e.g. slider → draw layer opacity). Updates every frame automatically. |
| Remove bindings by source widget and/or target |
| Declarative action: button click toggles visibility, switches scenes, or sets values — no polling round-trip |
| Remove declarative callbacks |
Style & Theming (7)
Tool | Description |
| Apply a built-in theme: dark, light, or classic |
| Apply an extended theme preset: fantasy (gold/amber), scifi (cyan/teal), retro (terminal green), minimal (clean white) |
| Set any ImGui color by name: |
| Set any style variable: |
| Push a temporary style color override |
| Pop pushed style colors |
| Set the viewport background clear color |
Animation (3)
Tool | Description |
| Tween any widget property (value, opacity, size, position) over time with easing: |
| Stop animations on a specific widget |
| Stop all active animations |
Layout & Responsiveness (7)
Tool | Description |
| Anchor a window to the viewport: |
| Anchor a widget within its window for responsive layout |
| Resize the application window to exact pixel dimensions |
| Get current viewport dimensions |
| Resize to a preset: |
| Scale all UI sizes for HiDPI displays (1.0, 1.5, 2.0) |
| Set safe area insets (top, bottom, left, right) that anchored windows respect |
Assets, Textures & Fonts (5)
Tool | Description |
| Load a BMP/PPM image as a GPU texture for Image/ImageButton widgets. Creates a checkerboard placeholder if file not found. |
| Free a loaded texture's GPU resources |
| Load a TTF/OTF font with a glyph-coverage preset, or merge it into another face as a symbol/icon fallback. |
| Switch the global ImGui font by ID, or restore the embedded |
| List loaded font IDs, paths, sizes, and the active font. |
Font paths are opened by the native renderer, so use a path visible to that process. For example, a Windows renderer launched from WSL accepts a Windows path:
imgui_load_font(id="ui", path="C:\\Windows\\Fonts\\segoeui.ttf", size_pixels=18)
imgui_load_font(id="symbols", path="C:\\Windows\\Fonts\\seguisym.ttf",
size_pixels=18, glyph_ranges="symbols", merge_into="ui")
imgui_set_font(id="ui")
imgui_list_fonts()
imgui_set_font(id="default")glyph_ranges accepts default, unicode, symbols, cyrillic, greek,
vietnamese, thai, japanese, korean, chinese_full, or
chinese_simplified. Dear ImGui 1.92 resolves Unicode dynamically; merging is
the important step when the primary face does not contain icon or symbol
glyphs. On Windows, Segoe UI Symbol is merged into Segoe UI automatically.
Fonts remain loaded for the renderer process lifetime. IDs are unique; choose a new ID when comparing another face or size.
Workflow — Undo/Redo & Snapshots (6)
Tool | Description |
| Undo the last add/remove/update/clear operation (50-deep stack) |
| Re-apply an undone operation |
| Save the current layout as a named snapshot |
| Restore a previously saved snapshot |
| List all snapshots with names, frame numbers, and widget counts |
| Delete a snapshot by name |
Scenes & Multi-Window (7)
Tool | Description |
| Create a named scene that groups specific windows together |
| Delete a scene |
| Switch to a scene — only its windows are rendered |
| List all scenes and the active scene |
| Set z-order layer for a window (higher = renders on top) |
| Set conditional visibility: |
| Show or hide a window |
Export & Import (4)
Tool | Description |
| Generate standalone C++ ImGui code that recreates the current layout (with static variables for state) |
| Generate Lua imgui binding code that recreates the layout |
| Serialize the complete live design: windows, widgets, font stack, active font, and tweens |
| Restore the complete design, including merged fonts and in-progress/looping animations |
Debug Windows (4)
Tool | Description |
| Toggle the ImGui demo window (showcases every widget interactively) |
| Toggle the metrics/debug window (draw calls, vertices, internal state) |
| Toggle the about window (version, credits, build info) |
| Toggle the style editor (edit colors and sizes interactively) |
System, Events & Input State (5)
Tool | Description |
| Check if the ImGui app is running, binary path, and version |
| Retrieve pending native UI events with bounded batching and dropped-event accounting |
| Query mouse position, button states, keyboard state, hovered/active/focused items |
| Get or set the system clipboard text |
| Low-level window ops: set_pos, set_size, set_collapsed, set_focus, set_bg_alpha, set_scroll |
All 102 Widget Types
Standard ImGui Widgets (91)
Category | Widget Types |
Buttons |
|
Text |
|
Input |
|
Sliders |
|
Drag |
|
Color |
|
Combo & List |
|
Trees |
|
Tables |
|
Menus |
|
Popups |
|
Tabs |
|
Containers |
|
Plots |
|
Toggles |
|
Progress |
|
Layout |
|
Values |
|
Tooltips |
|
Images |
|
Game UI Patterns (11)
Widget | What it renders |
| Labeled HP bar with green→yellow→red color gradient based on percentage, "HP: X/Y" overlay |
| Blue/purple MP bar with "MP: X/Y" overlay |
| N×M grid of 48px slots with item labels, selected slot highlight, click events |
| Bordered panel with speaker name, typewriter text reveal, numbered choice buttons |
| Dark bordered square with green player triangle at center, red entity dots from coordinate data |
| Bordered card with rarity-colored title, wrapped description, stat lines |
| Circle with radial sweep showing remaining cooldown, centered label |
| Small rounded rect with opacity fade, positioned at top-right |
| Horizontal row of icon squares with keybind labels and cooldown overlays |
| Panel with colored header, quest entries with individual progress bars |
| Tabbed panel with headers as tab names, key-value stat pairs from row data |
Supported IDE/CLI Tools
imgui-mcp ships project-level config files for every major AI coding tool. Clone the repo, open it in your tool, and the MCP server is already configured.
Tool | Config File | Format |
Claude Code |
| JSON — |
Claude Desktop | Global config | JSON — |
Cursor |
| JSON — |
VS Code / Copilot |
| JSON — |
Windsurf |
| JSON — |
omp (Oh My Pi) |
| JSON — |
Cline |
| JSON — |
Roo Code |
| JSON — |
Zed |
| JSON — |
Gemini CLI |
| JSON — |
Codex CLI |
| TOML — |
Continue |
| YAML — |
Augment | Global config | JSON — |
Run ./setup.sh (Linux/macOS) or .\setup.ps1 (Windows) to also install global configs for tools that need them.
Usage Examples
Game HUD
"Create a fantasy game HUD with health at 75%, mana at 60%, a 4×3 inventory grid, and a 5-slot skill bar."
imgui_create_window(id="hud", title="Game HUD", w=800, h=600, flags=["menubar"])
imgui_add_widget(window="hud", id="hp", widget_type="health_bar", value=0.75)
imgui_add_widget(window="hud", id="mp", widget_type="mana_bar", value=0.6)
imgui_add_widget(window="hud", id="inv", widget_type="inventory_grid",
int_value=4, int_values=[4,3],
items=["Sword","Shield","Potion","Bow","Arrow","Ring",...])
imgui_add_widget(window="hud", id="skills", widget_type="skill_bar",
int_value=5, items=["Q","W","E","R","F"],
values=[0, 0.3, 0, 0.7, 1.0])
imgui_set_theme(theme="fantasy")
imgui_screenshot() ← agent sees the result and iteratesAnimated Damage Flash
"Animate the health bar dropping from 75% to 20% with a bounce effect over 2 seconds."
imgui_animate(window="hud", widget="hp", property="value",
from=0.75, to=0.2, duration=2.0, ease="bounce")Export to Game Code
"Export this layout as C++ code I can drop into my game."
imgui_export_cpp(path="src/game_hud.cpp")
→ Generates a standalone render_game_hud() function with static variablesResponsive Testing
"Test the HUD at 4K resolution and mobile."
imgui_set_resolution_preset(preset="4k")
imgui_screenshot()
imgui_set_resolution_preset(preset="mobile")
imgui_screenshot()Architecture
imgui-mcp/
├── server.py Official Python SDK server — 84 tools
├── pyproject.toml Python package and MCP SDK dependency
├── uv.lock Reproducible Python dependency lock
├── src/
│ ├── types.h Shared enums (102 widget types), structs, globals
│ ├── main.cpp SDL2+OpenGL3 lifecycle, stdin reader, emit helpers
│ ├── render.cpp render_widget() — 102-case switch, nested containers
│ └── commands.cpp process_command() — all command handlers
├── vendor/ Dear ImGui v1.92.8 (vendored, MIT)
├── cmake/ MinGW cross-compilation toolchain
├── assets/windows/ Branded PNG/ICO and Windows resource manifest
├── tests/ Python bridge + native protocol regression suite
├── VERSION Authoritative release version
├── CMakeLists.txt Cross-platform build (Linux, macOS, Windows)
├── setup.sh Linux/macOS installer for all 13 tools
├── setup.ps1 Windows installer for all 13 tools
├── demo.py Full feature demonstration script
├── .mcp.json Claude Code config
├── .cursor/mcp.json Cursor config
├── .vscode/mcp.json VS Code / Copilot config
├── .windsurf/mcp.json Windsurf config
├── .omp/mcp.json omp config
├── .cline/mcp.json Cline config
├── .roo/mcp.json Roo Code config
├── .zed/settings.json Zed config
├── .gemini/settings.json Gemini CLI config
├── .codex/config.toml Codex CLI config
└── .continue/config.yaml Continue configWire protocol: MCP via the official Python SDK · stdio transport. Local stdio servers do not use OAuth; clients may display authentication as “Unsupported” or “N/A”, which is expected.
Building from Source
# Linux / macOS
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure
# Windows (MSVC + vcpkg)
cmake -B build -DCMAKE_TOOLCHAIN_FILE=[vcpkg]/scripts/buildsystems/vcpkg.cmake
cmake --build build --config Release
# Windows (cross-compile from Linux)
cmake -B build-win -DCMAKE_TOOLCHAIN_FILE=cmake/mingw-w64-x86_64.cmake
cmake --build build-winRequirements: CMake 3.16+, C++17 compiler, SDL2, OpenGL
Trust Model
imgui-mcp is a local development tool. Several tools intentionally read or write paths available to the server process (screenshots, textures, layouts, and code exports), so connect only trusted MCP clients and run it with the least filesystem privileges your project needs.
License
MIT — see LICENSE. Dear ImGui is vendored under its own MIT license.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/SaloQT/imgui-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server