{
  "markdown": "# embedcalc-mcp\n\n**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.\n\n[![npm](https://img.shields.io/npm/v/embedcalc-mcp)](https://www.npmjs.com/package/embedcalc-mcp)\n[![MCP Registry](https://img.shields.io/badge/MCP_Registry-io.github.ethan--hub26%2Fembedcalc--mcp-blue)](https://registry.modelcontextprotocol.io)\n[![license](https://img.shields.io/npm/l/embedcalc-mcp)](./LICENSE)\n\n## Why\n\nLLMs 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.\n\nThis 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).\n\n## Install\n\n**Claude Code:**\n\n```bash\nclaude mcp add embedcalc -- npx -y embedcalc-mcp\n```\n\n**Claude Desktop / Cursor / any MCP client** (JSON config):\n\n```json\n{\n  \"mcpServers\": {\n    \"embedcalc\": { \"command\": \"npx\", \"args\": [\"-y\", \"embedcalc-mcp\"] }\n  }\n}\n```\n\nNo API key, no account. Runs locally over stdio. (The optional `find_component` tool queries embedcalc.com over the network; everything else is offline.)\n\n## Tools (38)\n\n| Domain | Tools |\n|---|---|\n| **Code generation** | `crc_to_c` (7 presets + custom Rocksoft params → compilable table-driven C with check value) · `regmap_to_c` (LSB-first fields → shift/mask defines + bit-field struct) · `bitfield_macro` |\n| **Timing** | `can_bit_timing` (bxCAN `BTR` / FDCAN `NBTP` / MCP2515 `CNF1-3`) · `uart_baud` (STM32 `BRR` + error %) · `i2c_timing` (pull-up range + STM32 `TIMINGR`) · `spi_timing` · `i2s_clocks` · `lin_timing` · `rs485_bus` · `modbus_rtu_timing` (t1.5/t3.5) · `ring_buffer_size` |\n| **Data representation** | `qformat_convert` (Qm.n fixed point) · `ieee754_convert` (float/double, hex↔decimal↔bin) · `number_base_convert` (32-bit two's complement) · `endian_swap` (incl. Modbus BADC/CDAB) · `struct_layout` (C parser → offsets/padding/size, 32-bit MCU model) |\n| **Electronics** | `eseries_nearest` (E6/E12/E24/E96) · `resistor_code` (color bands + SMD/EIA-96) · `crystal_load_caps` · `lm317` · `attenuator_pad` (T/π) · `junction_temp` · `microstrip_impedance` (IPC-2141) · `pcb_trace_width` (IPC-2221) · `awg_wire` · `ne555` · `dcdc_converter` (buck/boost/inverting) · `op_amp` (gain + bandwidth) · `rc_filter` (1st-order LP/HP cutoff) · `bjt_bias` (voltage-divider operating point) · `mosfet_switch` (low-side conduction + gate drive) · `zener_reg` (shunt regulator) |\n| **Components** | `find_component` — real, in-stock MPNs + buy links from a computed value (parametric search) |\n| **Schematic review** | `review_schematic` (deterministic MCU board-rule check: decoupling, bulk cap, floating pins, I2C pull-up, reset, output conflict, power short + interface packs auto-detected from net names — USB ESD/VBUS, CAN termination/transceiver, RS-485 termination/bias, SWD connector/reset, crystal load caps — + polarity & voltage/power derating rules (schema-optional ratings) + STM32F4/STM32F1/ESP32/NuMicro family rules; unevaluable rules reported as `skipped`) · `parse_kicad` (KiCad netlist export → standard schema, auto-parses voltage ratings) · `get_extraction_guide` (schematic image → schema, filled by the vision model) · `list_schematic_rules` |\n\nAll tool names are prefixed `embedcalc_` (e.g. `embedcalc_crc_to_c`).\n\n## Example prompts\n\n> \"Give me MODBUS CRC-16 as a C function\" → table-driven C, check(\"123456789\") = `0x4B37` embedded for on-target verification\n>\n> \"CAN 500 kbit/s on STM32F103, APB1 36 MHz, sample point 87.5%\" → `CAN_BTR = 0x00050008` (BRP=9, TS1=6, TS2=1)\n>\n> \"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\n>\n> \"Encode −0.25 in Q1.14\" / \"What float is 0x7FC00000?\" / \"Nearest E96 to 12.3 kΩ?\"\n\n## Accuracy\n\n- CRC: all 7 presets verified against standard check values for `\"123456789\"`\n- CAN: solver output byte-identical to the interactive calculators at [embedcalc.com](https://www.embedcalc.com) (oracle fixtures in `tests/fixtures/`)\n- IEEE-754 / AWG / IPC: pinned to reference constants and published standard values\n- `struct_layout` uses a 32-bit MCU model (pointers 4 B; `double`/`int64` size 8, align 4) — stated in the tool description so the model can caveat it\n\nRun 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).\n\n## Related\n\n- [embedcalc.com](https://www.embedcalc.com) — the same 60+ calculators as free interactive tools, no AI required\n- Found a calculation LLMs keep getting wrong? [Open an issue](https://github.com/ethan-hub26/embedcalc-mcp/issues) — collecting candidates for the next batch.\n\n## License\n\nMIT\n",
  "bytes": 5268,
  "sha": "fc9ab21ed8d62b0f4099fd43d366342355ffd9b4c388ae142d31aacaacc7ed3f",
  "repo_slug": "ethan-hub26/embedcalc-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ethan_hub26_embedcalc_mcp_56d3ea36/readme"
}