-
typeCAD Stack
08/16/2025 at 23:28 • 0 commentsWe've recently completed and refined several tools that people will find useful when developing hardware with typeCAD:
@typecad/typecad-docgen - convert markdown files and KiCAD PCBs into documentation with support for layer exports and renders@typecad/typecad-gitdiff - See the differences between KiCAD PCB files
@typecad/schematic - Generate KiCAD schematics from your typeCAD project
@typecad/kicad2typecad - Parse KiCad PCB board files and generate typeCAD code
@typecad/kicad-symbols - Fuzzy search for KiCad schematic symbols
They are all installed by default now with a new typeCAD project. -
Search for JLCPCB parts easier
07/21/2025 at 21:45 • 0 comments@typecad/jlcpcb-parts
Intelligent fuzzy search for JLCPCB basic and preferred electrical components with CLI interface. This TypeScript-based npm package provides smart component search capabilities by automatically managing a local database of JLCPCB parts and offering natural language search with intelligent parameter matching.
Dependencies
This package uses CDFER/jlcpcb-parts-database which provides a daily CSV download of all basic and preferred parts. That project depends on yaqwsx/jlcparts. Please consider supporting them.
Features
- 🔍 Intelligent Fuzzy Search: Find components using natural language descriptions
- 📦 Automatic Database Management: Downloads and caches JLCPCB components database
- ⚡ Fast CLI Interface: Quick command-line searches with formatted output
- 🎯 Smart Parameter Parsing: Recognizes electrical values, packages, tolerances, and more
- 📊 Scored Results: Get ranked results with match explanations
- 🔄 Auto-Updates: Keeps component database fresh (24-hour cache)
- 🎨 Multiple Output Formats: Detailed, compact, table, or JSON display options
- 🔧 Programmatic Integration: JSON output for scripting and automation
Installation
Global Installation (Recommended)
npm install -g @typecad/jlcpcb-parts
After global installation, you can use the
jlcpcb-searchcommand from anywhere:jlcpcb-search "10k resistor 0603"
Local Installation
npm install @typecad/jlcpcb-parts
Quick Start
Basic Search
# Search for a 10kΩ resistor in 0603 package jlcpcb-search "10k resistor 0603" # Search for a 100µF capacitor rated for 16V jlcpcb-search "100uF capacitor 16V" # Search for buttons jlcpcb-search "SPST button"
Advanced Usage
# Use table format for compact display jlcpcb-search "LM358 op amp" --format table # Sort by manufacturer and show 1 result jlcpcb-search "ceramic capacitor 0402" --sort manufacturer --limit 1 # Compact format for quick overview jlcpcb-search "LED red 0603" --format compact # JSON format for programmatic use jlcpcb-search "10k resistor" --format json
Usage
Command Line Interface
jlcpcb-search [options] <search query> Options: -h, --help Display help message -v, --version Display version information -f, --format <format> Output format: detailed, compact, table, or json (default: detailed) -s, --sort <field> Sort by: score, lcsc, manufacturer, or package (default: score) -l, --limit <number> Limit number of results (default: 5)
Search Query Examples
The tool understands natural language descriptions and can parse various electrical parameters:
Resistors
jlcpcb-search "10k resistor 0603" # 10kΩ resistor in 0603 package jlcpcb-search "1M ohm 1% 0805" # 1MΩ resistor with 1% tolerance jlcpcb-search "220 ohm thick film" # 220Ω thick film resistor
Capacitors
jlcpcb-search "100nF 50V X7R 0603" # 100nF ceramic capacitor jlcpcb-search "10uF 16V tantalum" # 10µF tantalum capacitor jlcpcb-search "1mF electrolytic 25V" # 1mF electrolytic capacitor
Inductors
jlcpcb-search "10uH inductor 0805" # 10µH inductor jlcpcb-search "100nH ferrite bead" # 100nH ferrite bead
ICs and Active Components
jlcpcb-search "LM358 op amp" # LM358 operational amplifier jlcpcb-search "STM32F103 microcontroller" # STM32F103 microcontroller jlcpcb-search "AMS1117 voltage regulator" # AMS1117 voltage regulator
Connectors and Mechanical
jlcpcb-search "USB" # IC jlcpcb-search "2.54mm header male" # 2.54mm pin headers jlcpcb-search "tactile switch 6x6" # Tactile switches
Output Formats
Detailed Format (Default)
Shows complete component information with match explanations:
Found 3 matching components: 1. C25804 - 10kΩ ±1% 0603 Thick Film Resistor Manufacturer: UNI-ROYAL(Uniroyal Elec) Part Number: 0603WAF1002T5E Package: 0603 Match Score: 95.0 Match Details: Exact resistance match (100 pts), Package match (80 pts), Tolerance match (70 pts)
Compact Format
One-line summary per component:
jlcpcb-search "10k resistor" --format compact
1. C25804 - 10kΩ ±1% 0603 Thick Film Resistor... - 0603 - 95.0 2. C25879 - 10kΩ ±5% 0805 Thick Film Resistor... - 0805 - 87.5
Table Format
Structured table view:
jlcpcb-search "capacitor 0603" --format table
# LCSC Manufacturer Part Number Package Score Description --- -------- ---------------- ---------------- ------- ------ ----------- 1 C14663 Samsung Electro CL10B104KB8N... 0603 92.0 100nF 50V X7R... 2 C1608 Samsung Electro CL10A105KB8N... 0603 89.5 1µF 25V X5R...
JSON Format
Machine-readable JSON output for programmatic integration:
jlcpcb-search "10k resistor 0603" --format json
[ { "lcsc": "25804", "manufacturer": "UNI-ROYAL(Uniroyal Elec)", "partNumber": "0603WAF1002T5E", "description": "10kΩ ±1% 0603 Thick Film Resistor", "package": "0603", "score": 95.0, "matchSummary": "Exact resistance match (100 pts), Package match (80 pts)" }, { "lcsc": "25879", "manufacturer": "UNI-ROYAL(Uniroyal Elec)", "partNumber": "0805WAF1002T5E", "description": "10kΩ ±5% 0805 Thick Film Resistor", "package": "0805", "score": 87.5, "matchSummary": "Exact resistance match (100 pts), Package match (40 pts)" } ]JSON Format Features:
- Clean Output: No formatting, colors, or progress indicators
- Machine-Readable: Valid JSON for easy parsing by scripts and applications
- Complete Data: All component information included in structured format
- Empty Results: Returns empty array
[]when no components found - Error Handling: Errors output as JSON objects with error information
JSON Error Response Format:
{ "error": true, "message": "No search query provided", "code": "MISSING_QUERY" -
An MCP Server for AI
07/17/2025 at 15:43 • 0 commentstypeCAD MCP Server
An MCP (Model Context Protocol) server that provides AI assistants with direct access to typeCAD tools and workflows. This enables seamless integration between AI coding assistants and typeCAD’s electronic design automation capabilities.
What is MCP?
MCP (Model Context Protocol) is a standard that allows AI assistants to connect to external tools and data sources. This server exposes typeCAD’s functionality as MCP tools, letting AI assistants create projects, add components, validate designs, and more.
Features
The server provides these typeCAD tools to AI assistants:
- 🏗️ Create Project - Initialize new typeCAD projects with optional PlatformIO support
- 🧩 Add Component - Add components from KiCAD libraries or JLCPCB catalog
- 📄 PDF to Text - Convert component datasheets from PDF to text format
- 📚 Download Docs - Fetch the latest typeCAD documentation
- ✅ Validate Component - Verify component definitions against datasheets
- 📦 Create Package - Generate complete IC packages from datasheets and schematics
Passive Components
Quick access to common passive components using the @typecad/passives package:
- 💈 Add Resistor - Create resistors with value, wattage, voltage rating options
- 🪫 Add Capacitor - Create capacitors with value, voltage rating options
- 💡 Add LED - Create LEDs with voltage and brightness specifications
- 🔌 Add Diode - Create diodes with voltage and efficiency specifications
- 🌀 Add Inductor - Create inductors with inductance value specifications
- 🔒 Add Fuse - Create fuses with current and voltage ratings
- 🔗 Add Connector - Create connectors with pin count and footprint options
- 🎯 Add Testpoint - Create testpoints with custom footprint options
Power Management
Tools for defining and managing power in your designs:
- 🔋 Add Power Source - Define power sources like batteries and regulators with voltage specs
- ⚡ Add Power Input - Define power input requirements for components and modules
PCB Layout & Routing
Advanced PCB design tools for layout and routing:
- 🔗 Add Via - Create vias for layer transitions with size, drill, and power specifications
- 🛤️ Add Track - Create PCB tracks with power-aware routing and layer management
Connections & Networking
Tools for managing electrical connections between components:
- 🏷️ Create Named Net - Create named connections between pins for better organization
- 🔌 Connect Pins - Connect multiple pins together in electrical networks
Component Management
Advanced component creation and modification tools:
- 🧩 Create Custom Component - Create custom components with named pins and power specs
- ⚙️ Set Component Properties - Modify component properties like DNP, reference, value, etc.
Design Validation
Comprehensive design checking and validation tools:
- ✅ Validate Design - Run comprehensive design validation including power and ERC checks
- 🔍 Run ERC - Run Electrical Rules Check to validate pin connections and compatibility
Installation
Install globally via npm:
npm install -g @typecad/typecad-mcp
Configuration
Add this to your MCP configuration file:
{ "mcpServers": { "typecad-mcp": { "command": "npx", "args": ["-y", "@typecad/typecad-mcp" ], "env": {} } } }Usage
Once configured, AI assistants can use typeCAD tools directly in conversation:
- “Create a new typeCAD project called ‘sensor-board’”
- “Add the ESP32-S3 microcontroller to my project”
- “Validate this component against its datasheet”
- “Create a package for this voltage regulator IC”
- “Add a resistor/capacitor/inductor/diode/LED/fuse/testpoint/connector”
- “Add a power source”
The AI assistant will automatically call the appropriate MCP tools and guide you through any required inputs.
-
Code and KiCAD
06/06/2025 at 02:56 • 0 commentstypeCAD is meant to work closely with KiCAD, essentially replacing the schematic editor. But typeCAD can do a lot more than the schematic editor, so the best way to go about things was getting a bit hazy.
The Problem
The vast majority of PCB design and layout can be done with typeCAD now. But there are still some things that KiCAD is better at, and the best way to sync changes between moving parts in the editor versus what’s generated by code wasn’t clear.
The Solution
Nearly everything can have its state saved, and typeCAD is smart enough to figure out what needs to be updated and what should be left as you manually edited it.
Some Improvements
Saving over KiCAD changes
typeCAD used to check for a lock file to see if the PCB file was open in KiCAD. It worked, but it wasn’t great. Now, it does some fancy window title checking, finds the open KiCAD window, and checks for unsaved changes. The build process will stop and let you know, and let you save (or not) before proceeding. If you’re on a system that doesn’t support this (Mac?), it will just check for the lock file.
Tracks
Tracks can have their widths changed in KiCAD, but not deleted. typeCAD will recreate deleted tracks, so if you want to modify a track, if it it created in code, it needs to be deleted in code (delete the line).
Preserved track changes are displayed during the build process, so you are made aware of any deviations from what the code as supposed to make.
Components
Components can be moved and rotated in KiCAD. typeCAD will preserve those changes. Nearly anything you can do with components in KiCAD will be preserved.
Vias
Vias can be created in typeCAD, so if you make any in KiCAD, the build process will let you know about them and give the coordinates so you can add them to your code.
The End Result
The goal is to have a smooth workflow between KiCAD and typeCAD. You should be able to make changes in either if you choose, while nudging in the direction of typeCAD for declaratively creating a PCB. Update your project to see the new features.
-
Simplification
05/31/2025 at 05:54 • 0 commentstypeCAD was growing in features at the expense of simplicity. The entire API has been simplified and the interaction between KiCAD and typeCAD has been improved while also maintaining backwards compatibility.
SchematicandPCBThe
SchematicandPCBclasses have been merged into a singlePCBclass. ThePCBclass now has aschematicproperty that contains the schematic data. ThePCBclass also has acreatemethod that takes a list of components and adds them to the schematic and board. This change was made because the schematic and board are always created together and there was no need to have two separate classes. Also, typeCAD was the schematic, so why put any mental effort into another ‘Schematic’?Now the bare minimum code to create a board is:
import { PCB } from '@typecad/typecad'; let typecad = new PCB('typecad'); typecad.create();There’s no need to think about
Schematicanymore. All the functionality is still there, but it’s stubbed out in thePCBclass.::netand::namedare called fromPCBnow. So is::bomand::erc.KiCAD
The interaction between typeCAD and KiCAD was getting unintuitive. Wondering if you needed to Revert to see component location changes or reimport the netlist to see other updates was confusing.
Now, typeCAD will automatically import the netlist after running
PCB::create(). That means you never have to interact with the netlist file again.Any changes made to the board will be reflected in their entirety when you run
PCB::create()and use the Revert function (or just reopen) the board in KiCAD.More KiCAD integration to come
Soon, we’ll be releasing a new version that will check for a dirty .kicad_pcb file and prompt you to revert before running
PCB::create(). This will prevent any changes you’ve made in KiCAD from being lost. It will be more robust and useful that the current method which just checks for the existence of a lock file.Package improvement
We’ve tweaked things to make packages easier to create and use. They are now created similarly to other components, and also used the same as well. Before, our example packages had
addandplacemethods. Now, they have a property that holds everything in acomponentsarray. That array is passed toPCB::create()as a spread operator. The result is a much simpler and more intuitive package creation and use.npm updateUpdate your projects and packages to the latest version to get the latest features and improvements.
-
Create tracks with typeCAD
05/25/2025 at 16:57 • 0 commentsOne of the last parts of board design was routing and that is largely accomplished now with the newest release.
The
TrackBuilderobject lets you create tracks with a fluent API.import { PCB, TrackBuilder } from '@typecad/typecad'; let pcb = new PCB('typecad_docs'); let power_track: TrackBuilder = this.pcb.track() .from({x: 100, y: 100}, "F.Cu", 0.2) // Start on F.Cu, 0.2mm wide (these are the defaults and can be omitted) .to({x: 110, y: 100}) // go to 110, 100 .via({size: 0.8, drill: 0.4}) // create a via at the 110, 100 .to({x: 110, y: 120, layer: "B.Cu"}); // Continues on B.Cu pcb.group('typecad_docs', power_track); // add the TrackBuilder to the group pcb.create();This method fits in nicely with the rest of the typeCAD API.
Connections
TrackBuilderobjects don’t take any connection information. This is because KiCAD will connect any track that touches an element with a net, ie. a track that touches a pad connected to the ‘gnd’ net will make the entire track also connected to the ‘gnd’ net. Since there's no use of an unconnected track, this works nicely and simplifies the process.typecad/kicad2typecad
@typecad/kicad2typecad is a package to simplify making tracks. This is particularly useful for making packages. You can lay out the entire package in KiCAD; components placed, tracks drawn, and vias added. Then use
kicad2typecadto generate the code snippets to create them programmatically in the package.Making a package
The workflow for creating a reusable package is:
- Create a package, add components and connections
- Layout the board in KiCAD using tracks and vias
- Use
kicad2typecadto generate the code snippets - Add the code snippets to the package
An example output for a small package looks like this:
Reading from File: .\typecad_docs.kicad_pcb Found 6 segments. Generating TrackBuilder chains from File: .Reading from File: .\typecad_docs.kicad_pcb. --- Generated typeCAD TrackBuilder Code from File: .\typecad_docs.kicad_pcb --- this.pcb.track().from({ x: 152.05, y: 96.87 }, "F.Cu", 0.2) .to({ x: 152.4, y: 96.52, layer: "F.Cu", width: 0.2 }); this.pcb.track().from({ x: 151.1, y: 99.665 }, "F.Cu", 0.2) .to({ x: 151.765, y: 100.33, layer: "F.Cu", width: 0.2 }) .to({ x: 152.273, y: 99.822, layer: "F.Cu", width: 0.2 }) .to({ x: 153.67, y: 99.822, layer: "F.Cu", width: 0.2 }); this.pcb.track().from({ x: 150.6, y: 99.175 }, "F.Cu", 0.2) .to({ x: 151.1, y: 99.175, layer: "F.Cu", width: 0.2 }) .to({ x: 151.1, y: 99.665, layer: "F.Cu", width: 0.2 }); --------------------------------------------------------- Found 4 footprints. Generating placement code from File: .\typecad_docs.kicad_pcb. --- Generated Component Placement Code from File: .\typecad_docs.kicad_pcb --- this.C1.pcb = { x: 153.67, y: 99.047, rotation: -90 }; this.C2.pcb = { x: 153.67, y: 95.986, rotation: -90 }; this.VR1.pcb = { x: 150.6, y: 97.725, rotation: 0 }; this.L1.pcb = { x: 147.32, y: 97.828, rotation: 90 }; ------------------------------------------------------------- Found 3 vias. Generating typeCAD code from File: .\typecad_docs.kicad_pcb. --- Generated typeCAD Via Code from File: .\typecad_docs.kicad_pcb --- this.v1 = this.pcb.via({ at: { x: 110, y: 100 }, size: 0.8, drill: 0.4 }); this.v2 = this.pcb.via({ at: { x: 152.4, y: 96.52 }, size: 0.6, drill: 0.3 }); this.v3 = this.pcb.via({ at: { x: 151.765, y: 100.33 }, size: 0.6, drill: 0.3 }); -----------------------------------------------------Using the code
The
TrackBuilderobjects can be used within a package directly. That’s why they are prefixed withthis. One modification would be to place the return value of eachthis.pcb.trackinto aTrackBuilderobject which can then be used to place in a package group.The vias can also be used directly, or you can just take their location data.
For
Componentobjects, the package doesn’t read your code so it doesn’t know what the variable names for your components are. It just uses the reference to show the code snippet. -
Automate via creation and board outlines
05/21/2025 at 23:00 • 0 commentsThe newest release of typeCAD included intial suport for adding vias.
Vias
In the code, they are created and used the same as any other component.
- let via = pcb.via({ at: {x: 10, y: 10}, size: 0.6, drill: 0.3 } );
- specify location, size and drill
- connect to any other net with Schematic::net(via.pin(1), ...);
Outlines
Outlines can be created as well.
// create an outline x=100, y=100, width=50, height=50, with a corner fillet of 1mm pcb.outline(100, 100, 50, 50, 1);With the addition of vias and outlines, all that is left is the tracks, and an entire board could be made programmatically.
-
Multiboards
05/17/2025 at 05:16 • 0 commentsTest jig/multi-board creation
Making a test jig is a common activity when developing a PCB. Using typeCAD, you can create a test jig and the board you’re developing in a single codebase. This is also a demonstration of how multiple PCBs can be created from code as well.
Testing jigs
For this example, our board and jig will be:
- a board with test points on the bottom
- another board with pogo pins that connect to the test points
- the boards will connect with standoffs and mounting holes
There’s obviously a lot of options here and this is just a simple example of one way it could be done.
Make a typeCAD project
From a terminal, run:
npx @typecad/create-typecad
Call this project
jig. No need to make a PlatformIO project or initialize a git repo unless you want to. No extra packages are needed either, but feel free to add them later if you want.Code
Add some code which will:
- create a board with two test points and two mounting holes
- create a jig board with two pogo pins and two mounting holes
- add a resistor to pretend to be testing something
import { Schematic, PCB } from "@typecad/typecad" import { Resistor } from '@typecad/passives/0603'; import { MountingHole } from '@typecad/passives/mounting_hole'; import { Testpoint } from '@typecad/passives/testpoint'; import { P70_5000045R } from './P70_5000045R'; let typecad = new Schematic('main'); let pcb = new PCB('main'); let jig = new PCB('jig'); let r1 = new Resistor({ value: '1kohm', pcb: {x: 166.815, y: 86.36, rotation: 0} }); let mh1 = new MountingHole({ size: 'M2.5', pcb: {x: 152.4, y: 76.2, rotation: 0} }); let mh2 = new MountingHole({ size: 'M2.5', pcb: {x: 177.8, y: 101.6, rotation: 0} }); let tp1 = new Testpoint({ pcb: {x: 165.1, y: 81.28, rotation: 0} }); let tp2 = new Testpoint({ pcb: {x: 168.04, y: 93.98, rotation: 0} }); typecad.create(r1, mh1, mh2, tp1, tp2); pcb.create(r1, mh1, mh2, tp1, tp2); let pogo1 = new P70_5000045R({ pcb: {x: 165.1, y: 81.28, rotation: 0} }); let pogo2 = new P70_5000045R({ pcb: {x: 168.04, y: 93.98, rotation: 0} }); jig.create(mh1, mh2, pogo1, pogo2);Code walkthrough
importimport { Schematic, PCB } from "@typecad/typecad" import { Resistor } from '@typecad/passives/0603'; import { MountingHole } from '@typecad/passives/mounting_hole'; import { Testpoint } from '@typecad/passives/testpoint'; import { P70_5000045R } from './P70_5000045R';We import the usual classes, plus a pogo pin from a custom package (there’s a downlink link at the bottom for this whole project).
MountingHole,TestpointandResistorare all from the@typecad/passivespackage which should already be installed.SchematicandPCBNow create the main schematic and two PCBs.
let typecad = new Schematic('main'); let pcb = new PCB('main'); let jig = new PCB('jig');Here, we create the main schematic and board, and also the jig board.
Components
Then all the components are created.
mh1,mh2are mounting holes.tp1,tp2are test points and will go on the main PCB.pogo1,pogo2are pogo pins and will go on the jig board.One important point to see is that the locations are being specified. This will come in handy when we reuse the mounting holes on the jig board.
Now create the components on the main board.
typecad.create(r1, mh1, mh2, tp1, tp2); pcb.create(r1, mh1, mh2, tp1, tp2);
Jig board components
The last thing to do will be to add the mounting holes and pogo pins to the jig board. Notice that we’ve copied the xy locations of the test points to the pogo pins. This will ensure that the pogo pins line up with the test points.
let pogo1 = new P70_5000045R({ pcb: {x: 165.1, y: 81.28, rotation: 0} }); let pogo2 = new P70_5000045R({ pcb: {x: 168.04, y: 93.98, rotation: 0} }); jig.create(mh1, mh2, pogo1, pogo2);Build
Build the code and there will be two PCB files created;
main.kicad_pcbandjig.kicad_pcb. You’ll see that the mounting holes, testpoints/pogo pins all line up. From here you can add additional functionality as needed. Changes made to one board can be programmatically applied to the other board with just a little bit of code.Downlink
Extract the zip file and open
jig.code-workspacein VSCode.npm ito install dependencies. -
Schematics in typeCAD
05/13/2025 at 15:31 • 0 commentsMake a schematic file in typeCAD
A schematic file isn’t needed since typeCAD code takes the place of it, but it can be useful to have one available. People will likely still want to look at a schematic rather than code.
To provide a starting point for that, we’ve developed a package to do that.
Read more about using it here.
-
Hardware Design with AI
05/13/2025 at 15:30 • 0 commentsHardware will eventually be designed with AI.
AI understands TypeScript very well and when you tell it very specifically what you want it to make, it can do it quite well.
To facilitate the 'telling', we've created typeCAD-prompt package.
typeCAD-prompt is a specialized tool designed to integrate typeCAD with AI coding models, enabling users to generate detailed prompts for transforming IC reference designs into typeCAD packages. Leverage AI capabilities, such as those provided by Gemini 2.5, to help with the hardware design process.
Key Features
- Automated Component Analysis: The tool identifies components from schematics and cross-references datasheets to ensure accurate selection.
- Interactive Refinement: Users can interact with the AI to confirm component details, adjust configurations, and resolve ambiguities during the design process.
Workflow Overview
- Input Preparation: Provide an IC datasheet (PDF or plaintext) and a schematic image. The tool generates a structured prompt for the AI model.
- Prompt Execution: Use an AI platform like Cursor to execute the prompt. The AI analyzes the schematic, references the datasheet, and creates a typeCAD package.
Installation and Usage
Install typeCAD-prompt globally using the following command:
npm i -g @typecad/typecad-prompt
Read more about using it here.
typecad