MCP server giving AI agents eyes on OpenImageDebugger buffers in live gdb/lldb sessions
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Open Image Debugger is a tool for visualizing in-memory buffers during debug
sessions, compatible with both GDB and LLDB. It works out of the box with
instances of the OpenCV Mat class and Eigen matrices, but can also be
customized to work with any arbitrary data structure.

Prefer VS Code or a fork (Cursor, VSCodium, Windsurf, β¦)? Skip the manual build β install the extension from the VS Code Marketplace or Open VSX. See Installation below.
New β declarative custom types. You can now describe your own buffer types in a
.oid/types.jsonfile instead of writing Python; the same file works in gdb, lldb, and the VS Code extension. See doc/declarative-types.md.
[0, 1], where 0
represents black and 1 represents white.apt installapt install command below. Alternatively, configure with -DNFD_PORTAL=ON to use the xdg-desktop-portal (D-Bus) dialog backend instead of GTK.All other third-party libraries are bundled as git submodules and built from source, so they don't need to be installed:
stb_image, stb_image_write, stb_truetype)Note: this list might get out-of-date by accident. For a more accurate list of requirements, please check what is used in https://github.com/OpenImageDebugger/OpenImageDebugger/blob/main/.github/workflows/build.yml and in the CI container images defined in https://github.com/OpenImageDebugger/dockerfiles.
The quickest way to get started is the Open Image Debugger extension, available for VS Code and compatible forks (Cursor, VSCodium, Windsurf, and others):
If you'd rather build and integrate the desktop version manually, follow the steps below.
On Ubuntu, you can install most of the dependencies with the following command:
Clone the source code to any folder you prefer and initialize the submodules:
Now run the following commands to build it:
GDB integration: Edit the file ~/.gdbinit (create it if it doesn't exist)
and append the following line:
LLDB integration: Edit the file ~/.lldbinit (create it if it doesn't
exist) and append the following line:
At the moment, the MacOS build is only known to work with python3 and lldb
installed from Homebrew (the system-provided LLDB from the
Xcode Command Line Tools is not supported). Install them with:
Make sure python3 resolves to the Homebrew one β run which python3 and
confirm it points under the Homebrew prefix (/opt/homebrew on Apple Silicon,
/usr/local on Intel; brew --prefix prints it), rather than a pyenv, conda or
system Python. The standard Homebrew install puts that prefix's bin on your
PATH.
Then debug your program using the Homebrew LLDB, for example:
After compiling the plugin, you can test it by running the following command (use the same Python 3 interpreter CMake found when building):
On MacOS, invoke the test with the full path to the Homebrew python3, for
example:
If the installation was succesful, you should see the Open Image Debugger window
with the buffers sample_buffer_1 and sample_buffer_2.
When the debugger hits a breakpoint, the Open Image Debugger window will be
opened. You only need to type the name of the buffer to be watched in the
"add symbols" input, and press <enter>.
You can also open an image or NumPy array in the viewer without a debugger
session at all, either from the File β Open menu (shortcut Ctrl+O) or
from the command line.
From the command line, pass one or more files with the repeatable -o /
--open flag:
Supported formats:
| Category | Extensions |
|---|---|
| Images (via stb_image) | png, jpg/jpeg, bmp, tga, gif, psd, hdr, ppm/pgm/pnm |
| NumPy arrays | npy (little-endian uint8/uint16/int16/int32/float32/float64; 2-D grayscale or 3-D with 1β4 channels) |
Files opened this way are shown alongside any debugger buffers, but they are never reported back to a debugger and are not saved as session state.
Linux build note: the native file dialog requires GTK 3 (
libgtk-3-dev) at build time, or configure with-DNFD_PORTAL=ONto use the xdg-desktop-portal (D-Bus) backend instead. MacOS and Windows need no extra packages.
Open Image Debugger does not register itself as a system handler for these
file types; use the File β Open menu or the --open flag to load them.
The (min) and (max) fields on top of the buffer view can be changed to control autocontrast settings. By default, Open Image Debugger will automatically fill these fields with the mininum and maximum values inside the entire buffer, and the channel values will be normalized from these values to the range [0, 1] inside the renderer.
Sometimes, your buffer may contain trash, uninitialized values that are either too large or too small, making the entire image look flat because of this normalization. If you know the expected range for your image, you can manually change the (min) and (max) values to focus on the range that you are interested.
Sometimes you want to compare two buffers being visualized, and need to zoom in
different places of these buffers. If they are large enough, this can become a
very hard task, especially if you are comparing pixel values. This task is made
easier by the lock buffers tool (which is toggled by the button with a chain
icon).
When it is activated, all buffers are moved/zoomed simultaneously by the same
amount. This means you only need to align the buffers being compared once;
after activating the lock buffers mode, you can zoom in anywhere you wish in
one buffer that all other buffers will be zoomed in the same location.
If you need to quickly move to any pixel location, then the go to
functionality is what you are looking for. Press Ctrl+L and two input fields
corresponding to the target destination in format <x, y> will appear at the
bottom right corner of the buffer screen. Type the desired location, then press
enter to quickly zoom into that location.
Sometimes you may want to export your buffers to be able to process them in an external tool. In order to do that, right click the thumbnail corresponding to the buffer you wish to export on the left pane and select "export buffer".
Open Image Debugger supports two export modes. You can save your buffer as a PNG
(which may result in loss of data if your buffer type is not uint8_t) or as a
binary file that can be opened with any tool.
Buffers exported in the Octave matrix format can be loaded with the function
oid_load.m, which is available in the matlab folder. To use it, add this
folder to Octave/Matlab path variable and call
oid_load('/path/to/buffer.dump').
Open Image Debugger ships an experimental MCP server (oid-mcp) that
lets AI coding agents inspect your buffers in a live gdb/lldb session β
list observable symbols at a breakpoint, view renderings, read exact
values, dump lossless .npy copies, and mirror buffers into the viewer.
Agents can also control and read back a running viewer's view β pan,
zoom, rotate, channel, and auto-contrast β including one opened
standalone with no debugger attached. It is opt-in (launch the debugger
with OID_AGENT=1) and exposes debuggee memory to local processes, so
enable it only in trusted, local development.
See resources/oidmcp/README.md for
deployment and usage instructions.
By default, the plugin works with several data types, including OpenCV's Mat,
CvMat and IplImage and Eigen's Matrix and Map.
Supported library versions: OpenCV 2β5 and Eigen 3.x. The OpenCV
Mat/CvMat channel count is read from the type-flag bit packing in a
version-adaptive way, so both the pre-5 and the OpenCV 5 layouts resolve
correctly; CvMat and IplImage are the legacy C API and therefore apply
only to OpenCV builds that still expose it (4.x and earlier).
To support a different buffer type, describe it in a .oid/types.json file at
your workspace root β no Python required. The common case is five fields:
The same file is read by gdb, lldb, and the VS Code extension. You can also
point OID at files outside the workspace with the OID_TYPES_PATH environment
variable. The full format β every field, the expression grammar, dtype names,
discovery and precedence, and a walkthrough migrating an existing Python
inspector β is documented in
doc/declarative-types.md, and the built-in types in
resources/oidscripts/oidtypes/builtin_types.json double as a worked-example
gallery.
The original Python path is still supported for cases the declarative format
cannot express, but it is no longer the preferred approach for new types.
Implement a TypeInspectorInterface subclass from
resources/oidscripts/oidtypes/interface.py; see
doc/python-inspectors.md for the full instructions β
the interface methods, the buffer-metadata dictionary contract, and the debug
decorators.
Open Image Debugger remembers its window size and position, the width of the
symbol list pane, the auto-contrast and link-views toggles, the buffers you
viewed last, and the directory you last exported to. The application writes
this state itself β it is not a preferences file meant to be edited by hand β
and keeps it in OpenImageDebugger/imgui_settings.json under:
| OS | Directory |
|---|---|
| Linux | $XDG_CONFIG_HOME, or $HOME/.config when that is unset |
| macOS | $HOME/Library/Application Support |
| Windows | %APPDATA% |
Delete that file while the viewer is not running to restore the defaults β a running viewer rewrites it shortly after any change to that state, and again when it exits. This is the fix if the viewer reopens at a window position that is off-screen.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/openimagedebugger-mcp)<a href="https://allmcps.com/mcp/openimagedebugger-mcp"><img src="https://allmcps.com/api/badge/openimagedebugger-mcp?style=directory" alt="OpenImageDebugger MCP on AllMCPs" /></a>