Nexar MCP Server
A Model Context Protocol (MCP) server for searching electronic components and retrieving datasheets via the Nexar API (formerly Octopart API).
Keywords: Nexar, Octopart, MCP, electronic components, part search, datasheet, BOM, component sourcing, electronics design, PCB, Claude, AI assistant
Purpose
This MCP server provides a secure interface for AI assistants to search the Octopart/Nexar component database, compare pricing across distributors, check availability, and retrieve datasheet URLs. Perfect for electronics engineers using Claude Desktop or other MCP-compatible AI assistants.
Features
Component-Specific Tools
The server exposes specialized tools for different component types, allowing the AI client to select the appropriate tool and pass structured parameters:
Tool | Description |
| Search resistors by resistance, tolerance, power rating, mounting (SMD/through-hole) |
| Search capacitors by capacitance, voltage, dielectric, mounting (SMD/through-hole) |
| Search inductors by inductance, current rating, DCR, mounting (SMD/through-hole), shielded |
| Search MCUs, transistors, ICs, diodes by part number, mounting (SMD/through-hole) |
| Search crystals/oscillators by frequency, ppm tolerance, mounting (SMD/through-hole) |
| Search connectors by type, pin count, pitch, mounting |
| Generic fallback for part numbers or unknown component types |
| Bulk search multiple components in one call (for BOMs) |
| Get full specs, pricing, and availability for a specific MPN |
| Get datasheet URL for a specific MPN |
Common Parameters
All search tools share these parameters:
Parameter | Type | Description |
| string | Filter by manufacturer name |
| float | Maximum unit price in USD |
| string | Filter to specific distributor (digikey, mouser, etc.) |
| int | Quantity for price break lookup and sorting |
| bool | Only show parts with stock |
| int | Max results to return (default: 10) |
Usage Examples
Just ask Claude naturally - it will select the appropriate tool automatically.
Resistors
"Find me a 10k 1% resistor in 0805 package"
"I need 100 qty of 4.7k 0.25W resistors from DigiKey"
"Search for 100 ohm 5% 0402 resistors under $0.01"
Capacitors
"Find a 100nF 16V X7R capacitor in 0805"
"I need 10uF 25V caps in 1206 from Mouser"
"Search for 47pF C0G capacitors in 0402 package"
Inductors
"Find a 2.2uH SMD inductor"
"Find a 10uH inductor rated for 2A, shielded"
"I need a 100nH 0603 inductor from DigiKey"
"Search for 4.7uH through-hole inductors with 3A current rating"
Semiconductors
"Find STM32F103C8T6"
"I need an N-channel MOSFET rated for 60V 10A in SO-8"
"Search for ESP32-WROOM modules in stock"
"Find LM7805 voltage regulators at DigiKey, I need 25"
Crystals
"Find an 8MHz crystal with 20ppm tolerance in HC-49 package"
"I need a 32.768kHz crystal with 12pF load capacitance"
"Search for 25MHz crystals with 10ppm or better"
Connectors
"Find USB-C receptacles for SMD mounting"
"I need a 4-pin JST-PH connector with 2mm pitch"
"Search for RJ45 jacks"
"Find 40-pin male headers with 2.54mm pitch"
Part Number Lookup
"Look up part number LM358"
"Find ATmega328P-PU in stock"
"Search for BME280 sensors at Mouser"
Part Details and Datasheets
"Get me the datasheet for STM32F103C8T6"
"Show me full details and pricing for RC0805JR-0710KL"
Distributor Filtering
You can filter results to specific distributors:
DigiKey
Mouser
Newark
Arrow
Farnell
LCSC
Example: "Find 10k resistors in stock at DigiKey with at least 100 quantity"
BOM Search (Bulk Component Lookup)
Search multiple components in a single call using search_bom. Pass a JSON object with arrays for each component type:
Supported component arrays:
resistors- same parameters asfind_resistorscapacitors- same parameters asfind_capacitorsinductors- same parameters asfind_inductorssemiconductors- same parameters asfind_semiconductorscrystals- same parameters asfind_crystalsconnectors- same parameters asfind_connectorscomponents- same parameters assearch_components(generic fallback)
Parameters:
bom_json(string): JSON object with component arraysdefault_limit(int): Results per component (default: 1). Override per-component with"limit"field.
Example: "Search for these BOM components: 10k 1% 0805 resistor, 100nF X7R capacitor, and STM32F103"
Query Best Practices
Based on extensive testing against the Nexar API, here are tips for optimal results:
Include Package in Query String (Recommended)
For semiconductors and complex components, include package specs directly in the query parameter rather than using the separate package filter:
Keep Queries Focused
Simpler queries with key specifications often return better results than overly detailed queries:
Use Filters for Business Constraints
The distributor, quantity, max_price, and in_stock_only filters work reliably:
Passive Components Work Well with Filters
For resistors, capacitors, inductors, and crystals, the dedicated parameters work reliably:
Prerequisites
Docker Desktop with MCP Toolkit enabled
Docker MCP CLI plugin (
docker mcpcommand)Nexar API credentials (client ID and secret)
Getting Nexar API Credentials
Sign up at https://nexar.com
Create or join an organization
Access portal.nexar.com to create an application
Note your Client ID and Client Secret
Installation
Step 1: Build Docker Image
Step 2: Set Up Secrets
Step 3: Create Custom Catalog
Create or edit ~/.docker/mcp/catalogs/custom.yaml:
Step 4: Update Registry
Edit ~/.docker/mcp/registry.yaml and add under the registry: key:
Step 5: Configure Claude Desktop
Find your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Ensure your custom catalog is included in the args array:
Step 6: Restart Claude Desktop
Quit Claude Desktop completely
Start Claude Desktop again
Your new tools should appear!
Configuration
The server supports optional configuration via environment variables. By default, results are sorted by lowest price at 100 quantity.
Available Settings
Variable | Default | Description |
|
| Quantity break used for price sorting (e.g., 100, 1000) |
| (none) | Always filter to this distributor (e.g., "digikey", "mouser") |
|
| Only show in-stock parts by default |
Setting Configuration
Add environment variables to your catalog entry in ~/.docker/mcp/catalogs/custom.yaml:
Or for local testing, set environment variables directly:
Architecture
Development
Local Testing
Adding New Tools
Add the function to
octopart_server.pyDecorate with
@mcp.tool()Update the catalog entry with the new tool name
Rebuild the Docker image
Troubleshooting
Tools Not Appearing
Verify Docker image built successfully
Check catalog and registry files
Ensure Claude Desktop config includes custom catalog
Restart Claude Desktop
Authentication Errors
Verify secrets with
docker mcp secret listEnsure secret names match in code and catalog
Check that your Nexar application has the Supply scope enabled
No Results Found
Try a broader search query
Check that the part number is correct
Some parts may not be in the Nexar/Octopart database
Security Considerations
All secrets stored in Docker Desktop secrets
Never hardcode credentials
Running as non-root user
Sensitive data never logged
API Rate Limits
The Nexar API has usage limits based on your subscription plan. Each search query counts against your monthly quota based on the number of matched parts returned.
Related
Octopart - The component search engine powered by Nexar
Model Context Protocol - The protocol this server implements
License
MIT License