embedcalc-mcp
The embedcalc-mcp server provides 29 deterministic calculators and code generators for embedded systems engineering — replacing hallucinated LLM answers with verified, exact results.
Code Generation
embedcalc_crc_to_c— Table-driven C code for CRC-8/16/32 (7 presets or custom Rocksoft parameters) with embedded check valuesembedcalc_regmap_to_c— Convert register field lists into C#defineshift/mask macros and bit-fieldtypedef structembedcalc_bitfield_macro— Decompose a 32-bit register value into set bits and generate a C macro of OR'd(1U << n)terms
Timing & Bus Calculators
CAN bit timing (STM32 bxCAN/FDCAN, MCP2515), UART baud rate (STM32 BRR), I2C pull-up/TIMINGR, SPI timing, I2S clocks, LIN timing, RS-485 cable length/bias, Modbus RTU t1.5/t3.5 silence times, and ring/DMA buffer sizing
Data Representation
Q-format fixed-point ↔ float, IEEE 754 single/double (decimal ↔ hex ↔ binary with field breakdown), arbitrary base conversion (32-bit two's complement), endianness swap (big/little/BADC/CDAB), and C struct/union layout (offsets, padding, size for a 32-bit MCU model)
Electronics & PCB Calculators
E-series snapping (E6/E12/E24/E96), resistor color band/SMD decoding, crystal load capacitors, LM317 output voltage/resistor, T/π attenuator pad design, junction temperature, microstrip impedance (IPC-2141), PCB trace width (IPC-2221), AWG wire voltage drop (PASS/WARNING/FAIL), NE555 astable/monostable timing, and DC-DC converter design (buck/boost/inverting: duty cycle, min L/C, peak current)
Component Search (requires internet)
embedcalc_find_component— Find real, in-stock resistors, capacitors, inductors, LDOs, MOSFETs, and BJTs by electrical value, returning MPNs, descriptions, and buy links
Integrates with KiCad by providing a tool to parse KiCad netlist exports into a standard schema for schematic review.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@embedcalc-mcp Calculate CRC-8 C code for a byte array"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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).
Related MCP server: Swarm Orchestrator
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
Available Tools
29 toolsembedcalc_attenuator_padResistive Attenuator Pad (T / Pi)ARead-onlyIdempotent
Design T-pad and Pi-pad resistive attenuators for a given attenuation and system impedance.
Args: attenuation_db, impedance_ohm (default 50). Returns (structured): { t_series_ohm, t_shunt_ohm, pi_shunt_ohm, pi_series_ohm }. Example: 3 dB @ 50 Ω -> T: 8.55 Ω series ×2 + 141.9 Ω shunt; Pi: 292.4 Ω shunt ×2 + 17.61 Ω series. Snap values with embedcalc_eseries_nearest.
Inputs: attenuation_db (required), impedance_ohm. Returns: t_shunt_ohm, pi_shunt_ohm, t_series_ohm, pi_series_ohm
embedcalc_awg_wireAWG Wire Gauge & Voltage DropARead-onlyIdempotent
AWG wire properties (ASTM B258) and round-trip voltage drop for a copper pair: diameter, area, loop resistance (2× length, go & return), drop %, and a PASS/WARNING/FAIL verdict (<3% / 3-5% / >5%).
Args: awg (e.g. 20), supply_v, current_a, length_m (one-way), temp_c (default 20). Returns (structured): { diameter_mm, area_mm2, loop_resistance_ohm, voltage_drop_v, drop_percent, verdict }. Example: AWG20, 5 V, 2 A, 1 m -> 0.067 Ω loop, 2.7% drop, PASS.
Inputs: awg (required), length_m (required), supply_v (required), current_a (required), +1 more. Returns: verdict, area_mm2, diameter_mm, drop_percent, +2 more
embedcalc_bitfield_macroBit Field Value → C MacroARead-onlyIdempotent
Decompose a 32-bit register value into set bits and generate a C macro of OR'd (1U << n) terms, plus decimal/binary/popcount views.
Args:
value_hex (string): 32-bit value, e.g. '0x8001'.
macro_name (string, optional): default 'REG_VAL'.
Returns (structured): { dec, hex, bin, ones_count, c_macro }. Example: '0x8001' -> #define REG_VAL ((1U << 0) | (1U << 15)), 2 bits set.
Inputs: value_hex (required), macro_name. Returns: bin, dec, hex, c_macro, +1 more
embedcalc_can_bit_timingCAN Bit Timing CalculatorARead-onlyIdempotent
Compute exact CAN bit timing (BRP, segments, SJW, register values) for STM32 bxCAN, STM32 FDCAN (nominal/arbitration phase), and MCP2515 from clock, bitrate, and target sample point.
Searches all valid prescaler/segment combinations and returns, per controller, the configuration whose sample point is closest to the target (ties: more TQ per bit, then smaller BRP). Register values are ready to write: bxCAN CAN_BTR, FDCAN FDCAN_NBTP, MCP2515 CNF1/CNF2/CNF3 (BTLMODE=1). All values follow the controller datasheets; BRP/TS values are 1-based (register encoding = value - 1 is already applied inside the hex words).
Args:
clock_hz (int): controller input clock in Hz. bxCAN: APB1; FDCAN: kernel clock; MCP2515: crystal Fosc (MCP2515 uses TQ = 2*BRP/Fosc).
bitrate_bps (int): nominal bitrate in bit/s (classic CAN: up to 1000000).
sample_point_percent (50-95, default 87.5): CiA 301 recommends 87.5.
Returns (structured): { bxcan, fdcan, mcp2515 } — each a timing object or null when the clock/bitrate ratio has no exact integer divider for that controller (a null means: change the clock or bitrate, do not approximate).
Examples:
"500 kbit/s on STM32F103 (APB1 36 MHz)" -> clock_hz=36000000, bitrate_bps=500000
"1 Mbit/s, 16 MHz MCP2515, sample point 75%" -> clock_hz=16000000, bitrate_bps=1000000, sample_point_percent=75 Do not guess CAN timing registers — call this tool.
Inputs: clock_hz (required), bitrate_bps (required), sample_point_percent. Returns: bxcan, fdcan, mcp2515
embedcalc_crc_to_cCRC → C Code GeneratorARead-onlyIdempotent
Generate a complete, compilable C implementation (256-entry lookup table + compute function) for any CRC-8/16/32, plus its standard check value.
Use a preset for common CRCs, or specify the Rocksoft model parameters (width/poly/init/reflect-in/reflect-out/xor-out) for a custom CRC. The generated code embeds check("123456789") so the result can be verified on target.
Args:
preset (optional): one of CRC-8, CRC-8/MAXIM, CRC-16/CCITT, CRC-16/ARC, CRC-16/MODBUS, CRC-32, CRC-32/BZIP2. Overrides all other args.
bits (8|16|32), poly_hex (e.g. '0x1021'): required for a custom CRC.
init_hex, reflect_in, reflect_out, xor_out_hex: optional custom parameters (defaults: 0x0, false, false, 0x0).
Returns (structured): { check_hex, config, c_code }. The text content is the C source itself.
Examples:
"MODBUS RTU CRC in C" -> preset='CRC-16/MODBUS'
"CRC-16 poly 0x1021 init 0xFFFF, no reflection" -> bits=16, poly_hex='0x1021', init_hex='0xFFFF' Check values are exact (e.g. CRC-16/CCITT -> 0x29B1, CRC-32 -> 0xCBF43926); do not estimate CRCs — call this tool.
Inputs: bits, preset, init_hex, poly_hex, +3 more. Returns: c_code, config, check_hex
embedcalc_crystal_load_capsCrystal Load Capacitor CalculatorARead-onlyIdempotent
Compute the two external load capacitors for a crystal from its specified load capacitance: CL = C/2 + Cstray -> C = 2·(CL − Cstray).
Args: load_capacitance_pf (from crystal datasheet, e.g. 18), stray_pf (PCB+pin stray, typ. 3-5). Returns (structured): { cap_each_pf }. Example: CL=18pF, stray=5pF -> 26 pF each side. Wrong load caps = frequency pulling; don't guess.
Inputs: load_capacitance_pf (required), stray_pf. Returns: cap_each_pf
embedcalc_dcdc_converterBuck / Boost / Buck-Boost Converter CalculatorARead-onlyIdempotent
DC-DC converter design (CCM): duty cycle, minimum inductance, minimum output capacitance, input current, and peak switch current for buck, boost, or inverting buck-boost.
Args: topology ('buck'|'boost'|'buckboost'), vin, vout, iout_a, freq_khz (default 100), ripple_current_pct (of Iout, default 30), ripple_voltage_mv (default 50). Returns (structured): { duty_percent, l_min_uh, c_min_uf, iin_a, i_peak_a }. Example: buck 12->5 V, 1 A, 100 kHz -> D=41.7%, L≥97.2 µH, C≥7.5 µF. Snap L/C with embedcalc_eseries_nearest.
Inputs: vin (required), vout (required), iout_a (required), topology (required), +3 more. Returns: iin_a, c_min_uf, i_peak_a, l_min_uh, +1 more
embedcalc_endian_swapEndianness / Byte Swap ConverterARead-onlyIdempotent
Show a hex byte sequence in all endianness orderings: big (ABCD), little (DCBA), mid-little/byte-swapped halfwords (BADC), mid-big/halfword-swapped (CDAB).
Args: hex (string) — e.g. '0x12345678' or 'DEADBEEF'; odd nibble counts get a leading zero. Returns (structured): { big, little, mid_little_badc, mid_big_cdab (null when < 4 bytes), bytes }. Example: 12345678 -> little 78563412, BADC 34127856, CDAB 56781234. Useful for Modbus register order and mixed-endian protocol debugging.
Inputs: hex (required). Returns: big, bytes, little, mid_big_cdab, +1 more
embedcalc_eseries_nearestE-Series Nearest Standard ValueARead-onlyIdempotent
Snap a computed resistor/capacitor/inductor value to the nearest purchasable E-series standard value (E6/E12/E24/E96) with the resulting error.
Args: value (any unit — ohms, farads, henries), series ('E24' default; E96 for 1% resistors). Returns (structured): { standard, error_percent, series }. Example: 4.67e-6 H, E24 -> 4.7e-6 (+0.64%). LLMs frequently pick non-existent "standard" values — always snap computed values with this tool before choosing a part.
Inputs: value (required), series. Returns: series, standard, error_percent
embedcalc_find_componentFind Real Component (MPN + buy link)ARead-only
Find real, in-stock components matching an electrical value via parametric distributor search — returns manufacturer part numbers and buy links ONLY (no price or stock data, by design).
Args:
type: resistor | capacitor | inductor | ldo | mosfet | bjt.
value (number): resistor: resistance in ohms; capacitor: capacitance in farads (e.g. 1e-7 = 100 nF); inductor: inductance in henries (e.g. 1e-5 = 10 µH); ldo: fixed output voltage in volts; mosfet: minimum Vds rating in volts (N-channel); bjt: minimum Vce rating in volts (NPN).
Optional filters: tolerance_pct (R/C/L: keep this tolerance or tighter), min_power_w (resistor), min_voltage_v (capacitor rating), min_current_a (ldo/mosfet/bjt), max_rds_on_ohm (mosfet), min_hfe (bjt).
max_results (default 5).
Returns (structured): { matched_value, parts: [{ mpn, manufacturer, description, buy_url }] }. For prices, follow the buy link — pricing is intentionally not returned.
Examples:
"220 ohm 1% resistor" -> type='resistor', value=220, tolerance_pct=1
"100 nF cap rated 16V+" -> type='capacitor', value=1e-7, min_voltage_v=16
"3.3V LDO, 500 mA" -> type='ldo', value=3.3, min_current_a=0.5 Requires internet access (queries embedcalc.com).
Inputs: type (required), value (required), min_hfe, max_results, +5 more. Returns: parts, matched_value
embedcalc_i2c_timingI2C Timing & Pull-Up CalculatorARead-onlyIdempotent
Compute I2C pull-up resistor range (Rp min from sink current, Rp max from rise time vs bus capacitance), SCL high/low budget, and an STM32 I2C TIMINGR register estimate.
Args:
mode: 'ls' (10k), 'sm' (100k), 'fm' (400k), 'fmp' (1M, 20mA sink), 'hs' (3.4M).
vdd (V, default 3.3), bus_capacitance_pf (default 100).
stm32_clock_mhz (default 16): I2CCLK kernel clock for the TIMINGR estimate.
Returns (structured): rp_min_ohm / rp_max_ohm, scl high/low vs spec minimums, rise/fall limits, stm32 { presc, scll, sclh, sdadel, scldel, timingr_hex }. The TIMINGR value is an estimate per RM formulas — verify on scope for production. Example: Fast-mode, 3.3V, 100pF -> Rp between ~967Ω and ~3.5kΩ (use 2.2k).
Inputs: vdd, mode, stm32_clock_mhz, bus_capacitance_pf. Returns: stm32, rp_max_ohm, rp_min_ohm, scl_low_us, +6 more
embedcalc_i2s_clocksI2S Clock CalculatorARead-onlyIdempotent
I2S bit clock (BCLK/SCK) from audio format: BCLK = Fs x bits x channels. Args: sample_rate_hz (e.g. 48000), bits_per_sample (e.g. 16/24/32), channels (default 2). Returns (structured): { bclk_hz, bclk_period_ns, lrclk_hz }. Example: 48 kHz, 24-bit, stereo -> BCLK 2.304 MHz (434.03 ns), LRCLK 48 kHz.
Inputs: sample_rate_hz (required), bits_per_sample (required), channels. Returns: bclk_hz, lrclk_hz, bclk_period_ns
embedcalc_ieee754_convertIEEE 754 Float ConverterARead-onlyIdempotent
Encode/decode IEEE 754 single (32-bit) or double (64-bit) precision: decimal <-> hex <-> binary, with sign/exponent/fraction breakdown and classification.
Args:
format (32|64, default 32).
Provide exactly one of: decimal (number), hex (string like '0x3F800000'), bin (bit string).
Returns (structured): { sign, exponent_raw, exponent_unbiased, fraction, hex, bin, decimal (string — may be 'NaN'/'Infinity'), class ('normal'|'subnormal'|'zero'|'infinity'|'nan') }. Examples: 1.0 float -> 0x3F800000; 0.1 double -> 0x3FB999999999999A (not exact!). Do not eyeball float bit patterns — call this tool.
Inputs: bin, hex, format, decimal. Returns: bin, hex, sign, class, +4 more
embedcalc_junction_tempJunction Temperature / Max PowerARead-onlyIdempotent
Thermal check: Tj = Ta + P·θJA, and max dissipable power for a Tj limit.
Args: ambient_c, power_w, theta_ja (°C/W from datasheet), tj_max_c (default 150). Returns (structured): { tj_c, p_max_w, margin_c, ok }. Example: Ta=25, P=2W, θJA=50 -> Tj=125°C, Pmax=2.5W @ Tj_max 150.
Inputs: power_w (required), theta_ja (required), ambient_c (required), tj_max_c. Returns: ok, tj_c, p_max_w, margin_c
embedcalc_lin_timingLIN Bus Timing CalculatorARead-onlyIdempotent
LIN bus timing: bit time, break field duration (13 bits), and worst-case frame time per LIN 2.x nominal (header 34 + response 10*(n+1) bits with 1.4x budget = (43+10n)/baud). Args: baud (typ. 9600/19200), data_bytes (1-8). Returns (structured): { bit_time_us, break_time_us, frame_time_us }. Example: 19200 baud, 8 bytes -> bit 52.08 µs, break 677 µs, frame 6406 µs.
Inputs: baud, data_bytes. Returns: bit_time_us, break_time_us, frame_time_us
embedcalc_lm317LM317 Resistor CalculatorARead-onlyIdempotent
LM317 adjustable regulator: Vout = Vref·(1 + R2/R1) + Iadj·R2. Compute R2 for a target Vout, or Vout from R1/R2.
Args: r1_ohm (default 240), and exactly one of target_vout (-> solves R2) or r2_ohm (-> computes Vout). vref default 1.25 V, iadj_ua default 50 µA (datasheet typical). Returns (structured): { vout, r1_ohm, r2_ohm }. Example: target 5.0 V, R1=240, Iadj=0 -> R2=720 Ω. Snap R2 with embedcalc_eseries_nearest afterwards.
Inputs: vref, r1_ohm, r2_ohm, iadj_ua, +1 more. Returns: vout, r1_ohm, r2_ohm
embedcalc_microstrip_impedanceMicrostrip Impedance (IPC-2141)ARead-onlyIdempotent
Surface microstrip characteristic impedance: Z0 = (87/√(εr+1.41))·ln(5.98h/(0.8w+t)). Valid roughly for 0.1 < w/h < 2.0 and εr < 15.
Args (all in mm): trace_width_mm, dielectric_height_mm, trace_thickness_mm (1oz ≈ 0.035), er (FR-4 ≈ 4.2-4.6). Returns (structured): { z0_ohm }. Example: w=3.0, h=1.6, t=0.035, εr=4.5 -> ≈49 Ω.
Inputs: trace_width_mm (required), dielectric_height_mm (required), er, trace_thickness_mm. Returns: z0_ohm
embedcalc_modbus_rtu_timingModbus RTU Timing CalculatorARead-onlyIdempotent
Modbus RTU inter-character (t1.5) and inter-frame (t3.5) silence times. Per spec: 11 bits/char; above 19200 baud fixed t1.5=750 µs and t3.5=1750 µs. Args: baud. Returns (structured): { char_time_us, t15_us, t35_us }. Example: 9600 -> char 1145.8 µs, t1.5 1718.8 µs, t3.5 4010.4 µs; 115200 -> 750/1750 µs fixed.
Inputs: baud (required). Returns: t15_us, t35_us, char_time_us
embedcalc_ne555NE555 Timer CalculatorARead-onlyIdempotent
NE555 timing. Astable: f = 1/(0.693·(Ra+2Rb)·C), duty = (Ra+Rb)/(Ra+2Rb) (always >50%). Monostable: t = 1.1·Ra·C.
Args: mode ('astable'|'monostable'), ra_ohm, rb_ohm (astable only), c_farad (e.g. 10e-6). Returns (structured): astable -> { freq_hz, duty_percent, t_high_s, t_low_s }; monostable -> { pulse_s }. Example: astable 1k/10k/10µF -> 6.87 Hz, 52.4%.
Inputs: mode (required), ra_ohm (required), c_farad (required), rb_ohm. Returns: freq_hz, pulse_s, t_low_s, t_high_s, +1 more
embedcalc_number_base_convertNumber Base Converter (32-bit)ARead-onlyIdempotent
Convert a number between decimal/hex/binary/octal with 32-bit two's complement semantics (negative decimals wrap; MSB-set values get a signed reading).
Args: value (string) — decimal ('-1', '42'), hex ('0xFF'), binary ('0b1010'), or octal ('0o17'). Returns (structured): { unsigned, signed, hex, bin (4-bit groups), oct, ones_count }. Example: '-1' -> 0xFFFFFFFF, unsigned 4294967295, 32 ones.
Inputs: value (required). Returns: bin, hex, oct, signed, +2 more
embedcalc_pcb_trace_widthPCB Trace Width for Current (IPC-2221)ARead-onlyIdempotent
Minimum trace width to carry a current with a given temperature rise, per IPC-2221 (I = k·ΔT^0.44·A^0.725; k=0.048 external / 0.024 internal).
Args: current_a, temp_rise_c (default 10), copper_oz (default 1), layer ('external'|'internal'). Returns (structured): { width_mil, width_mm, cross_section_sq_mil }. Example: 1 A, 10 °C rise, 1 oz external -> ≈11.8 mil (0.30 mm). Internal layers need ~2x the width. Do not guess trace widths — this curve is not linear.
Inputs: current_a (required), layer, copper_oz, temp_rise_c. Returns: width_mm, width_mil, cross_section_sq_mil
embedcalc_qformat_convertQ-Format Fixed-Point ConverterARead-onlyIdempotent
Convert between float and signed Qm.n fixed point (1 sign + m integer + n fractional bits; e.g. Q0.15 = 16-bit "Q15").
Args:
m (int >= 0), n (int >= 0): format; m+n+1 <= 32.
value (float) OR raw_int (stored integer): provide exactly one.
Returns (structured): { format, total_bits, scale, range_min, range_max, raw_int, hex, bin, actual, error, clamped }. hex/bin are two's complement in the format's bit width. Examples: 0.5 in Q0.15 -> 16384 = 0x4000; raw 0x8000 (-32768) in Q0.15 -> -1.0. Do not round by hand — quantization error matters.
Inputs: m (required), n (required), value, raw_int. Returns: bin, hex, error, scale, +7 more
embedcalc_regmap_to_cRegister Map → C GeneratorARead-onlyIdempotent
Generate C shift/mask #defines and a bit-field typedef struct for a hardware register from an LSB-first field list.
Args:
register_name (string): e.g. 'CTRL'. Sanitized to [A-Z0-9_].
fields (array of {name, width}): fields from bit 0 (LSB) upward, e.g. [{name:'EN',width:1},{name:'MODE',width:2},{name:'DIV',width:5}]. Total width must fit in 32 bits.
Returns (structured): { c_code, total_bits, fields: [{name, width, shift, mask_hex}] }. Text content is the C source (defines + typedef struct with uint32_t bit-fields).
Example: EN:1, MODE:2, DIV:5 -> CTRL_EN_SHIFT 0u / CTRL_EN_MASK 0x1u, CTRL_MODE_MASK 0x6u, CTRL_DIV_MASK 0xF8u. Do not compute shifts/masks by hand — call this tool.
Inputs: fields (required), register_name (required). Returns: c_code, fields, total_bits
embedcalc_resistor_codeResistor Color Code / SMD Code DecoderARead-onlyIdempotent
Decode a through-hole resistor color code (4 or 5 bands) or an SMD resistor marking into ohms + tolerance.
Args (one of):
bands: array of 4 or 5 color names in order (black, brown, red, orange, yellow, green, blue, violet, grey, white, gold, silver, none).
smd_code: 3-digit ('472'=4.7k), 4-digit ('4702'=47k), R-notation ('4R7'=4.7Ω), or EIA-96 ('01C'=10k ±1%).
Returns (structured): { ohms, tolerance_percent, min_ohms, max_ohms }. Example: ['brown','black','red','gold'] -> 1000 Ω ±5%.
Inputs: bands, smd_code. Returns: ohms, max_ohms, min_ohms, tolerance_percent
embedcalc_ring_buffer_sizeRing Buffer / DMA Size CalculatorARead-onlyIdempotent
Size a ring buffer (or DMA buffer) from data rate, worst-case consumer latency, and a safety factor, rounded up to a power of two. Args: data_rate_bytes_per_sec, latency_ms (worst-case time before the consumer drains), safety_factor (default 2). Returns (structured): { bytes_needed, recommended_pow2 }. Example: 102400 B/s, 10 ms, ×2 -> 2048 bytes -> use 2048 (2^11).
Inputs: latency_ms (required), data_rate_bytes_per_sec (required), safety_factor. Returns: bytes_needed, recommended_pow2
embedcalc_rs485_busRS-485 Bus CalculatorARead-onlyIdempotent
RS-485 cable length limit (rule of thumb: length_m x bitrate_bps <= 10^8, capped 1200 m) and fail-safe bias resistors for >= 200 mV idle differential across 60 Ω (two 120 Ω terminators). Args: baud_bps, vcc (default 5), bias_ohm (optional — defaults to the computed maximum). Returns (structured): { max_cable_m, max_bias_ohm, bias_used_ohm, idle_vdiff_v, meets_200mv }. Example: 100 kbit/s -> 1000 m; Vcc=5 -> bias <= 720 Ω per side for 0.2 V idle.
Inputs: baud_bps (required), vcc, bias_ohm. Returns: max_cable_m, meets_200mv, idle_vdiff_v, max_bias_ohm, +1 more
embedcalc_spi_timingSPI Timing CalculatorARead-onlyIdempotent
SPI clock/frame timing: bit period, frame time, raw throughput. Args: sck_hz (SPI clock in Hz), bits_per_frame (default 8). Returns (structured): { bit_period_ns, frame_time_us, throughput_mbps }. Example: 10 MHz, 8 bits -> 100 ns/bit, 0.8 µs/frame, 10 Mbit/s.
Inputs: sck_hz (required), bits_per_frame. Returns: bit_period_ns, frame_time_us, throughput_mbps
embedcalc_struct_layoutC Struct Memory Layout CalculatorARead-onlyIdempotent
Compute the memory layout of a C struct/union — member offsets, inserted padding, bit-field packing, total size, and alignment — for a 32-bit MCU model (ARM Cortex-M style: pointers 4 bytes; double/int64 size 8 with 4-byte alignment, matching embedcalc.com).
Args: code (string) — C member declarations or a full struct, e.g. 'char a; int b;' or 'struct s { uint8_t a; uint32_t b; };'. Supports nested struct/union, arrays, pointers, and bit-fields.
Returns (structured): { total_size, alignment, padding_bytes, rows: [{offset, size, type, name, kind, depth}] }. Nested block rows show offsets relative to their parent block. Example: 'char a; int b;' -> total 8 bytes, 3 bytes padding after 'a'. Do not guess struct sizes/offsets — padding rules are exactly what LLMs get wrong.
Inputs: code (required). Returns: rows, alignment, total_size, padding_bytes
embedcalc_uart_baudUART Baud Rate / BRR CalculatorARead-onlyIdempotent
Compute the STM32 USART BRR register (mantissa + fraction), the actual achieved baud rate, and the baud error for a given peripheral clock — plus frame size/character time for the given format.
Args:
clock_hz (int): USART peripheral clock in Hz (e.g. 72000000).
baud (int): target baud rate (e.g. 115200).
oversampling (8|16, default 16): USART OVER8 setting.
data_bits (5-9, default 8), parity ('none'|'even'|'odd', default 'none'), stop_bits (1|1.5|2, default 1).
Returns (structured): { mantissa, fraction, brr_hex, actual_baud, error_percent, frame_bits, char_time_us }. Rule of thumb: |error| < 2% total link budget; keep your side < 0.5% when possible. Example: 72 MHz, 115200, over16 -> BRR=0x0271 (mantissa 39, fraction 1), 0.00% error.
Inputs: baud (required), clock_hz (required), parity, data_bits, +2 more. Returns: brr_hex, fraction, mantissa, frame_bits, +3 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
All 29 tools have distinctly different purposes, covering a wide range of embedded calculations without overlap. Each tool's description clearly defines its specific function, making it unambiguous for an agent to select the correct tool.
Every tool follows the 'embedcalc_' prefix with a descriptive snake_case name (e.g., 'embedcalc_can_bit_timing', 'embedcalc_microstrip_impedance'). The naming pattern is consistent and predictable across all tools.
With 29 tools, the count is on the high side but justified by the broad scope of embedded engineering calculations. Each tool provides a unique and useful calculation, and the number is reasonable for a comprehensive utility server.
The tool set covers many common embedded design domains (communications, power, signal integrity, component selection, etc.). Minor gaps exist (e.g., filter design, battery life), but the overall coverage is thorough and the most critical calculations are present.
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
44 calculators for AI agents: US tax, finance, business + an MCP engineering & security suite.
MCP server for aerospace calculations: orbital mechanics, ephemeris, DSN operations, ...
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that exposes 8 mathematical tools (arithmetic, algebra, calculus, matrix operations, statistics, probability, unit conversions) to any MCP-compatible AI agent, enabling mathematical computations without code.811 npm1MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that extends AI coding assistants with deterministic, algorithmic capabilities such as code analysis, fault localization, and formal verification, enabling an autonomous engineering team within the IDE.MIT
- AlicenseAqualityDmaintenanceAn MCP server that gives an AI assistant a set of real mechanical-engineering tools. Provides deterministic tools like material properties, beam analysis, unit conversion, and curve fitting for engineering calculations.5MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server providing calculator and file system tools, enabling AI agents to perform mathematical calculations and file operations.-