embedcalc-mcp
embedcalc-mcp
Exact embedded-engineering math for AI agents. An MCP server with 38 deterministic calculators, code generators, and schematic checks — so Claude, Cursor, or any MCP-enabled agent computes CRC check values, CAN timing registers, and struct padding, and reviews schematics for MCU wiring mistakes, instead of hallucinating them.
Why
LLMs are confidently wrong about exactly the math that bricks boards. Ask any model for a CRC-16/MODBUS check value, an STM32 CAN_BTR register for 500 kbit/s @ 36 MHz, or the padded size of a struct — you'll get a plausible-looking wrong answer often enough that you can't trust any of them. The failure mode is the worst kind: the answer looks right.
This server gives the model tools instead. Every tool is a pure, deterministic implementation pinned with test vectors (standard CRC check values, oracle fixtures, IPC/ASTM published numbers — 174 tests).
Install
Claude Code:
claude mcp add embedcalc -- npx -y embedcalc-mcpClaude Desktop / Cursor / any MCP client (JSON config):
{
"mcpServers": {
"embedcalc": { "command": "npx", "args": ["-y", "embedcalc-mcp"] }
}
}No API key, no account. Runs locally over stdio. (The optional find_component tool queries embedcalc.com over the network; everything else is offline.)
Tools (38)
Domain | Tools |
Code generation |
|
Timing |
|
Data representation |
|
Electronics |
|
Components |
|
Schematic review |
|
All tool names are prefixed embedcalc_ (e.g. embedcalc_crc_to_c).
Example prompts
"Give me MODBUS CRC-16 as a C function" → table-driven C, check("123456789") =
0x4B37embedded for on-target verification"CAN 500 kbit/s on STM32F103, APB1 36 MHz, sample point 87.5%" →
CAN_BTR = 0x00050008(BRP=9, TS1=6, TS2=1)"How big is
struct { uint8_t flags; uint32_t ts; uint16_t id; }on a Cortex-M?" → 12 bytes, 5 of them padding, with the layout table"Encode −0.25 in Q1.14" / "What float is 0x7FC00000?" / "Nearest E96 to 12.3 kΩ?"
Accuracy
CRC: all 7 presets verified against standard check values for
"123456789"CAN: solver output byte-identical to the interactive calculators at embedcalc.com (oracle fixtures in
tests/fixtures/)IEEE-754 / AWG / IPC: pinned to reference constants and published standard values
struct_layoutuses a 32-bit MCU model (pointers 4 B;double/int64size 8, align 4) — stated in the tool description so the model can caveat it
Run it yourself: npm install && npm run build && npm test (174 tests, includes a stdio end-to-end pass that spawns the built server and calls the tools).
Related
embedcalc.com — the same 60+ calculators as free interactive tools, no AI required
Found a calculation LLMs keep getting wrong? Open an issue — collecting candidates for the next batch.
License
MIT