gdb-multiarch-mcp
Provides tools for debugging and inspecting C++ executables through GDB, enabling expression evaluation, breakpoint management, and memory analysis.
Click on "Install 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-mcpstart 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.
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.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sbergeron42/gdb-multiarch-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server