gdb-multiarch-mcp
Provides tools for debugging and inspecting C++ executables through GDB, enabling expression evaluation, breakpoint management, and memory analysis.
Click on "Deploy 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., "@gdb-multiarch-mcp start a session and set a breakpoint at offset 0x2A34B0"
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.
gdb-multiarch-mcp
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).
What It Does
When Claude (or any MCP client) calls switch_start_session, the server:
Launches
gdb-multiarchinside WSLLoads the Switch debugging commands (
.gdbinit.switch)Connects to the GDB stub via
target extended-remoteWaits for the application to launch, attaches to it
Automatically sets
$mainto the base address ofcross2_Release.nss
From there, all standard GDB operations and Switch-specific tools are available through MCP tool calls.
Related MCP server: mcp-gdbserver
Prerequisites
Windows with WSL —
gdb-multiarchruns inside WSL (tested with Debian)gdb-multiarch installed in WSL (
sudo apt install gdb-multiarch)Python 3.10+ in WSL
A GDB stub — either Yuzu's built-in GDB stub or a Switch with sys-gdbstub
Claude Code (or any MCP-compatible client)
Installation
1. Install gdb-multiarch in WSL
wsl -d Debian
sudo apt install gdb-multiarch2. Install the MCP server
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-mcp3. Add to Claude Code
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"
]
}
}
}4. Verify
claude mcp listYou should see gdb-multiarch: ... - Connected.
Configuration
Set these environment variables in WSL to customize the connection:
Variable | Default | Description |
|
| IP address of the Switch/Yuzu GDB stub |
|
| GDB stub port |
|
| Path to the gdb-multiarch binary |
|
| 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"
}
}
}
}Available Tools
Session Management
Tool | Description |
| Connect to the Switch/Yuzu, attach to the game, set |
| Disconnect and clean up |
Switch Debugging Tools
Tool | Description |
| Set breakpoint at |
| NOP instruction at offset (writes |
| Stub function at offset (writes |
| Replace instruction at offset with arbitrary value |
| Get PC as offset relative to |
| Convert absolute address to offset relative to |
| Backtrace as absolute addresses (frame pointer walk) |
| Backtrace with offsets relative to |
| Combined: PC offset + LR offset + full backtrace |
| Hex dump of memory |
| Dump 4 original instructions at offset for later restore |
Standard GDB Tools
All standard gdb-mcp tools are also available:
Tool | Description |
| Execute any GDB command (CLI or MI) |
| Set breakpoint at function/file:line/address |
| List all breakpoints |
| Delete breakpoint by number |
| Enable breakpoint |
| Disable breakpoint |
| Continue execution |
| Step into |
| Step over |
| Pause running program |
| Standard GDB backtrace |
| List threads |
| Switch to thread |
| Select stack frame |
| Current frame info |
| Evaluate C/C++ expression |
| Local variables for a frame |
| CPU register values |
| Call function in target process |
| Session status |
Troubleshooting
"No route to host" when connecting
WSL networking can be tricky. Try:
Confirm SSH is running in WSL:
sudo service ssh startTest connectivity:
nc -vz <switch_ip> 22225Add a route if needed:
sudo ip route add 192.168.1.0/24 via <gateway_ip>Port proxy from Windows PowerShell:
netsh interface portproxy add v4tov4 listenport=22225 listenaddress=127.0.0.1 connectport=22225 connectaddress=<switch_ip>
GDB stub not responding
Make sure the game is running on Yuzu/Switch before calling
switch_start_sessionVerify Yuzu's GDB stub is enabled in
Emulation > Configure > Debug > Enable GDB Stub
Session already running
Call switch_stop_session first, then switch_start_session again.
Credits
Ipiano/gdb-mcp by Andrew Stelter — the upstream MCP server for GDB that this project is built on
Coolsonickirby/smash-ultimate-research-setup — the modified
.gdbinit.switchandattach.py(auto-attach script) used in this projectblujay — the original
.gdbinit.switchcommandsGradualSyrup —
print_addr_setup.py(address-to-offset resolution)Gdbinit by mammon_, elaine, pusillus, mong, zhang le, l0kit, truthix, fG!, gln — the extended
.gdbinitconfiguration
License
MIT — see LICENSE.
Available Tools
33 toolsgdb_call_functionA
Call a function in the target process. WARNING: executes code in the debugged program.
Inputs: function_call (required).
gdb_continueA
Continue execution until next breakpoint or completion. Only use when program is PAUSED.
Inputs: no named parameters.
gdb_delete_breakpointA
Delete a breakpoint by number.
Inputs: number (required).
gdb_disable_breakpointA
Disable a breakpoint by number.
Inputs: number (required).
gdb_enable_breakpointA
Enable a breakpoint by number.
Inputs: number (required).
gdb_evaluate_expressionC
Evaluate a C/C++ expression.
Inputs: expression (required).
gdb_execute_commandA
Execute a raw GDB command (CLI or MI). For Switch-specific operations, prefer the dedicated switch_* tools. IMPORTANT: Do NOT use 'target remote' or 'target extended-remote' — the session auto-connects to the Switch on first use. Do NOT use 'attach' or 'monitor wait application' — handled automatically. $main is already set to the base address of the game executable.
Inputs: command (required).
gdb_get_backtraceC
Get the stack backtrace (standard GDB backtrace).
Inputs: thread_id, max_frames.
gdb_get_frame_infoB
Get information about the current stack frame.
Inputs: no named parameters.
gdb_get_registersB
Get CPU register values.
Inputs: no named parameters.
gdb_get_statusB
Get the current status of the GDB session.
Inputs: no named parameters.
gdb_get_threadsB
Get information about all threads.
Inputs: no named parameters.
gdb_get_variablesC
Get local variables for a stack frame.
Inputs: thread_id, frame.
gdb_interruptA
Interrupt (pause) a running program.
Inputs: no named parameters.
gdb_list_breakpointsB
List all breakpoints with structured data.
Inputs: no named parameters.
gdb_nextC
Step over to the next line.
Inputs: no named parameters.
gdb_select_frameC
Select a specific stack frame.
Inputs: frame_number (required).
gdb_select_threadC
Select a specific thread.
Inputs: thread_id (required).
gdb_set_breakpointA
Set a breakpoint at a function, file:line, or *address. For offset-from-main breakpoints, use switch_break_at instead.
Inputs: location (required), condition, temporary.
gdb_stepB
Step into the next instruction.
Inputs: no named parameters.
switch_break_atA
Set a breakpoint at an offset relative to the base of main ($main). Example: offset '0x3a5f10' sets a breakpoint at $main+0x3a5f10.
Inputs: offset (required).
switch_get_pcA
Get the current PC as an offset relative to the base of main.
Inputs: no named parameters.
switch_localizeB
Convert an absolute address or register value to an offset relative to the base of main. Example: address '$x0' or '0x8012345'.
Inputs: address (required).
switch_my_btA
Print the backtrace as absolute addresses by walking the frame pointer chain. Often misses the first address — use 'p/x $lr' for that.
Inputs: no named parameters.
switch_my_bt2A
Print the backtrace with offsets relative to the base of main. Walks the frame pointer chain and resolves each return address to a module-relative offset.
Inputs: no named parameters.
switch_no_opA
NOP the instruction at the given offset from main. Writes ARM64 NOP (0xD503201F) at $main+offset.
Inputs: offset (required).
switch_prepare_rehookA
Dump the original instructions at an offset (4 instructions / 16 bytes) as 'replace' commands, so you can restore them after hooking.
Inputs: offset (required).
switch_print_traceA
Combined trace: runs get_pc, localize $lr, and my_bt2 in one command. Returns the current PC offset, calling offset, and full backtrace with offsets relative to main.
Inputs: no named parameters.
switch_replaceB
Replace the instruction at an offset from main with a new instruction. Offset and instruction are both hex values.
Inputs: offset (required), instruction (required).
switch_start_sessionA
Start gdb-multiarch and connect to the Switch/Yuzu GDB stub. This MUST be called before any other tool. Connects to the IP/port configured via SWITCH_IP and SWITCH_PORT environment variables (defaults: 192.168.1.235:22225). Automatically loads Switch debug commands, attaches to the game, and sets $main to the base address of cross2_Release.nss. Do NOT manually run 'target remote', 'attach', or 'set $main' — this tool handles all of that.
Inputs: no named parameters.
switch_stop_sessionA
Stop the gdb-multiarch session and disconnect from Yuzu.
Inputs: no named parameters.
switch_stubA
Stub the function at the given offset from main. Writes ARM64 RET (0xD65F03C0) at $main+offset, making the function return immediately.
Inputs: offset (required).
switch_xxdA
Print a hex dump (xxd-style) of memory at the given address.
Inputs: address (required), size (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Tools are clearly separated by 'gdb_' and 'switch_' prefixes, with distinct purposes for each. Specific tools like switch_break_at and gdb_set_breakpoint are well-differentiated by descriptions (offset vs general), though the sheer volume of 33 tools creates cognitive load for selection.
Strict snake_case convention throughout with consistent verb_noun patterns (e.g., gdb_set_breakpoint, switch_start_session, switch_print_trace). The dual-prefix system logically partitions standard GDB operations from Switch-specific utilities without mixing conventions.
At 33 tools, this exceeds the 'too many' threshold (25+) per the rubric. While GDB is complex, the set appears insufficiently consolidated—e.g., switch_my_bt and switch_my_bt2 could be a single tool with a format parameter, as could switch_no_op and switch_stub.
Provides comprehensive coverage for Switch debugging workflows including session management, execution control, breakpoints, inspection, and runtime patching (NOP/stub/replace). Minor gaps exist (no explicit variable assignment, watchpoints, or generic memory write), but gdb_execute_command allows workarounds.
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
The official MCP Server for the Mux API
An MCP server for deep research or task groups
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA GDB/MI protocol server based on the MCP protocol, providing remote application debugging capabilities.68MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for remote debugging with gdbserver, offering full debugging capabilities including breakpoint control, stepping, memory inspection, and process management.MIT
- AlicenseBqualityCmaintenanceMCP server wrapping GDB and GEF for dynamic analysis, enabling interactive debugging and memory inspection via GDB/MI protocol.141MIT
- AlicenseBqualityDmaintenanceMCP server that wraps gdb to enable LLMs to drive live debugging sessions, including starting sessions on binaries, attaching to processes, and running commands.72,027 PyPI4MIT