keil-mdk-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| KEIL_UV4_PATH | No | Absolute path to UV4.exe. If not set, common Keil installation locations are auto-detected. | |
| KEIL_ALLOW_FLASH | No | Master switch for flashing. Defaults to false. Even when enabled, tool calls must also pass confirm=true. | false |
| KEIL_ALLOWED_ROOTS | No | Semicolon-separated list of allowed path roots covering project and build artifact directories. If unset and no default project is configured, file reads are refused. | |
| KEIL_ARTIFACTS_DIR | No | Output directory for build logs and session JSONL files. Defaults to <repo>/artifacts. | |
| KEIL_DEBUG_BACKEND | No | Debug backend to use. Currently only 'pyocd' is supported. | |
| KEIL_DEFAULT_PROJECT | No | Default .uvprojx project file. When set, its containing directory is automatically added to the allowed path roots. |
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": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| keil_get_environmentB | Report UV4 path/version, package versions, path policy and hardware safety gates. |
| keil_get_project_infoB | Parse targets/device/compiler/output settings; project_path must be allowlisted. |
| keil_get_statusB | Server session/worker status; does not claim to observe CPU state. |
| keil_buildC | UV4 -b incremental build. Requires exit code, summary and expected nonempty output evidence. |
| keil_rebuildC | UV4 -r full rebuild; require fresh expected output in addition to log/exit evidence. |
| keil_get_build_logA | Read global latest log or a basename from server artifacts/build-logs (1..5000 lines). project_path is optional compatibility metadata, not a filter. |
| keil_parse_build_errorsC | Parse errors/warnings and file/line from latest artifact log or named basename. |
| keil_flashB | UV4 -f download; requires host KEIL_ALLOW_FLASH=true and human-authorized confirm=true. Not hardware-tested. |
| keil_start_debugA | Connect pyOCD/ST-Link (NOT native µVision). May halt MCU, so requires human-authorized confirm=true. target_override is required; ELF defaults to the selected project's output. |
| keil_stop_debugA | Disconnect and release the probe without automatically resuming the MCU. |
| keil_runA | Resume target; report observed state separately from request submission. |
| keil_haltA | Request halt and verify the target reports HALTED. |
| keil_resetA | Reset MCU only after human-authorized confirm=true; optionally halt afterward. |
| keil_set_breakpointB | Set a hardware breakpoint by unique source file/line or 32-bit address. Request, confirmation and hit are distinct. |
| keil_remove_breakpointB | Remove and verify removal of a breakpoint at a hex or decimal address. |
| keil_list_breakpointsB | List confirmed breakpoints belonging to this backend session. |
| keil_step_intoB | Source-level step into is not implemented; never substitute instruction stepping. |
| keil_step_overA | Source-level step over is not implemented; returns an explicit unsupported result. |
| keil_step_outC | Function step out is not implemented without validated unwind information. |
| keil_step_instructionA | Execute exactly one machine instruction on a halted target; not a source-level step. |
| keil_read_variableA | Read a fresh, unambiguous global/static base-type variable while halted. Locals and expressions are unsupported. |
| keil_read_variablesA | Read 1..64 variables in one serialized transaction; per-variable errors are preserved. |
| keil_get_registersB | Read fresh Cortex-M core registers while halted; reject unsupported names. |
| keil_get_pcA | Read the actual program counter from a halted target. |
| keil_get_execution_stateA | Observe CPU state, halt reason, exception number and confirmed breakpoint hit when available. |
| keil_get_call_stackC | Validated stack unwinding is not implemented; no guessed frames are returned. |
| keil_get_last_errorA | Return the latest recorded operation error without touching target hardware. |
| keil_get_session_logB | Return the most recent 1..500 operation records and durable JSONL log path. |
| keil_diagnose_connectionA | Enumerate probes without connecting/resetting; USB presence does not prove target power or SWD connectivity. |
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 29 tools
Most tools map to a distinct resource+action, but there are near-duplicate pairs: keil_read_variable vs keil_read_variables (singular vs batch) and keil_get_status vs keil_get_execution_state vs keil_get_pc, which an agent could easily misselect. The three source-level step tools (step_into/step_over/step_out) all return 'unsupported' and overlap functionally with keil_step_instruction, adding noise rather than clarity.
All 29 tools use a consistent keil_ prefix plus verb_noun form (get_*, read_*, set_*, step_*, build/rebuild/flash), which is highly predictable. The only blemish is the singular/plural pair keil_read_variable / keil_read_variables, where the names differ by one character but describe different scopes.
At 29 tools the surface is heavy for a single debug/build server, and several slots are effectively placeholders: keil_step_into, keil_step_over, keil_step_out and keil_get_call_stack exist only to report 'not implemented'. Trimming those and folding status/execution-state queries together would bring it into a reasonable scope.
Core lifecycle is covered: project info, build/rebuild/logs/error parsing, flash, connect/disconnect, reset/run/halt, breakpoint CRUD, register/variable reads, and diagnostics. However, source-level stepping and call-stack unwinding are explicitly absent, and there is no memory or register write, no expression/watch evaluation, and no peripheral access, leaving common debug workflows with dead ends.