loading…
Search for a command to run...
loading…
An MCP server providing direct access to gdb-multiarch for debugging Nintendo Switch executables on Yuzu or hardware via a GDB stub. It features specialized too
An MCP server providing direct access to gdb-multiarch for debugging Nintendo Switch executables on Yuzu or hardware via a GDB stub. It features specialized tools for offset-based breakpoints, instruction patching, and frame-pointer backtraces relative to the game's base address.
An MCP (Model Context Protocol) server that gives AI assistants like Claude direct access to gdb-multiarch for debugging Nintendo Switch executables running on Yuzu or a real console with a GDB stub.
Built on top of Ipiano/gdb-mcp, this fork adds Switch-specific debugging tools for offset-based breakpoints, instruction patching (NOP/stub/replace), frame-pointer backtraces, and address localization — all relative to the game's base address ($main).
When Claude (or any MCP client) calls switch_start_session, the server:
gdb-multiarch inside WSL.gdbinit.switch)target extended-remote$main to the base address of cross2_Release.nssFrom there, all standard GDB operations and Switch-specific tools are available through MCP tool calls.
gdb-multiarch runs inside WSL (tested with Debian)sudo apt install gdb-multiarch)wsl -d Debian
sudo apt install gdb-multiarch
From Windows, run:
wsl.exe -d Debian -e bash -c 'export PATH=$HOME/.local/bin:$PATH && pip install --break-system-packages -e /mnt/c/path/to/gdb-multiarch-mcp'
Or from inside WSL:
pip install -e /mnt/c/path/to/gdb-multiarch-mcp
claude mcp add gdb-multiarch -s user -- wsl.exe -d Debian -e bash -c "export PATH=\$HOME/.local/bin:\$PATH && python3 -m gdb_multiarch_mcp"
Or manually add to your .claude.json:
{
"mcpServers": {
"gdb-multiarch": {
"type": "stdio",
"command": "wsl.exe",
"args": [
"-d", "Debian", "-e", "bash", "-c",
"export PATH=$HOME/.local/bin:$PATH && python3 -m gdb_multiarch_mcp"
]
}
}
}
claude mcp list
You should see gdb-multiarch: ... - Connected.
Set these environment variables in WSL to customize the connection:
| Variable | Default | Description |
|---|---|---|
SWITCH_IP |
192.168.1.235 |
IP address of the Switch/Yuzu GDB stub |
SWITCH_PORT |
22225 |
GDB stub port |
GDB_PATH |
gdb-multiarch |
Path to the gdb-multiarch binary |
GDB_MCP_LOG_LEVEL |
INFO |
Logging level (DEBUG, INFO, WARNING, ERROR) |
To set these, add env to your MCP config:
{
"mcpServers": {
"gdb-multiarch": {
"type": "stdio",
"command": "wsl.exe",
"args": ["..."],
"env": {
"SWITCH_IP": "192.168.1.100",
"SWITCH_PORT": "22225"
}
}
}
}
| Tool | Description |
|---|---|
switch_start_session |
Connect to the Switch/Yuzu, attach to the game, set $main. Call this first. |
switch_stop_session |
Disconnect and clean up |
| Tool | Description |
|---|---|
switch_break_at |
Set breakpoint at $main+offset |
switch_no_op |
NOP instruction at offset (writes 0xD503201F) |
switch_stub |
Stub function at offset (writes RET / 0xD65F03C0) |
switch_replace |
Replace instruction at offset with arbitrary value |
switch_get_pc |
Get PC as offset relative to $main |
switch_localize |
Convert absolute address to offset relative to $main |
switch_my_bt |
Backtrace as absolute addresses (frame pointer walk) |
switch_my_bt2 |
Backtrace with offsets relative to $main |
switch_print_trace |
Combined: PC offset + LR offset + full backtrace |
switch_xxd |
Hex dump of memory |
switch_prepare_rehook |
Dump 4 original instructions at offset for later restore |
All standard gdb-mcp tools are also available:
| Tool | Description |
|---|---|
gdb_execute_command |
Execute any GDB command (CLI or MI) |
gdb_set_breakpoint |
Set breakpoint at function/file:line/address |
gdb_list_breakpoints |
List all breakpoints |
gdb_delete_breakpoint |
Delete breakpoint by number |
gdb_enable_breakpoint |
Enable breakpoint |
gdb_disable_breakpoint |
Disable breakpoint |
gdb_continue |
Continue execution |
gdb_step |
Step into |
gdb_next |
Step over |
gdb_interrupt |
Pause running program |
gdb_get_backtrace |
Standard GDB backtrace |
gdb_get_threads |
List threads |
gdb_select_thread |
Switch to thread |
gdb_select_frame |
Select stack frame |
gdb_get_frame_info |
Current frame info |
gdb_evaluate_expression |
Evaluate C/C++ expression |
gdb_get_variables |
Local variables for a frame |
gdb_get_registers |
CPU register values |
gdb_call_function |
Call function in target process |
gdb_get_status |
Session status |
WSL networking can be tricky. Try:
sudo service ssh startnc -vz <switch_ip> 22225sudo ip route add 192.168.1.0/24 via <gateway_ip>netsh interface portproxy add v4tov4 listenport=22225 listenaddress=127.0.0.1 connectport=22225 connectaddress=<switch_ip>
switch_start_sessionEmulation > Configure > Debug > Enable GDB StubCall switch_stop_session first, then switch_start_session again.
.gdbinit.switch and attach.py (auto-attach script) used in this project.gdbinit.switch commandsprint_addr_setup.py (address-to-offset resolution).gdbinit configurationMIT — see LICENSE.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"gdb-multiarch-mcp": {
"command": "npx",
"args": []
}
}
}