renderdoc-mcp
$\Large\color{#ff69b4}{\textsf{This is a personal }}$ $\Large\color{#ff69b4}{\mathtt{✨ vibe\text{-}coding ✨}}$ $\Large\color{#ff69b4}{\textsf{project —}}$ $\Large\color{#ff69b4}{\textsf{built for fun, not for production use.}}$
$\small\color{gray}{\textsf{I have no idea why this repo has so many stars...}}$
MCP server for RenderDoc — let AI assistants analyze GPU frame captures (.rdc files) for graphics debugging and performance analysis.
Built on the Model Context Protocol, works with Claude Desktop, Claude Code, and any MCP-compatible client.
Features
- 42 tools covering the full RenderDoc analysis workflow
- 10 high-level tools for one-call analysis (draw call state, frame overview, diff, batch export, pixel region sampling, etc.)
- 3 built-in prompts for guided debugging
- Human-readable output — blend modes, depth functions, topology shown as names not numbers
- GPU quirk detection — auto-identifies Adreno/Mali/PowerVR/Apple-specific pitfalls from driver name
- Headless — no GUI needed, runs entirely via RenderDoc's Python replay API
- Pure Python — single
pip install, no build step - Supports D3D11, D3D12, OpenGL, Vulkan, OpenGL ES captures
Quick Start
1. Prerequisites
- Python 3.10+
- RenderDoc installed (download)
- You need the
renderdoc.pyd(Windows) orrenderdoc.so(Linux) Python module - It ships with every RenderDoc installation
- You need the
2. Install
git clone https://github.com/Linkingooo/renderdoc-mcp.git
cd renderdoc-mcp
pip install -e .
3. Find your renderdoc.pyd path
The Python module is in your RenderDoc install directory:
You need the directory containing this file.
4. Configure your MCP client
Edit claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"renderdoc": {
"command": "python",
"args": ["-m", "renderdoc_mcp"],
"env": {
"RENDERDOC_MODULE_PATH": "C:\\Program Files\\RenderDoc"
}
}
}
}
Add to .claude/settings.json:
{
"mcpServers": {
"renderdoc": {
"command": "python",
"args": ["-m", "renderdoc_mcp"],
"env": {
"RENDERDOC_MODULE_PATH": "C:\\Program Files\\RenderDoc"
}
}
}
}
# Set the module path
export RENDERDOC_MODULE_PATH="/path/to/renderdoc" # Linux/macOS
set RENDERDOC_MODULE_PATH=C:\Program Files\RenderDoc # Windows
# Run
python -m renderdoc_mcp
Usage Examples
Once configured, just talk to your AI assistant:
"Open
frame.rdcand show me what's happening in the frame"
"Find the draw call that renders the character model and check its pipeline state"
"Why is my shadow map rendering black? Check the depth pass"
"Analyze performance — are there any redundant draw calls?"
Typical Tool Flow
open_capture("frame.rdc") # Load the capture
├── get_capture_info() # API, GPU, known_gpu_quirks
├── get_frame_overview() # Frame-level stats and render passes
├── get_draw_call_state(142) # Complete draw call state in one call
├── diff_draw_calls(140, 142) # Compare two draw calls (with implications)
├── export_draw_textures(142, "./tex/") # Batch export all bound textures
├── save_render_target(142, "./rt.png") # Save render target snapshot
├── analyze_render_passes() # Auto-detect render pass boundaries
├── find_draws(blend=True, min_vertices=1000) # Search by rendering state
├── sample_pixel_region(rt_id, 0,0,512,512) # Scan RT region for NaN/Inf/negatives
├── pixel_history(id, 512, 384) # Debug a specific pixel
├── export_mesh(142, "./mesh.obj") # Export mesh as OBJ
└── close_capture() # Clean up
For performance and diagnostic analysis:
get_pass_timing(granularity="pass") # Find most expensive render passes
analyze_overdraw() # Fill-rate pressure estimate
analyze_bandwidth() # Memory bandwidth estimate
analyze_state_changes() # Batching opportunities
diagnose_negative_values() # Find NaN/Inf/negative color values (爆闪)
diagnose_precision_issues() # R11G11B10, D16, SRGB mismatches
diagnose_reflection_mismatch() # Reflection artifact diagnosis
diagnose_mobile_risks() # Comprehensive mobile GPU risk check
For lower-level inspection, all granular tools remain available:
set_event(142) # Navigate to a draw call
├── get_pipeline_state() # Inspect rasterizer/blend/depth
├── get_shader_bindings("pixel") # Check what textures/buffers are bound
├── get_cbuffer_contents("pixel", 0, filter="ibl") # Read shader constants (filterable)
├── disassemble_shader("pixel", search="SampleSH") # Shader code with context search
└── save_texture(id, "rt.png") # Export a specific texture
Tools
Session Management (4)
Event Navigation (5)
Pipeline Inspection (4)
Resource Analysis (4)
Data Extraction (8)
Shader Analysis (3)
Advanced (6)
Performance Analysis (4)
Diagnostics (4)
Prompts
Built-in prompt templates to guide AI through common workflows:
How It Works
AI Assistant ←—MCP—→ renderdoc-mcp server ←—Python API—→ renderdoc.pyd ←→ GPU replay
The server uses RenderDoc's headless replay API (renderdoc.pyd) to:
- Open
.rdccapture files without the GUI - Replay frames and query pipeline state at any event
- Extract textures, buffers, shader data, and pixel history
- Return structured JSON for the AI to reason about
Development
# Install in dev mode
pip install -e .
# Run tests (no RenderDoc needed — uses mocks)
python -m pytest tests/ -v
# Project structure
src/renderdoc_mcp/
├── server.py # FastMCP server, 3 prompt definitions
├── session.py # Capture lifecycle, resource/texture caches (singleton)
├── util.py # Serialization, enum maps, blend formula, module loader
└── tools/
├── session_tools.py # open/close/info (GPU quirks) + get_frame_overview
├── event_tools.py # list/get/set/search actions + find_draws
├── pipeline_tools.py # pipeline state, shader bindings, vertex inputs + get_draw_call_state
├── resource_tools.py # texture/buffer/resource enumeration
├── data_tools.py # save/read/pick/stats + read_texture_pixels + export_draw_textures, save_render_target, export_mesh
├── shader_tools.py # disassembly (fallback chain, search), reflection, cbuffer contents (filter)
├── advanced_tools.py # pixel history, post-VS data + diff_draw_calls (implications), analyze_render_passes, sample_pixel_region, debug_shader_at_pixel
├── performance_tools.py # get_pass_timing, analyze_overdraw, analyze_bandwidth, analyze_state_changes
└── diagnostic_tools.py # diagnose_negative_values, diagnose_precision_issues, diagnose_reflection_mismatch, diagnose_mobile_risks
License
MIT