DigiKey MCP Server is a Model Context Protocol implementation that provides access to DigiKey's Product Search API. This server allows you to search for electronic components, retrieve detailed product information, and find pricing data using the FastMCP framework.
Use the uv package manager to install all required dependencies:
uv sync
Create a .env
file in the project root directory with your DigiKey API credentials:
CLIENT_ID=your_digikey_client_id
CLIENT_SECRET=your_digikey_client_secret
USE_SANDBOX=false
If you want to use DigiKey's sandbox environment for testing, set USE_SANDBOX=true
.
Run the MCP server using the following command:
uv run python digikey_mcp_server.py
The server provides several methods for searching DigiKey's product catalog:
keyword_search(keywords, limit=5, manufacturer_id=None, category_id=None, search_options=None, sort_field=None, sort_order="Ascending")
This method allows you to search for products by keyword with various filtering and sorting options.
search_manufacturers()
search_categories()
These methods retrieve all product manufacturers and categories available in DigiKey's catalog.
search_product_substitutions(product_number, limit=10, search_options=None, exclude_marketplace=False)
This method helps you find substitute products for a specific part number.
product_details(product_number, manufacturer_id=None, customer_id="0")
Retrieve comprehensive information about a specific product.
get_product_media(product_number)
get_product_pricing(product_number, customer_id="0", requested_quantity=1)
get_digi_reel_pricing(product_number, requested_quantity, customer_id="0")
These methods provide access to product images, documents, videos, and detailed pricing information.
When using the keyword_search
method, you can sort results using these fields:
Packaging
- Sort by packaging typeProductStatus
- Sort by product statusDigiKeyProductNumber
- Sort by DigiKey part numberManufacturerProductNumber
- Sort by manufacturer part numberManufacturer
- Sort by manufacturer nameMinimumQuantity
- Sort by minimum order quantityQuantityAvailable
- Sort by available quantityPrice
- Sort by priceSupplier
- Sort by supplierPriceManufacturerStandardPackage
- Sort by manufacturer standard package priceSort orders: Ascending
or Descending
You can apply these filters using the search_options
parameter:
LeadFree
- Lead-free products onlyRoHSCompliant
- RoHS compliant products onlyInStock
- In-stock products onlyHasDatasheet
- Products with datasheetsHasProductPhoto
- Products with photosHas3DModel
- Products with 3D modelsNewProduct
- New products onlyHere are some practical examples of using the MCP server:
keyword_search("resistor", limit=10)
keyword_search("capacitor", limit=5, sort_field="Price", sort_order="Ascending")
keyword_search("LED", limit=10, search_options="InStock,RoHSCompliant")
product_details("296-8875-1-ND")
get_product_pricing("296-8875-1-ND", requested_quantity=100)
To use this server with Claude Desktop, add the following to your Claude Desktop configuration file (located at ~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
{
"mcpServers": {
"digikey": {
"command": "uv",
"args": ["run", "python", "digikey_mcp_server.py"],
"cwd": "/path/to/project"
}
}
}
Replace /path/to/project
with the actual path to your DigiKey MCP Server installation directory.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "digikey" '{"command":"uv","args":["run","python","digikey_mcp_server.py"],"cwd":"/path/to/project"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"digikey": {
"command": "uv",
"args": [
"run",
"python",
"digikey_mcp_server.py"
],
"cwd": "/path/to/project"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"digikey": {
"command": "uv",
"args": [
"run",
"python",
"digikey_mcp_server.py"
],
"cwd": "/path/to/project"
}
}
}
3. Restart Claude Desktop for the changes to take effect