Skip to main content
ClaudeWave

Prompt → Schematic → Layout → 3D Enclosure: AI Hardware Synthesis, CircuitBlocks DSL, and MCP Server for KiCad/JLCPCB manufacturing

MCP ServersOfficial Registry1 stars0 forks● PythonMITUpdated today
ClaudeWave Trust Score
95/100
✓ Verified
Passed
  • ✓Open-source license (MIT)
  • ✓Actively maintained (<30d)
  • ✓Clear description
  • ✓Topics declared
  • ✓Documented (README)
Last scanned: 10/11/2026
Install in Claude Code / Claude Desktop
Method: pip / Python · circuit-agent-client
Claude Code CLI
claude mcp add circuit-agent -- python -m circuit-agent-client
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "circuit-agent": {
      "command": "python",
      "args": ["-m", "client.mcp_server"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
💡 Install first: pip install circuit-agent-client
Use cases

MCP Servers overview

<p align="center">
  <img src="docs/images/banner-1200x640.png" alt="CircuitAgent Banner" width="100%">
</p>

# CircuitAgent · Community Edition

<!-- mcp-name: io.github.mo9652962-ai/circuit-agent-client -->

**Prompt → Schematic → Layout → 3D Enclosure → Fabrication Bundle**

<p align="center">
  <a href="https://github.com/mo9652962-ai/circuit-agent/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/mo9652962-ai/circuit-agent/ci.yml?style=flat-square&label=CI" alt="CI"></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue?style=flat-square" alt="License: MIT"></a>
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/Python-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.10+"></a>
  <a href="tests/"><img src="https://img.shields.io/badge/Tests-240%20passing-success?style=flat-square" alt="Tests"></a>
  <a href="https://github.com/mo9652962-ai/circuit-agent/releases"><img src="https://img.shields.io/badge/Release-v0.1.6-blueviolet?style=flat-square" alt="Release"></a>
  <a href="https://github.com/modelcontextprotocol/registry"><img src="https://img.shields.io/badge/MCP_Registry-circuit--agent-black?style=flat-square" alt="MCP Registry"></a>
  <img src="https://img.shields.io/badge/KiCad-10.0%20Export-314CE0?style=flat-square&logo=kicad&logoColor=white" alt="KiCad 10">
</p>

<p align="center">
  <a href="README.md"><b>🇨🇳 中文说明</b></a>
  ·
  <a href="README_EN.md"><b>🇬🇧 English</b></a>
  ·
  <a href="#-mcp-server-接入">🔌 MCP Server</a>
  ·
  <a href="#-支持的电路积木清单">🧩 19+ 积木清单</a>
  ·
  <a href="#-工业-dfx-制造审查与安全仿真">🏭 工业 DFX</a>
  ·
  <a href="#-eda--制造数据导出">📐 KiCad/BOM 导出</a>
  ·
  <a href="https://github.com/mo9652962-ai/circuit-agent/issues">💬 反馈</a>
</p>

> **Status: alpha.** This repository is the open community layer of CircuitAgent: the
> hardware DSL, the LCSC live-selection client, and the data contracts that the
> full compiler consumes. The block set is deliberately small and every block is
> unit-tested — correctness over coverage.

---

## 为什么需要这一层 (Why this layer exists)

让大语言模型直接生成底层走线、焊盘与封装,几乎必然产出非法几何或引脚短路。
CircuitAgent 的做法是把 LLM 的输出**约束在预验证的电路积木上**,再用 Pydantic
契约把它变成确定性网表 —— 模型只负责"选积木",不负责"画线"。

<p align="center">
  <img src="docs/images/demo.gif" alt="CircuitAgent Pro 工作台演示" width="85%">
</p>

```text
Natural language prompt
        │
        ▼
┌────────────────────────┐
│  CircuitBlocks DSL     │  keyword → audited sub-circuits (deterministic)
└────────────────────────┘
        │
        ▼
┌────────────────────────┐
│  Netlist contract      │  Pydantic / JSON Schema (SSOT)
└────────────────────────┘
        │
   ┌────┴─────┐
   ▼          ▼
┌────────┐ ┌──────────────────┐
│ LCSC   │ │ REST / MCP APIs  │
│ client │ │ (community layer)│
└────────┘ └──────────────────┘
```

---

## 快速上手 (Quick Start)

**方式 A · 从 PyPI 安装(推荐)**

```bash
pip install circuit-agent-client
```

**方式 B · 从源码使用**

```bash
git clone https://github.com/mo9652962-ai/circuit-agent.git
cd circuit-agent
```

**零运行时依赖** —— 纯 Python 标准库实现,装完即用,不拉任何第三方包。
跑测试才需要 dev extra:`pip install -e ".[dev]"`

### 1 · 一句话生成硬件网表

```python
from client.synthesizer import synthesize_from_prompt

spec = synthesize_from_prompt(
    "基于 ESP32-C3 的环境监测节点,带 Type-C 供电、I2C 传感器插座、指示灯和2个按键"
)

print(spec["chip_id"])                            # ESP32-C3
print(len(spec["modules"]))                       # 元器件数
print(spec["netlist"]["connections"][0])          # 第一条网络连接
print(spec["unmatched"])                          # 你要求了、但 DSL 还不支持的模块(可执行信号)
print(spec["not_requested"])                      # 你没提到的可选模块(仅参考,非能力缺口)
```

映射是**确定性的**:同一句话永远产出逐字节相同的结果(CI 中有对应断言)。

`unmatched` 与 `not_requested` 是两个**刻意分开**的信号,不要混用:

| 字段 | 含义 | 例子 | 消费方式 |
|:---|:---|:---|:---|
| `unmatched` | 你**明确要求**、但当前 DSL **造不出来** | `ethernet` / `relay` / `motor_driver` | 这是能力信号,agent 应据此告知用户或换方案 |
| `not_requested` | 可选积木,只是这句话**没提到** | `button` / `led` / `buzzer` / `i2c` / `crystal` | 纯参考信息,不代表能力缺口 |

**不会被静默丢弃**:任何未识别的意图都会出现在 `unmatched` 里,而不是悄悄消失。

### 2 · 查询立创商城实时库存与单价

```python
from client.lcsc_client import search_lcsc_parts

for part in search_lcsc_parts("CH340N", limit=3):
    print(f"[{part['lcsc_part']}] {part['part_number']} | {part['package']} | "
          f"库存 {part['stock']} | ${part['price_usd']} | {part['part_class']}")
```

```text
[C506813] CH340N | SOP-8_L5.0-W4.0-P1.27-LS6.0-BL | 库存 196 | $0.5537 | Extended Part
```

客户端自带**重试退避 + 硬超时 + 24 小时磁盘缓存 + 防御式解析**:上游改结构不会
抛异常,断网时回落到缓存(缓存也没有则返回空列表,调用方永远不必处理传输层异常)。

### 3 · 直接用积木搭电路

```python
from client.circuit_blocks import block_usb_c_power, block_power_ldo_3v3

blk = block_power_ldo_3v3()
for comp in blk.components:
    print(comp.ref, comp.value, comp.package, comp.lcsc)
```

---

## 积木清单 (Block Catalogue)

| Block | 说明 | 关键设计点 |
|:---|:---|:---|
| `block_usb_c_power` | Type-C 供电输入 | 双 5.1k CC 下拉(sink 角色,非 56k 上拉) |
| `block_power_ldo_3v3` | AMS1117-3.3V 稳压 | 10µF 输入/输出储能电容 |
| `block_crystal_clock` | 无源晶振 + 负载电容 | 标记 `guard_ring` 属性供后端加地屏蔽环 |
| `block_button` | 消抖按键 | 10k 上拉 + 100nF RC,位号可参数化 |
| `block_led` | 状态指示灯 | 限流电阻 + 颜色/阻值可参数化 |
| `block_buzzer` | 蜂鸣器驱动 | S8050 NPN + 1N4148W 反向续流二极管 |
| `block_i2c_header` | I2C 扩展排针 | SCL/SDA 各 4.7k 上拉 |
| `block_rs485_transceiver` | SP3485 半双工差分串口 | 120Ω 终端电阻 + 100nF 去耦 + 3P 排针引出 |
| `block_can_transceiver` | SN65HVD230 3.3V CAN 节点 | 120Ω 终端匹配 + 10k 斜率控制 (高速模式) |
| `block_battery_tp4056` | TP4056 1A 线性锂电充电 | 1.2k 限流 + 充/满双色指示灯 + 2P 电池端子 |
| `block_sensor_aht20` | AHT20 温湿度传感器 | 工业 I2C 总线 + 去耦电容 + DFN-6 封装 (C2757850) |
| `block_sensor_mpu6050` | MPU-6050 6轴 IMU 运动姿态传感器 | 3轴陀螺仪+3轴加速度计 + 旁路去耦 + QFN-24 (C24112) |
| `block_esd_usb_tvs` | USB 接口高速 TVS 静电防护 | USBLC6-2SC6 超低结电容 (0.6pF) + SOT-23-6 |
| `block_esd_rs485_tvs` | RS-485 工业双向非对称 TVS | SM712 工业防雷/抗浪涌防静电二极管 (-7V~+12V) |
| `block_esd_can_tvs` | CAN 总线 ESD 双路 TVS 阵列 | PESD1CAN 24V 车规/工控双线 TVS (SOT-23) |
| `block_reverse_polarity_protection` | 工业电源输入防反接保护 | 肖特基二极管 (SS34) 或 低压降 P-MOSFET (AO3401A) |
| `block_power_pi_filter` | 电源输入 EMI π型 LC/RC 滤波器 | 磁珠 (100MHz 600Ω) + 10µF 钽电容/陶瓷电容吸收纹波 |
| `block_fiducial_marks` | SMT 贴片光学定位点 (Mark点) | 3个 1.0mm 裸铜焊盘 + 2.0mm 阻焊开窗 (DFA工序必备) |
| `block_testpoint_matrix` | 自动化测试点矩阵 (Test Points) | 1.0mm SMD 测试铜焊盘 (支持电源轨、地轨、SWD、UART测试) |
| `block_watchdog_supervisor` | TPS3823 看门狗/复位监控 | 1.6s WDI 喂狗 + 推挽复位输出(工业 MCU 防跑飞,IEC 61508 实践) |
| `block_ethernet_phy_w5500` | W5500 SPI 硬件 TCP/IP 以太网 | 10/100M PHY + 集成变压器与状态灯 RJ45 (HR911105A) + 25MHz 晶振 |
| `block_isolated_adc_ina219` | INA219 I2C 功率/电流双向监测 | 0.1Ω 2W 1% 精密检流电阻 + 实时电压电流遥测 |
| `block_motor_driver_drv8825` | DRV8825 2.5A 45V 步进电机驱动 | 1/32 微步进 + 100µF 50V 母线高压滤波 + XH-4P 接口 |
| `block_optocoupler_isolated_io` | PC817 5kV 高压光电隔离输入 | 2.4k 限流 + 反向保护二极管,适配 24V PLC 工业自动化输入 |

每个积木的引脚号、LCSC 料号、封装名在冻结前均对照数据手册与立创商城列表核验过。
`tests/test_circuit_blocks.py` 会强制校验:位号唯一、每个元件都有封装与料号、
网络端点必须指向已声明的元件、每个积木都必须接 `/GND`。

---

## MCP Server (AI Agent 工具服务)

CircuitAgent 内置标准 JSON-RPC 2.0 stdio MCP Server,基于纯 Python 标准库构建(无需任何第三方 pip 库),可无缝接入 **Claude Desktop**、**Cursor** 或 **Windsurf**。

当前暴露 **38 个工具**、8 个资源(`circuit://` URI)与 4 个工程提示词(slash-command)。

### 运行方式
```bash
python -m client.mcp_server
```

### Claude Desktop 配置 (`claude_desktop_config.json`)
```json
{
  "mcpServers": {
    "circuit-agent": {
      "command": "python",
      "args": ["-m", "client.mcp_server"],
      "cwd": "/path/to/circuit-agent"
    }
  }
}
```

### 暴露的工具 (Tools)
1. `synthesize_circuit`: 输入自然语言,输出确定性硬件网表与积木清单。
2. `search_lcsc_parts`: 免 Key 实时查询立创商城的元器件库存、封装、阶梯单价与基础库/扩展库属性。
3. `list_circuit_blocks`: 列出 DSL 中全部可用的 24 大已审计电路积木规格。
4. `validate_netlist`: 根据正式 JSON Schema 校验网表数据结构合法性。
5. `calculate_trace_impedance`: 基于 IPC-2141 解析公式计算微带线与差分对走线阻抗(50Ω RF / 90Ω USB / 120Ω CAN/485)。
6. `calculate_bom_cost`: PCBA 成本核算器,自动精算元器件裸成本与嘉立创扩展库换料费(¥20/种)。
7. `list_supported_chips`: 查询当前支持的微控制器型号及其引脚分配硬规则。
8. `register_custom_chip`: 动态注册第三方 MCU 物理引脚约束与外设映射表。
9. `calculate_ipc2152_trace_current`: 依据 IPC-2152 标准精确计算印制导线载流能力或反算线宽(温升 ΔT、铜厚 1oz/2oz、内层降额)。
10. `audit_industrial_dfx`: 工业级 DFX (DFM/DFA/DFT/DFC) 与生产合规自动化静态审查器,输出打分评级、问题分类与 Markdown 体检报告。
11. `export_kicad_netlist`: 导出标准 KiCad S-Expression 网表 (.net),支持 KiCad 6/7/8/9/10 直接导入 Pcbnew 快速布线。
12. `export_manufacturing_bom`: 生成量产级嘉立创 SMT BOM CSV 表格(含位号聚合、基础库免换料费分类)。
13. `calculate_parametric_circuit`: 闭环参数化硬件设计方程(E96 标准分压电阻对求解、LDO 散热结温校核、I2C 上拉阻值及 RC 滤波)。
14. `render_circuit_topology`: 生成结构化 ASCII 系统架构拓扑图(电源轨、总线、传感器与保护子系统)。
15. `run_erc`: 网表级电气规则门禁(ERC)——悬空网络、缺 GND、未知位号、缺电源域、缺去耦电容、差分总线缺 120Ω 终端电阻,每条带 severity 与出处,blocking/error 阻断 BOM/CPL 交付。
16. `analyze_power_tree`: 系统级电源树与热功耗分析器,追踪电源域负载电流、LDO 压差裕量、热耗散与结温估算 ($T_j$)。
17. `calculate_ipc2221_clearance`: 基于 IPC-2221B Table 6-1 标准根据工作电压与导体类别 (B1内层/B2外层裸露/B4涂覆/A6引脚) 精确计算最小电气间隙。
18. `export_specctra_dsn`: 生成通用 Specctra DSN (v15.0) 自动布线交互文件与启发式器件自动布局,支持直接送入 Freerouting / KiCad 执行 100% 自动化走线。
19. `export_kicad_schematic`: 导出原生现代 KiCad 8/9 S-Expression 原理图文件 (.kicad_sch),支持在 Eeschema 中直接以可视化原理图打开编辑(含器件符号排布、属性及图框)。
20. `audit_supply_chain`: 供应链多源弹性审计器(ISO 9001 采购供应链审计),自动排查单源卡脖子器件并映射引脚完全兼容的第二货源替代料 (Drop-in Second-Source) 与立创商城编号。
21. `calculate_differential_skew`: 高速差分对等长与时延差约束求解器(USB 2.0 HS ≤10ps、以太网 ≤25ps、CAN-FD ≤50ps),反求目标等长差与蛇形绕线 (Serpentine tuning) 齿数与几何尺寸。
22. `export_ipc_d356`: 导出通用工业标准 IPC-D-356A 裸板电性能飞针测试网表文件,直接喂入板厂飞针测试机 (AEMG/ATG/MicroCraft) 执行开短路连通性检验。
23. `export_gerber_bundle`: 原生直出符合 Ucamco RS-274X 扩展标准的制造级 Gerber 打包文件(板框 .gm1、顶层铜皮 .gtl、阻焊开窗 .gts、顶层丝印 .gto),摆脱对图形化 EDA 鼠标导出的依赖。
24. `calculate_pcb_stackup_impedance`: 标准工业四层板 (JLC04161H) 与六层板 (JLC06161H) 叠层矩阵查询与 IPC-2141A 特征阻抗自动反求(50Ω RF微带线、90Ω USB、100Ω 以太网、120Ω 工业差分对)。
25. `export_excellon_drill`: 生成生产级 IPC-NC-349 Excellon CNC 数控钻孔文件 (.drl),补齐 PCB 制造 5 层生产包。
26. `generate_interactive_bom`: 生成量产首件检验交互式装配导航网页 (iBOM, InteractiveHtmlBom 对标),实现位号清单与 SVG 矢量板图双向高亮聚焦。
27. `calculate_smt_feeder_matrix`: SMT 贴片机料槽与吸嘴智能配置器,遵循 EIA-481 载带标准(8/12/16/24mm 宽度与 2/4/8/12mm 步距)与 Juki/Yamaha 吸嘴矩阵(502~506 规格)。
28. `export_openpnp_job`: 导出标准 OpenPnP 
ai-agentautomationedaelectronicshardwarehardware-compilerjlcpcbjlpcbkicadllmmcppcbpythonschematic

What people ask about circuit-agent

What is mo9652962-ai/circuit-agent?

+

mo9652962-ai/circuit-agent is mcp servers for the Claude AI ecosystem. Prompt → Schematic → Layout → 3D Enclosure: AI Hardware Synthesis, CircuitBlocks DSL, and MCP Server for KiCad/JLCPCB manufacturing It has 1 GitHub stars and its last recorded update is dated 2026-10-10.

How do I install circuit-agent?

+

You can install circuit-agent by cloning the repository (https://github.com/mo9652962-ai/circuit-agent) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.

Is mo9652962-ai/circuit-agent safe to use?

+

Our security agent has analyzed mo9652962-ai/circuit-agent and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.

Who maintains mo9652962-ai/circuit-agent?

+

mo9652962-ai/circuit-agent is maintained by mo9652962-ai. The last recorded GitHub activity is dated 2026-10-10, with 0 open issues.

Are there alternatives to circuit-agent?

+

Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.

Deploy circuit-agent to your cloud

Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.

Maintain this repo? Add a badge to your README

Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.

Featured on ClaudeWave: mo9652962-ai/circuit-agent
[![Featured on ClaudeWave](https://claudewave.com/api/badge/mo9652962-ai-circuit-agent)](https://claudewave.com/repo/mo9652962-ai-circuit-agent)
<a href="https://claudewave.com/repo/mo9652962-ai-circuit-agent"><img src="https://claudewave.com/api/badge/mo9652962-ai-circuit-agent" alt="Featured on ClaudeWave: mo9652962-ai/circuit-agent" width="320" height="64" /></a>

More MCP Servers

circuit-agent alternatives