Skip to main content
Glama

ikmcp

A Model Context Protocol (MCP) server that makes an agent an expert at building complete ik projects — the firmware, its tests, and the virtual peripherals it talks to. It pairs deep, always-accurate knowledge with a live build / simulate / test loop backed by the real ik8b compiler, the ik8bvm AVR simulator, and the ikide headless test runner. An agent can write ik, compile it, read genuine diagnostics, run it on a simulated AVR core, model a missing peripheral, and get a real PASS/FAIL test verdict — without hardware.

ik is a small, strongly typed, bare-metal language for 8-bit AVR microcontrollers (no heap, no runtime; compiles straight to Intel HEX).

One dependency, the whole stack

ikmcp is a standalone, decoupled project. Its single vendored dependency is the ikide IDE (git submodule at tools/ikide), which itself carries ik8b and ik8bvm as nested submodules. So one submodule gives language + compiler + VM + the IDE's test/device runtime — and ikmcp resolves all of it relative to its own root, never by coincidence of where it is checked out.

It is meant to be vendored back into the ikide IDE as a submodule under tools/, but it runs perfectly on its own.

Related MCP server: agentic-hil

Two domains, kept separate

Domain

Concerns

Tools

Resources

Code

Language

the ik language, ik8b compiler, ik8bvm VM

ik_*

ik://

ikmcp/lang/

IDE

the ikide test framework + virtual devices

ide_*

ikide://

ikmcp/ide/

The IDE domain degrades gracefully: without the ikide checkout, the language tools keep working and IDE tools say so.

Highlights

  • Zero runtime dependencies. The MCP protocol layer is pure Python stdlib; python3 server.py is the whole story. Nothing to pip install.

  • Knowledge that can't drift. Reference, stdlib API, the grammar, the test/device APIs, the shipped device models, and example projects are read live from the pinned ikide checkout (plus a generated index for speed).

  • Ground truth, not guesses. ik_compile / ik_simulate / ide_run_tests run the real tools so generated code is verified, not hallucinated.

Quick start

git submodule update --init --recursive   # or: make deps  (clones ikide + ik8b + ik8bvm)
make build                                # build ik8b CLI + ikide binary (Docker)
make test                                 # end-to-end smoke test
python3 server.py                         # start the server on stdio

A fresh checkout builds the binaries once (make build, via Docker like the upstream toolchain). Already have built binaries? Skip the build and point the server at them with IK8B_BIN / IKIDE_BIN.

Wiring it into an MCP client

The server speaks MCP over stdio; a host spawns it as a subprocess. See examples/mcp.json:

{ "mcpServers": { "ikmcp": { "command": "python3", "args": ["server.py"], "cwd": "/path/to/ikmcp" } } }

Tools

Language (ik_*)

Tool

What it does

ik_overview

Curated cheat-sheet — sigils, the value -> target assignment, types, memory, interrupts. Start here.

ik_grammar

The full EBNF grammar.

ik_reference

A language-reference chapter (types, memory, statements, expressions, functions, interrupts, intrinsics, conditional-compilation, lexical, …).

ik_intrinsics

The compiler intrinsics (@burn, @sei, @swtch, …) with signatures.

ik_vm_reference

Deep ik8bvm reference: cores, SREG, memory map, instruction set, peripherals/IRQs, limits.

ik_compiler_reference

Deep ik8b internals: pipeline, SSA IR, register allocation, ABI/calling convention, ISR codegen, fixed-point.

ik_tutorial

Tutorial pages (installing, first program, tour, stdlib, interrupts).

ik_stdlib_list / ik_stdlib_module

The standard library: modules + full per-module API.

ik_project_analyze

Structural analysis of a multi-file project: import graph, effective target + where declared, @main entry, per-file symbols, cross-file problems. Exact parser, optional real-compile.

ik_examples

List / fetch bundled ik example programs.

ik_search

Full-text search across language docs, std sources, examples.

ik_devices / ik_device_info

Supported AVR targets (350) with memory specs.

ik_compile

Compile ik source with ik8b; HEX/IR + diagnostics.

ik_check

Fast compile-only check: ok + diagnostics (tight loop).

ik_simulate

Run on ik8bvm; register/SP/SREG dump, memory peeks, trace, IRQ injection.

ik_status

Resolved toolchain root + binary paths.

IDE (ide_*)

Tool

What it does

ide_overview

How program + tests + virtual devices fit together. Start here for the IDE side.

ide_test_api

The full tests/*.rhai Bench API (drive/observe every peripheral + assertions).

ide_test_template

A starter test bench.

ide_run_tests

Run the headless ikide test runner; real PASS/FAIL (workspace or inline program+test).

ide_device_api

The full devices/*.rhai authoring contract (meta, pins, view, handlers, framebuffer).

ide_device_template

A starter virtual-device script.

ide_devices / ide_device_script

The 19 shipped device models; read any one's source.

ide_examples / ide_example

The bundled breadboard example projects (program + wiring + tests/devices).

ide_search

Full-text search across device scripts, the device guide, and example projects.

ide_status

Resolved ikide root + binary path.

Prompts (skills)

ikmcp also serves MCP prompts — reusable, parameterized workflows a host surfaces as user-invokable slash-commands. Each expands into a directive playbook that orchestrates the tools above and bakes in the gotchas an agent gets wrong unaided (assignment direction, target inheritance, the SRAM-init stepping rule, the ABI).

Prompt

Guides the agent to…

ik_new_project

scaffold a new program from a plain-language goal, pick the target, write idiomatic ik, verify it.

ik_write_tests

write a tests/*.rhai bench for a program and run it headless for a real verdict.

ik_model_device

author a devices/*.rhai virtual peripheral and validate it against a program.

ik_port_target

port a program to another AVR target with ? target == guards.

ik_debug

diagnose a compile/sim failure using the real compiler and the reference.

ik_review

review a program/project for correctness, idiom, and SRAM fit.

Knowledge is also exposed as MCP resources: language under ik:// (ik://overview, ik://grammar, ik://reference/<topic>, ik://library/<module>, ik://example/<name>) and IDE under ikide:// (ikide://test-api, ikide://device-api, ikide://device/<name>, ikide://example/<name>).

Layout

ikmcp/
  server.py              # launcher: python3 server.py
  ikmcp/
    protocol.py          # tiny MCP stdio JSON-RPC server (stdlib only)
    paths.py             # toolchain + IDE resolution (submodule / env / PATH)
    app.py               # assembles both domains + prompts onto one server
    prompts.py           # MCP prompts ("skills"): guided cross-domain workflows
    lang/                # LANGUAGE domain
      knowledge.py       # cheat-sheet + on-disk docs/std + VM/compiler refs + search
      toolchain.py       # drives ik8b / ik8bvm (compile, check, simulate, devices)
      project.py         # multi-file project intelligence (import graph, symbols)
      tools.py           # ik_* tool + ik:// resource registration
    ide/                 # IDE domain
      knowledge.py       # test/device APIs, shipped models, examples, templates
      runner.py          # drives `ikide test`
      tools.py           # ide_* tool + ikide:// resource registration
  data/
    lang/                # stdlib_index.json, vm_reference.md, compiler_internals.md
    ide/                 # test_api.json, device_api.json, device_catalog.json
  tests/smoke.py         # end-to-end test (both domains + live runner)
  tools/ikide/           # vendored submodule (ikide -> ik8b -> ik8bvm)

Environment overrides

Variable

Effect

IKIDE_ROOT

Use this ikide checkout instead of the vendored submodule.

IK8B_ROOT

Use this ik8b checkout (default <ikide>/tools/ik8b).

IK8B_BIN / IKIDE_BIN

Paths to prebuilt ik8b / ikide binaries.

License

Apache-2.0. The vendored ikide / ik8b / ik8bvm are under their own licenses.

Available Tools

30 tools
ide_device_apiB

The complete virtual-device authoring contract for devices/.rhai: meta() fields, pin/terminal modes, view element kinds, every behaviour handler (pin_set, on_view, spi_transfer, i2c_, uart_tx/poll, tick), the framebuffer/display API, helpers, and the execution model & limits.

Inputs: no named parameters.

ide_devicesA

List the virtual-device models the IDE ships (name, bus, address, display, pins, purpose). Optional filter matches name or bus (none/uart/spi/i2c). Read one model's source with ide_device_script.

Inputs: filter.

ide_device_scriptA

Return the full Rhai source of a shipped device model (e.g. 'ssd1306', 'max7219', 'led') — a worked reference for authoring your own.

Inputs: name (required).

ide_device_templateC

A starter devices/*.rhai virtual-device script to adapt.

Inputs: no named parameters.

ide_exampleA

Return all files of one example project (main.ik, tests/.rhai, devices/.rhai, info.json, README) — a complete worked reference.

Inputs: name (required).

ide_examplesA

List the IDE's bundled breadboard example projects (program + wiring + often tests/devices), with title and description.

Inputs: no named parameters.

ide_overviewA

How to build a complete ikide project: the program (.ik), the test bench (tests/.rhai), and virtual devices/peripherals (devices/.rhai), and how they fit together. READ THIS before writing tests or devices.

Inputs: no named parameters.

ide_run_testsA

Run the headless ikide test runner and return the real PASS/FAIL verdict. Provide an existing workspace (with tests/*.rhai), OR inline program + test (assembled into a throwaway workspace). Optionally attach custom devices and pick an mcu for load_hex tests.

Inputs: mcu, test, devices, program, +3 more.

ide_statusB

Diagnostics: resolved ikide root, ikide binary path, and whether the IDE checkout is available.

Inputs: no named parameters.

ide_test_apiB

The complete test-bench (Bench) API for tests/*.rhai: every function to drive and observe the simulated core (program, run, UART, SPI, I2C, ADC, GPIO, SRAM/IO, EEPROM, interrupts, core) plus assertions, grouped by area, with how-to-run notes and examples.

Inputs: no named parameters.

ide_test_templateC

A starter tests/*.rhai bench script to adapt.

Inputs: no named parameters.

ik_checkA

Fast syntax/semantic check: compile and return only ok + diagnostics (no artifact). The quickest write-compile-fix feedback loop.

Inputs: path, source, target.

ik_compileA

Compile ik source (inline source or a path) with the real ik8b compiler. Returns success, diagnostics, and the Intel HEX (emit=hex) or SSA IR (emit=ir) artifact. import std/... resolves automatically. Use this to VERIFY any ik code you generate.

Inputs: emit, path, report, source, +1 more.

ik_compiler_referenceA

Deep reference for the ik8b compiler internals: the lex->parse->IR->regalloc->AVR->HEX pipeline, the SSA IR shown by --emit ir, register allocation, the calling convention/ABI, ISR codegen, fixed-point (r8/r16) lowering, intrinsic lowering, and optimization passes. Use this to reason about the generated code.

Inputs: no named parameters.

ik_device_infoA

Memory layout and core family for one device (the value for target <device>).

Inputs: name (required).

ik_devicesA

List supported AVR target devices (name, core family, SRAM, FLASH, EEPROM, SRAM_START). Optional filter matches a device-name substring or an exact core family (AVRe, AVRePlus, AVRxm, AVRxt, AVRrc).

Inputs: limit, filter.

ik_examplesA

List bundled ik example programs, or return one example's source by name.

Inputs: name.

ik_grammarA

The complete formal EBNF grammar of the ik language.

Inputs: no named parameters.

ik_intrinsicsA

List the compiler intrinsics (@nop @sei @cli @wdr @sleep @break @burn @swap @movw @mul @goto @spm @swtch) with signatures and notes. These are the only built-in @-functions.

Inputs: no named parameters.

ik_overviewA

Curated cheat-sheet for the ik language: sigils ($ @ %), the left-to-right value -> target assignment, program shape, types, memory spaces, control flow, interrupts, and a minimal program. READ THIS FIRST before writing any ik code.

Inputs: no named parameters.

ik_project_analyzeA

Understand a multi-file ik project structurally (exact, parser-based — not fuzzy search). Returns the import graph, the effective target and where it is declared, the @main entry file, the symbols each file exports (functions/isrs/consts), and cross-file problems (no/conflicting target, missing/duplicate @main, unresolved imports). Use this BEFORE editing an existing project so you write in the right context (e.g. don't re-declare target in imported files — they inherit it). Give a directory path, a single-file path, or inline files. Set include_diagnostics to also compile the entry point for authoritative errors.

Inputs: path, files, include_diagnostics.

ik_referenceA

Read a language-reference chapter as plain text. Topics: lexical, types, memory, expressions, statements, functions, interrupts, interrupt-vectors, intrinsics, conditional-compilation, grammar.

Inputs: topic (required).

ik_simulateA

Run code on the ik8bvm AVR core simulator. Provide ik source/path (compiled then run with the source's own target), OR a hex_path + mcu. Returns the register/PC/SP/SREG dump, any --peek bytes, and an optional instruction trace. Interrupts can be injected for testing.

Inputs: irq, mcu, dump, path, +9 more.

ik_statusA

Diagnostics: resolved toolchain root, compiler/simulator binary paths, and whether documentation sources are available.

Inputs: no named parameters.

ik_stdlib_listA

List every standard-library module with a one-line summary, whether it depends on the selected target, and its public function count.

Inputs: no named parameters.

ik_stdlib_moduleA

Full API for one stdlib module: every public function signature + summary, the rendered reference doc, and optionally the ik source. Accepts 'gpio' or 'std/gpio'.

Inputs: name (required), include_source.

ik_tutorialA

Read a tutorial page, or list pages when no argument is given. Pages: index, installing, firstprogram, tour, stdlib, interrupts.

Inputs: page.

ik_vm_referenceA

Deep reference for the ik8bvm AVR simulator: core classes, register file, SREG flags, memory map, the implemented instruction set, the peripherals/interrupts modeled, cycle counting, and the explicit limitations. Use this to reason about simulation behaviour.

Inputs: no named parameters.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 30 tools

    Disambiguation4/5

    Tools are grouped into distinct domains (language, stdlib, compiler/simulator, IDE tests/devices) and each has a clearly scoped purpose. A few near-neighbors like ik_compile/ik_check and the three *reference tools require attention to descriptions, but the boundaries are sufficiently explained.

    Naming Consistency3/5

    Names consistently use snake_case with ik_/ide_ prefixes, which helps group them. However, they mix noun-style (ik_reference, ide_test_api) with verb-style (ik_compile, ide_run_tests), and ik_project_analyze has an awkward noun-verb order.

    Tool Count2/5

    At 30 tools, the surface is larger than the 16-25 heavy range and contains many documentation endpoints that could potentially be consolidated. The broad IDE+compiler scope justifies some size, but the count still feels excessive for a single server.

    Completeness4/5

    The toolset covers the full language workflow: docs, grammar, stdlib, compile/check/simulate, project analysis, IDE test running, and device authoring. Minor gaps like project scaffolding or a version query are workable since templates and status tools exist.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for simulating firmware on virtual microcontroller instances, allowing AI agents to upload, run, and read UART output from supported boards such as STM32 and Nordic.
      19
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Agentic Hardware-in-the-Loop (Agentic HIL) lets coding agents develop firmware on real embedded boards: flash, reset, read UART and exchange CAN traffic, diagnose and fix. Local, policy-gated MCP tools support OpenOCD, pyOCD and STM32CubeProgrammer, with pytest for CI.
      44
      1,996 PyPI
      33
      Apache 2.0
    • A
      license
      C
      quality
      C
      maintenance
      MCP server for AI-assisted MCU and embedded firmware debugging. It connects to real hardware via debug probes, inspects CPU/memory/peripherals, manages Keil builds, and provides structured evidence for fault diagnosis.
      19
      34 PyPI
      12
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that enables AI agents to inspect, plan, validate, and apply STM32CubeMX .ioc configuration changes, and generate STM32CubeIDE projects, ensuring safe and testable embedded-system workflows.
      9
      7
      MIT