embedcalc-mcp

embedcalc-mcp

MCP server providing embedded engineering calculators and code generators as tools for AI agents, enabling precise, deterministic embedded math and C code generation.

Category
访问服务器

README

embedcalc-mcp

Exact embedded-engineering math for AI agents. An MCP server with 29 deterministic calculators and code generators — so Claude, Cursor, or any MCP-enabled agent computes CRC check values, CAN timing registers, and struct padding instead of hallucinating them.

npm MCP Registry license

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 — 99 tests).

Install

Claude Code:

claude mcp add embedcalc -- npx -y embedcalc-mcp

Claude 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 (29)

Domain Tools
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
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
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)
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)
Components find_component — real, in-stock MPNs + buy links from a computed value (parametric search)

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") = 0x4B37 embedded 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_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

Run it yourself: npm install && npm run build && npm test (99 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选