embedded-mcp-toolkit
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DEVICE | No | 默认的设备名称,对应config.yaml中devices下的key | board-b |
| LOG_DIR | No | 日志存储的目录,相对于MCP server进程的工作目录 | ./log |
| LOG_SAVE | No | 是否存储日志到文件("1"表示开启) | 1 |
| BOARD_CONFIG_PATH | No | 配置文件路径,相对于MCP server进程的工作目录 | ./configs/config.yaml |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| greet_toolB | Greet someone by name |
| version_toolA | Get the MCP server version and toolkit information |
| device_info_toolA | Get device configuration. Uses the default device when no name is given; returns all devices when 'all' is specified. |
| session_infoA | Query active session metadata. Pass session_id for one session, device for all sessions of a device, or neither for all active sessions. Each session returns: session id, connection type (serial/ssh/adb), device name, connection info (e.g. COM3@115200), creation time, and the raw session log file path (serial/ssh/adb traffic recorded continuously by the server, including full boot logs after reset/reboot). |
| host_infoA | Query the MCP host endpoint (username@ip) of @smai-kit/embedded-mcp-toolkit for constructing cross-machine file transfers (scp) when this MCP (@smai-kit/embedded-mcp-toolkit) runs on Windows and the AI client runs on Linux. Also returns the @smai-kit/embedded-mcp-toolkit log save directories (business log & raw data log absolute paths) for locating/cleaning up logs. Returns 'local started' with no endpoint for local launches. |
| ssh_shell_openA | Open an interactive SSH shell session to the board. Returns the initial banner output. |
| ssh_shell_closeB | Close an SSH shell session and release the connection. |
| ssh_shell_writeA | Send a command to an SSH shell session. Do NOT call this concurrently with ssh_shell_exec/ssh_shell_read on the same session_id — concurrent access to the same SSH shell corrupts the output buffer. |
| ssh_shell_readA | Read output from an SSH shell session. Do NOT call this concurrently with ssh_shell_exec/ssh_shell_write on the same session_id — concurrent access to the same SSH shell corrupts the output buffer. |
| ssh_shell_execA | Send a command to an SSH shell session and wait for the output. Combines write + read in one call, with automatic completion detection (marker/prompt). IMPORTANT: Do NOT issue concurrent commands to the same session_id — the SSH shell is a single channel; concurrent calls will interleave output and corrupt results. Always wait for the previous command to finish before sending the next one. If you need parallel execution, open multiple sessions via ssh_shell_open. |
| ssh_shell_send_ctrlA | Send a control character (Ctrl+C/U/D/Z) to an SSH shell session without appending a newline. |
| ssh_shell_connectionA | Check active SSH connections on the remote board. Shows which client IPs are connected to the SSH service (port 22). |
| ssh_shell_loginA | One-click SSH login: connect, detect PSH state, auto-unlock if locked, and return a ready session. Combines open + PSH detect + unlock into a single call. |
| ssh_sftp_uploadA | Upload a local file to the remote board over SFTP, reusing an existing SSH session. |
| ssh_sftp_downloadA | Download a remote file from the board to local over SFTP, reusing an existing SSH session. |
| ssh_buildA | Execute a build command on the remote server via SSH, wait for completion, classify errors/warnings, and return structured build results for AI analysis. IMPORTANT: Each session supports only ONE build at a time. For concurrent builds, open multiple sessions via ssh_shell_open and assign one build per session. |
| serial_openB | Open a serial port connection and start an interactive shell session. Returns the initial banner output. |
| serial_closeA | Close a serial port session and release the port. |
| serial_writeB | Send a command to a serial shell session. Do NOT call this concurrently with serial_exec/serial_read on the same session_id — concurrent access to the same serial console corrupts the output buffer. |
| serial_readA | Read output from a serial shell session. Do NOT call this concurrently with serial_exec/serial_write on the same session_id — concurrent access to the same serial console corrupts the output buffer. |
| serial_execA | Send a command to a serial shell session and wait for the output. Combines write + read in one call, with automatic completion detection (marker/prompt). IMPORTANT: Do NOT issue concurrent commands to the same session_id — the serial console is a single channel; concurrent calls will interleave output and corrupt results. Always wait for the previous command to finish before sending the next one. If you need parallel execution, open multiple sessions via serial_open. |
| serial_send_ctrlA | Send a control character (Ctrl+C/U/D/Z) to a serial shell session without appending a newline. |
| serial_shell_loginA | One-click serial login: connect, detect PSH state, auto-unlock if locked, and return a ready session. Combines open + PSH detect + unlock into a single call. |
| serial_enter_ubootA | Enter U-Boot by rebooting the device and stopping autoboot. Detection rules (autoboot prompts, command prompt, verify env keys) are configurable via device config serial.uboot; built-in defaults already cover Hit/Press x any-key/key/SPACE/Ctrl+C/Ctrl+u x stop/interrupt/abort wordings. Pre-check before rebooting (buffer tail, zero side effects): already at a U-Boot prompt returns success without rebooting; at a login/Password prompt fails fast ('reboot' would be consumed as input). restart=true forces a reboot cycle even when already at a U-Boot prompt: sends the U-Boot 'reset' command and re-intercepts autoboot to land back in U-Boot (Linux is never involved; the Linux-side path keeps using 'reboot'). Kernel-boot detection and prompt matching are not gated on an interrupt: devices that boot straight to the kernel fail fast, devices that disable autoboot (bootdelay=-2) succeed fast, instead of waiting out the full timeout. After the interrupt, two-layer strategy: prompt match first; if not matched within a short window, sends 'printenv' and verifies U-Boot env keys. Fails fast on kernel boot or verify timeout. |
| serial_uboot_stateA | Query, detect, or force-set the U-Boot mark of a serial session. The mark decides serial_exec's marker wrapping (U-Boot sessions use plain style without subshell). Actions: 'detect' (default) — classify the live environment in two layers. Passive first (zero side effects): buffer-tail anchors only — U-Boot prompt, login prompt, kernel boot, autoboot countdown. Anything else (e.g. a bare '#' tail, ambiguous between Linux root shell and custom U-Boot prompts) falls through to an active two-step probe: 'printenv' (>=2 U-Boot env verify keys → U-Boot), then 'echo $$' (whole-line numeric PID → system; whole-line '$$' or 'Unknown command' → U-Boot). Conclusive results sync the mark automatically. WARNING: each probe consumes one line of input — do NOT detect while a command may still be running or waiting for interactive input (e.g. Y/N). 'set'/'clear' — force the mark when auto-detection is out of sync; 'status' — read the mark only, no device I/O. |
| serial_uploadA | Upload a binary file to the device over ZMODEM via an existing serial session. The device must have lrzsz installed (rz command). IMPORTANT: this tool triggers the device-side rz by itself (via recv_cmd); do NOT manually run rz (or serial_exec/write rz) on the session beforehand — a pre-started rz enters its own waiting state that breaks the tool's ZMODEM handshake. Just call this tool and pass recv_cmd when a working directory change is needed (e.g. "cd /home && rz"). Blocks until transfer completes, fails, or times out; progress is logged to stderr. Two timeouts: idle_timeout aborts on stalled transfer (real failure); timeout caps total duration and reports a suggested value if still progressing. |
| serial_downloadA | Download a binary file from the device over ZMODEM via an existing serial session. The device must have lrzsz installed (sz command). IMPORTANT: this tool triggers the device-side sz by itself (via send_cmd); do NOT manually run sz (or serial_exec/write sz) on the session beforehand — a pre-started sz enters its own sending state that breaks the tool's ZMODEM handshake. Just call this tool and pass send_cmd when a directory change is needed (e.g. "cd /home && sz {remote}"). remote_path resolves on the device relative to the shell's current working directory — prefer an absolute path, or combine send_cmd with a cd to pin the directory. If the remote file does not exist or is unreadable, sz errors out and the transfer fails (a partial local file, if any, is removed on failure). Blocks until transfer completes, fails, or times out; progress is logged to stderr. Two timeouts: idle_timeout aborts on stalled transfer (real failure); timeout caps total duration and reports a suggested value if still progressing. |
| port_scan_toolA | Scan Windows Device Manager for available COM (serial) and LPT (parallel) ports |
| network_scan_toolA | Scan Windows network adapters and configurations (IP, MAC, status, speed) |
| subnet_check_toolA | Analyze subnet information for a target IP address. Retrieves host IP, subnet mask, and gateway, calculates subnet range (network address, broadcast address, usable host range, CIDR), and determines whether the target IP falls within the same subnet as the host. |
| adb_device_listA | List all connected ADB devices and their status (device, offline, unauthorized, etc.) |
| adb_execA | Execute a one-shot ADB command without a persistent session. Use for adb devices, install, push, or short shell commands. |
| adb_shell_openA | Open an interactive ADB shell session to an Android device. Returns the initial banner output. |
| adb_shell_closeA | Close an ADB shell session and terminate the adb process. |
| adb_shell_writeA | Send a command to an ADB shell session. Do NOT call this concurrently with adb_shell_exec/adb_shell_read on the same session_id — concurrent access to the same ADB shell corrupts the output buffer. |
| adb_shell_readA | Read output from an ADB shell session. Do NOT call this concurrently with adb_shell_exec/adb_shell_write on the same session_id — concurrent access to the same ADB shell corrupts the output buffer. |
| adb_shell_execA | Send a command to an ADB shell session and wait for the output. Combines write + read in one call, with automatic completion detection (marker/prompt). IMPORTANT: Do NOT issue concurrent commands to the same session_id — the ADB shell is a single channel; concurrent calls will interleave output and corrupt results. Always wait for the previous command to finish before sending the next one. If you need parallel execution, open multiple sessions via adb_shell_open. |
| adb_shell_send_ctrlA | Send a control character (Ctrl+C/U/D/Z) to an ADB shell session without appending a newline. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 38 tools
Tool purposes are mostly clear due to transport prefixes and distinct verbs, but a few pairs blur boundaries: ssh_shell_open vs ssh_shell_login/serial_shell_login are convenience wrappers around open, and adb_exec vs adb_shell_exec differ only in whether a persistent session is used. The detailed descriptions help resolve these, so the overlap is manageable but not zero.
The core convention is [transport]_[action] (e.g. ssh_shell_exec, serial_exec, adb_shell_open), but it is applied unevenly: serial_open/serial_close lack the 'shell' segment used by ssh_shell_open/adb_shell_open, adb_exec sits alongside adb_shell_exec with a different implication, and several tools use a _tool suffix (version_tool, port_scan_tool, greet_tool) while others do not. Still readable, but the conventions are mixed.
At 38 tools, this exceeds the 25+ heavy threshold. The count is inflated by triplicating nearly identical session operations across SSH, serial, and ADB, plus a set of one-off utility tools; while systematic, it creates real selection overhead for agents.
The toolkit provides comprehensive lifecycle coverage for SSH, serial, and ADB sessions (open/read/write/exec/close), file transfer in both directions, U-Boot control, and environment metadata. Minor gaps exist—ADB file transfer is only available via generic adb_exec, and there is no dedicated reboot/port-forwarding tool—but these are workable without dead ends.