jlcpcb-parts-mcp

calumk/jlcpcb-parts-mcp

3.2

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.

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.

  4. get_manufacturer

    Get manufacturer name from manufacturer ID.

  5. search_manufacturer

    Search for manufacturers by name (partial match).

  6. get_datasheet_url

    Get datasheet URL for a JLCPCB part number.

  7. get_part_image_url

    Get image URL for a JLCPCB part number.

  8. 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

  1. Clone or download this repository
  2. 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) - Use list_categories to get valid IDs
    • manufacturer_id (number, optional) - Filter by manufacturer
    • manufacturer_pn (string, optional) - Manufacturer part number pattern
    • description (string, optional) - Description pattern
    • package (string, optional) - Package type
    • is_basic_parts (boolean, optional) - Filter for basic parts only
    • is_preferred_parts (boolean, optional) - Filter for preferred parts only
    • limit (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