RenderDoc MCP Server
# RenderDoc MCP Server
RenderDoc UI拡張機能として動作するMCPサーバー。AIアシスタントがRenderDocのキャプチャデータにアクセスし、グラフィックスデバッグを支援する。
## アーキテクチャ
```
Claude/AI Client (stdio)
│
▼
MCP Server Process (Python + FastMCP 2.0)
│ File-based IPC (%TEMP%/renderdoc_mcp/)
▼
RenderDoc Process (Extension)
```
RenderDoc内蔵のPythonにはsocketモジュールがないため、ファイルベースのIPCで通信を行う。
## セットアップ
### 1. RenderDoc拡張機能のインストール
```bash
python scripts/install_extension.py
```
拡張機能は `%APPDATA%\qrenderdoc\extensions\renderdoc_mcp_bridge` にインストールされる。
### 2. RenderDocで拡張機能を有効化
1. RenderDocを起動
2. Tools > Manage Extensions
3. "RenderDoc MCP Bridge" を有効化
### 3. MCPサーバーのインストール
```bash
uv tool install
uv tool update-shell # PATHに追加
```
シェルを再起動すると `renderdoc-mcp` コマンドが使えるようになる。
> **Note**: `--editable` を付けると、ソースコードの変更が即座に反映される(開発時に便利)。
> 安定版としてインストールする場合は `uv tool install .` を使用。
### 4. MCPクライアントの設定
#### Claude Desktop
`claude_desktop_config.json` に追加:
```json
{
"mcpServers": {
"renderdoc": {
"command": "renderdoc-mcp"
}
}
}
```
#### Claude Code
`.mcp.json` に追加:
```json
{
"mcpServers": {
"renderdoc": {
"command": "renderdoc-mcp"
}
}
}
```
## 使い方
1. RenderDocを起動し、キャプチャファイル (.rdc) を開く
2. MCPクライアント (Claude等) から RenderDoc のデータにアクセス
## MCPツール一覧
| ツール | 説明 |
|--------|------|
| `get_capture_status` | キャプチャの読み込み状態を確認 |
| `get_draw_calls` | ドローコール一覧を階層構造で取得 |
| `get_draw_call_details` | 特定のドローコールの詳細情報を取得 |
| `get_shader_info` | シェーダーのソースコード・定数バッファの値を取得 |
| `get_buffer_contents` | バッファの内容を取得 (Base64) |
| `get_texture_info` | テクスチャのメタデータを取得 |
| `get_texture_data` | テクスチャのピクセルデータを取得 (Base64) |
| `get_pipeline_state` | パイプライン状態を取得 |
## 使用例
### ドローコール一覧の取得
```
get_draw_calls(include_children=true)
```
### シェーダー情報の取得
```
get_shader_info(event_id=123, stage="pixel")
```
### パイプライン状態の取得
```
get_pipeline_state(event_id=123)
```
### テクスチャデータの取得
```
# 2Dテクスチャのmip 0を取得
get_texture_data(resource_id="ResourceId::123")
# 特定のmipレベルを取得
get_texture_data(resource_id="ResourceId::123", mip=2)
# キューブマップの特定の面を取得 (0=X+, 1=X-, 2=Y+, 3=Y-, 4=Z+, 5=Z-)
get_texture_data(resource_id="ResourceId::456", slice=3)
# 3Dテクスチャの特定の深度スライスを取得
get_texture_data(resource_id="ResourceId::789", depth_slice=5)
```
### バッファデータの部分取得
```
# バッファ全体を取得
get_buffer_contents(resource_id="ResourceId::123")
# オフセット256から512バイト取得
get_buffer_contents(resource_id="ResourceId::123", offset=256, length=512)
```
## 要件
- Python 3.10+
- [uv](https://docs.astral.sh/uv/)
- RenderDoc 1.20+
> **Note**: 動作確認はWindows + DirectX 11環境でのみ行っています。
> Linux/macOS + Vulkan/OpenGL環境でも動作する可能性がありますが、未検証です。
## ライセンス
MIT
TDQS
Scored across 15 tools
Each tool targets a distinct concern: retrieval of specific resources (buffers, textures, pipeline state), listing or querying actions (draw calls, frame summary), searching by criteria (shader, texture, resource), and file management (list/open captures). There is no overlap that would cause an agent to pick the wrong tool.
Tool names follow a consistent verb_noun pattern: get_ for direct retrieval, find_draws_by_ for search operations, list_ and open_ for capture file management. The verbs clearly indicate the action type, and nouns specify the target, making the naming predictable and intuitive.
At 15 tools, this server is well-scoped for a graphics debugging domain. Each tool serves a meaningful analysis or management purpose, and the count is within the ideal range without redundancy or excessive granularity.
The tool surface covers the primary RenderDoc workflows: opening captures, inspecting frames and draw calls, retrieving resources, and searching by resource usage. Minor gaps exist (e.g., no tool to fetch rendered output images or detailed mesh data), but agents can accomplish core analysis tasks without dead ends.