calumk/jlcpcb-parts-mcp
If you are the rightful owner of jlcpcb-parts-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server for accessing the JLCPCB component database, providing tools for efficient component search and information retrieval.
list_categories
Get a list of all JLCPCB component categories.
list_manufacturers
Get a list of all component manufacturers.
get_category
Get category and subcategory name from category ID.
get_manufacturer
Get manufacturer name from manufacturer ID.
search_manufacturer
Search for manufacturers by name (partial match).
get_datasheet_url
Get datasheet URL for a JLCPCB part number.
get_part_image_url
Get image URL for a JLCPCB part number.
search_parts
Search for JLCPCB components with various filters.
JLCPCB Parts MCP Server
A Model Context Protocol (MCP) server for searching and accessing JLCPCB component database. This server provides tools to search for electronic components, get component details, and access manufacturer information from the JLCPCB parts database.
Features
- 100% Bun Native: Built exclusively with Bun's native APIs for maximum performance
- Automatic Data Management: Downloads and caches the latest JLCPCB database (~1GB) and CSV files
- Smart Caching: Automatically re-downloads data older than 24 hours to keep information current
- Fast Search: Uses native SQLite for efficient component search with various filters
- Comprehensive Information: Access to component specifications, pricing, stock levels, and manufacturer details
- Zero Dependencies: No external database drivers or file system libraries needed
Bun Native APIs Used
- ā
bun:sqlite
- Native SQLite database operations - ā
bun:path
- Native path utilities - ā
Bun.file()
- Native file operations - ā
Bun.write()
- Native file writing - ā
fetch()
- Native HTTP requests - ā Native JSON parsing and processing
Prerequisites
- Bun runtime
- Internet connection for initial database download (~1GB)
Installation
- Clone or download this repository
- Install dependencies:
bun install
Usage
Start the MCP server:
bun run src/index.js
The server will automatically download the required database files on first run:
- JLCPCB Components Database (~1GB SQLite file)
- Basic/Preferred Parts CSV (~3MB)
Files are automatically re-downloaded if older than 24 hours to ensure data freshness.
Available Tools
1. list_categories
Get a list of all JLCPCB component categories.
2. list_manufacturers
Get a list of all component manufacturers.
3. get_category
Get category and subcategory name from category ID.
- Parameters:
category_id
(number)
4. get_manufacturer
Get manufacturer name from manufacturer ID.
- Parameters:
manufacturer_id
(number)
5. search_manufacturer
Search for manufacturers by name (partial match).
- Parameters:
name
(string)
6. get_datasheet_url
Get datasheet URL for a JLCPCB part number.
- Parameters:
part_id
(number) - JLCPCB part number
7. get_part_image_url
Get image URL for a JLCPCB part number.
- Parameters:
part_id
(number) - JLCPCB part number
8. search_parts
Search for JLCPCB components with various filters.
- Parameters:
category_id
(number, required) - Uselist_categories
to get valid IDsmanufacturer_id
(number, optional) - Filter by manufacturermanufacturer_pn
(string, optional) - Manufacturer part number patterndescription
(string, optional) - Description patternpackage
(string, optional) - Package typeis_basic_parts
(boolean, optional) - Filter for basic parts onlyis_preferred_parts
(boolean, optional) - Filter for preferred parts onlylimit
(number, optional) - Maximum results (default: 100)
Examples
Search for TI (Texas Instruments) Components
{
"name": "search_manufacturer",
"arguments": {"name": "TI"}
}
Find Resistors
{
"name": "search_parts",
"arguments": {
"category_id": 46,
"limit": 10
}
}
Search for Basic Parts Only
{
"name": "search_parts",
"arguments": {
"category_id": 46,
"is_basic_parts": true,
"limit": 20
}
}
Data Sources
This MCP server uses data from:
- JLCPCB Components Database: Filtered SQLite database containing components with 5+ items in stock
- Basic/Preferred Parts CSV: Lightweight CSV file with basic and preferred parts information
Data is sourced from the JLCPCB Parts Database project.
Performance
- Database Size: ~1GB (downloaded once, cached locally, auto-refreshed every 24h)
- Search Performance: Lightning-fast SQLite queries with Bun's native database engine
- Memory Usage: Extremely efficient with Bun's optimized runtime
- Startup Time: ~10-30 seconds for initial download, instant for subsequent starts
- Zero External Dependencies: No npm packages for database or file operations
File Structure
āāā src/
ā āāā index.js # Main MCP server implementation
āāā package.json # Project dependencies
āāā README.md # This file
āāā jlcpcb-components.sqlite3 # Downloaded database (auto-created)
āāā jlcpcb-components-basic-preferred.csv # Downloaded CSV (auto-created)
Environment Variables
None required. The server automatically downloads and manages data files.
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Credits
- Based on the Python implementation by @nvsofts