Skip to main content
Glama

The Hardware Bridge

Most AI coding tools stop at the editor. The moment you hit a HardFault, a linker overflow, or a stubborn peripheral register, you're back to juggling terminals, OpenOCD scripts, and GDB windows.

EmbiMind MCP connects your AI IDE directly to your ARM GNU Toolchain, OpenOCD, and GDB/MI2—turning your assistant into an embedded co-pilot that stays strictly under your command.

  • Zero Guesswork: Inspects real ELF sections, memory maps, and Cortex-M fault registers (CFSR, HFSR, MMFAR, BFAR).

  • Closed Human-in-the-Loop: AI prepares the plan; you approve every flash erase, target reset, and memory write.

  • Zero Setup Friction: One command (uvx embimind-mcp) auto-provisions the verified ARM toolchain and OpenOCD.


Related MCP server: MCUDebugforAI

How the Closed Human-in-the-Loop Works

flowchart LR
    A["1. AI Diagnoses & Prepares<br/>(flash_preflight / triage_cortex_m)"] --> B["2. SHA-256 Plan Token<br/>(Exact Sectors & Memory Bounds)"]
    B --> C{"3. Human Approval Gate<br/>(user_approved=true)"}
    C -- Approved --> D["4. Atomic Flash & Verify<br/>(flash_and_verify + Reset)"]
    C -- Rejected --> A
    D --> E["5. Live GDB/MI2 Debug<br/>(Breakpoints, Registers, Memory)"]
    E --> A

Every destructive operation is plan-bound and fail-closed—no silent flashes, no unvalidated memory writes, and no host shell escapes.


What It Brings to Your Bench

Capability

What Your AI Can Do

Build & Analyze

ARM GNU Toolchain

Compile C/C++/ASM, link ELFs, generate .bin/.hex, and audit Flash/RAM usage & disassembly.

Target Control

OpenOCD Tcl RPC

Discover board configs, connect SWD/JTAG probes, and run allowlisted target commands.

Live Debugging

Persistent GDB/MI2

Set hardware breakpoints/watchpoints, step instructions, read memory batches, and inspect call stacks.

Fault Triage

Cortex-M Diagnostics

Capture CPUID, ICSR, CFSR, HFSR, MMFAR, BFAR, and core registers in a single call.


30-Second Setup

Add embimind-mcp to Claude Code, Cursor, Codex, Antigravity, or Gemini CLI:

{
  "mcpServers": {
    "embimind-mcp": {
      "command": "uvx",
      "args": ["embimind-mcp"]
    }
  }
}

Or install globally with pip / uv:

pip install embimind-mcp
# or
uv tool install embimind-mcp

On first launch, embimind-mcp verifies and provisions the ARM GNU Toolchain and OpenOCD over HTTPS with SHA-256 verification. All logs go to stderr so MCP STDIO stays clean.


Supported Platforms & Configuration

  • Host OS: Windows x86_64 and Linux x86_64 (auto-provisioned). macOS / ARM64 supported via EMBIMIND_TOOLCHAIN_DIR.

  • Python: >=3.13

  • Target Hardware: ARM Cortex-M targets via OpenOCD + GDB/MI2, with built-in memory-map profiles for STM32F411VETx and STM32F411RE.

Variable

Description

Default

EMBIMIND_APP_DIR

Override per-user app/data/toolchain directory

%LOCALAPPDATA%\EmbiMind (Win) / ~/.local/share/EmbiMind (Linux)

EMBIMIND_TOOLCHAIN_DIR

Use a local ARM GNU + OpenOCD directory (offline/air-gapped)

<EMBIMIND_APP_DIR>/toolchain

EMBIMIND_TOOLCHAIN_URL

Override toolchain archive download URL (HTTPS only)

GitHub Release v1.0.0 asset

EMBIMIND_TOOLCHAIN_SHA256

Expected SHA-256 checksum for custom toolchain archive

Pinned release SHA-256

EMBIMIND_OPENOCD_PORT

Override OpenOCD Tcl RPC port

6666

  • Offline / air-gapped setup: Point EMBIMIND_TOOLCHAIN_DIR to a folder containing arm-gnu-toolchain/bin/ and openocd/bin/.

  • Linux USB permissions: Install udev rules for ST-Link/CMSIS-DAP and add your user to plugdev.

  • Port 6666 conflict: Set EMBIMIND_OPENOCD_PORT or call stop_all_sessions().

Available Tools

79 tools
add_breakpointC

Set a breakpoint at a function, file:line or address.

Inputs: location (required).

address_to_sourceC

Map firmware addresses to source files and line numbers.

Inputs: timeout, demangle, elf_file, elf_path, +2 more.

add_watchpointC

Set a write, read or access watchpoint.

Inputs: expression (required), access.

build_projectB

Build a firmware project using EmbiMind's bundled ARM toolchain.

Prefer building in the user's firmware IDE (e.g., STM32CubeIDE). Only set user_approved=true after the user explicitly approves building via MCP.

Inputs: project_dir (required), clean, flags, defines, +5 more.

check_arm_toolchainB

Detect and validate the configured ARM GNU toolchain.

Inputs: no named parameters.

check_toolchainB

Check that the configured OpenOCD, scripts directory and ARM GDB exist and run.

Inputs: no named parameters.

compile_assemblyC

Compile a .s or preprocessed .S assembly source file into an object file.

Inputs: source (required), flags, output, timeout.

compile_cC

Compile one C source file into an object file.

Inputs: source (required), flags, output, defines, +2 more.

compile_cppC

Compile one C++ source file into an object file.

Inputs: source (required), flags, output, defines, +2 more.

connect_gdbC

Connect GDB to the OpenOCD GDB server.

Inputs: host, port.

convert_elfC

Convert an ELF image to a supported objcopy output format.

Inputs: flags, timeout, elf_file, elf_path, +2 more.

create_static_libraryC

Create a static library archive from object files.

Inputs: output (required), object_files (required), flags, timeout.

detect_hardwareC

Identify the connected debug adapter and physical MCU target.

Inputs: board_name.

disassembleC

Disassemble code at the supplied address, symbol, or register location.

Inputs: count, address, location.

disconnect_gdbA

Disconnect GDB from the target without stopping OpenOCD.

Inputs: no named parameters.

elf_to_binC

Convert an ELF firmware image into a raw binary.

Inputs: flags, timeout, elf_file, elf_path, +1 more.

elf_to_hexC

Convert an ELF firmware image into Intel HEX format.

Inputs: flags, timeout, elf_file, elf_path, +1 more.

evaluate_expressionB

Evaluate a C expression or symbol in the current GDB context.

Inputs: expression (required).

execute_gdb_commandA

Execute one allowlisted GDB CLI command through GDB/MI.

Potentially destructive or state-changing commands require user_approved=true after explicit user approval. Host shell escapes and scripting are blocked.

Inputs: command (required), user_approved.

execute_gdb_mi_commandC

Execute a GDB/MI command, for advanced GDB integration.

Inputs: command (required), user_approved.

execute_openocd_commandB

Execute one allowlisted OpenOCD Tcl command.

Set user_approved=true only after the user has explicitly approved a potentially destructive operation such as flash erase/programming.

Inputs: command (required), user_approved.

finish_target_functionB

Run until the current function returns.

Inputs: no named parameters.

flash_and_verifyC

Atomically program, verify, and optionally reset a target via OpenOCD.

Inputs: elf_path (required), verify, board_name, reset_after, +3 more.

flash_elfB

Program the target via the protected flash_and_verify workflow.

Requires running flash_preflight first, obtaining explicit user approval, and supplying both user_approved=true and the preflight approval_token.

Inputs: verify, elf_path, board_name, reset_after, +3 more.

flash_preflightC

Validate an ELF image against target memory boundaries and issue an approval token.

Inputs: elf_path (required), verify, reset_after, target_name, +1 more.

get_backtraceB

Read the current call stack.

Inputs: no named parameters.

get_debug_adapter_infoA

Return active debug adapter, transport, and OpenOCD connection details.

Inputs: no named parameters.

get_gdb_eventC

Read one queued GDB asynchronous event, if available.

Inputs: timeout.

get_gdb_infoC

Run a GDB info command for the requested topic.

Inputs: topic (required).

get_gdb_statusB

Return the GDB process status.

Inputs: no named parameters.

get_local_variablesA

Read local variables in the selected stack frame.

Inputs: no named parameters.

get_memory_mapC

Return flash, RAM, sector layout, and reserved regions for a target MCU.

Inputs: target_name (required).

get_openocd_command_modeC

Ask the running OpenOCD instance whether a command is config or runtime mode.

Inputs: command_name (required).

get_openocd_statusB

Return OpenOCD process and Tcl RPC connection status.

Inputs: no named parameters.

get_registersB

Read target CPU registers.

Inputs: no named parameters.

get_register_valuesC

Read register values in hexadecimal, octal, binary, decimal or raw format.

Inputs: format.

get_session_stateA

Return compact OpenOCD + GDB session state for fast recovery after compaction.

Inputs: no named parameters.

get_source_listingB

List source around the current execution location.

Inputs: no named parameters.

get_stack_argumentsC

Read arguments for stack frames.

Inputs: no named parameters.

get_target_configurationC

Validate and return a previously registered target configuration.

Inputs: board_name (required).

get_target_infoC

Return hardware profile and memory/capability metadata for a target or board.

Inputs: board_name.

get_target_stateB

Return GDB's current target execution state.

Inputs: no named parameters.

get_threadsB

List threads known to GDB.

Inputs: no named parameters.

halt_targetB

Halt target execution.

Inputs: no named parameters.

inspect_all_elf_headersC

Inspect all ELF header and metadata information.

Inputs: elf_file, elf_path.

inspect_disassemblyC

Disassemble an ELF image with optional symbol/address filtering and pagination.

Inputs: offset, elf_file, elf_path, max_lines, +5 more.

inspect_elf_headerC

Inspect ELF file header information.

Inputs: elf_file, elf_path.

inspect_elf_sectionsC

List sections in an ELF firmware image.

Inputs: elf_file, elf_path, structured.

inspect_elf_segmentsC

Inspect ELF program segments and load information.

Inputs: elf_file, elf_path.

inspect_elf_symbolsC

Inspect symbols in an ELF firmware image with filtering and pagination.

Inputs: offset, demangle, elf_file, elf_path, +4 more.

inspect_file_formatB

Identify the file format and architecture of an object or firmware file.

Inputs: input_file (required).

inspect_memory_usageC

Report ELF section memory usage using the ARM size utility.

Inputs: elf_file, elf_path, structured.

inspect_projectB

Inspect a firmware project (.cproject/CMake/Makefile/bare-metal) in one call.

Inputs: project_dir (required).

list_arm_toolsA

List ARM GNU toolchain executables detected in the configured bin directory.

Inputs: no named parameters. Returns: object

list_breakpointsB

List GDB breakpoints and watchpoints.

Inputs: no named parameters.

list_registered_targetsB

List board names registered in targets.json.

Inputs: no named parameters. Returns: result

load_elf_symbolsA

Load symbols from an ELF file into GDB; this does not flash the target.

Inputs: elf_path (required).

next_targetB

Execute one source-level next operation.

Inputs: no named parameters.

preprocess_sourceC

Run the C/C++ preprocessor on a source file.

Inputs: source (required), flags, output, defines, +2 more.

read_memoryC

Read target memory using GDB.

Inputs: address (required), count, word_size.

read_memory_batchC

Read multiple target memory/register addresses in a single call.

Inputs: addresses (required), word_size.

recover_sessionC

Inspect persisted session metadata, clean up stale PIDs, and report live state.

Inputs: no named parameters.

register_target_configurationC

Register a board using paths relative to the OpenOCD scripts directory.

Example interface_config: interface/stlink.cfg Example target_config: target/stm32f4x.cfg

Inputs: debugger (required), board_name (required), target_config (required), interface_config (required), +1 more.

remove_breakpointB

Remove a breakpoint by its GDB breakpoint number.

Inputs: breakpoint_id (required).

reset_targetB

Reset the target, optionally leaving it halted; requires user approval.

Inputs: halt, user_approved.

resume_targetC

Resume target execution.

Inputs: no named parameters.

search_openocd_commandsB

Search the bundled OpenOCD command catalogue by name, syntax or description.

Inputs: query (required). Returns: result

search_openocd_configsC

Search bundled interface, target and board OpenOCD .cfg files.

Inputs: query (required), limit. Returns: result

start_gdbB

Start the persistent ARM GDB process in MI2 mode.

Inputs: no named parameters.

start_openocdA

Start OpenOCD for a registered board and connect to its Tcl RPC port.

Inputs: board_name (required).

step_targetC

Execute one source-level step.

Inputs: no named parameters.

stop_all_sessionsB

Stop active GDB and OpenOCD sessions and clean up any orphaned PIDs.

Inputs: no named parameters.

stop_gdbB

Gracefully stop the GDB process.

Inputs: no named parameters.

stop_openocdB

Stop the active OpenOCD process.

Inputs: no named parameters.

triage_cortex_mB

Read Cortex-M CPUID, fault status registers (CFSR/HFSR/MMFAR/BFAR), and target state in one call.

Inputs: no named parameters.

verify_flashB

Compare the target's programmed sections against the loaded ELF.

Inputs: no named parameters.

wait_for_target_stopC

Wait for an asynchronous GDB target-stop event.

Inputs: timeout.

write_memoryC

Write target memory. Requires explicit user approval.

Inputs: value (required), address (required), word_size, user_approved.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 79 tools

    Disambiguation2/5

    Several tools have overlapping or near-identical purposes: get_registers vs get_register_values, inspect_elf_header vs inspect_all_elf_headers, elf_to_bin/elf_to_hex vs convert_elf, flash_elf vs flash_and_verify, and stop_all_sessions vs stop_gdb/stop_openocd. Clusters like compile_*/inspect_elf_*/get_*_status are distinguishable, but an agent must read carefully to avoid misselection among the many near-duplicates.

    Naming Consistency4/5

    The set overwhelmingly follows a snake_case verb_object pattern (get_threads, add_breakpoint, stop_openocd, read_memory), which is predictable. Deviations exist, such as the bare verb 'disassemble', conversion-style names (elf_to_bin, address_to_source), and inconsistent prefixing (inspect_elf_header vs inspect_all_elf_headers), but these remain readable.

    Tool Count2/5

    At 79 tools the surface is far beyond what an agent can hold comfortably, and many capabilities are fragmented into single-purpose variants (compile_c/compile_cpp/compile_assembly, four separate ELF inspect tools). The domain is genuinely broad, but much of this should be consolidated into fewer parameterized tools.

    Completeness4/5

    Coverage is unusually thorough: toolchain checking, project build, link/convert, flash preflight and verification, GDB breakpoints/watchpoints, memory and register access, fault triage, and session recovery. Minor gaps remain around target console/semihosting or SWO trace capture and RTOS-aware inspection, but no core workflow is a dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to debug ARM Cortex-M targets via GDB and OpenOCD, supporting attach, breakpoints, stepping, register/memory inspection, and SVD peripheral decoding.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to compile, debug, sample, and inspect MCU firmware through J-Link/pyOCD or a mock engine, including breakpoints, watchpoints, single-stepping, register access, and flash dump operations.
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables AI agents to compile, flash, erase, and read serial output from embedded development boards, with guardrails such as budget limits, serial port mutexes, and mandatory human confirmation for destructive operations.
      5
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to debug STM32 firmware on real hardware by driving GDB with OpenOCD/ST-Link/J-Link to flash, set breakpoints, inspect memory, registers and RTOS state, triage HardFaults, and profile. Returns decoded, structured evidence and suggested next actions instead of raw GDB text, with composite tools that collapse multi-step debug loops into single calls.
      86
      4
      MIT