A Model Context Protocol (MCP) server that provides Claude with direct access to the Source Parts API for searching and managing electronic components, PCB parts, and manufacturing services.
- Product Search: Search the Source Parts marketplace with keywords, categories, and filters
- Product Details: Get comprehensive product information including specs, pricing, and availability
- Stock Checking: Real-time inventory availability across multiple suppliers
- Pricing Information: Detailed pricing with quantity breaks and volume discounts
- Parametric Search: Find components by technical specifications
- Datasheets: Access product documentation and datasheets
- Product Comparison: Compare specifications and pricing across multiple products
- Categories: Browse the product category hierarchy
- Node.js 18 or higher
- Claude Desktop or any MCP-compatible client
- Source Parts API access (optional - works with public API)
- Clone or install the package:
npm install @sourceparts/mcp
Or for development:
git clone git@github.com:SourceParts/mcp.git
cd mcp
npm install
npm run build
- Configure Claude Desktop to use the MCP server:
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"sourceparts": {
"command": "node",
"args": [
"/path/to/mcp/dist/index.js"
],
"env": {
"SOURCE_PARTS_API_KEY": "your-api-key-here"
}
}
}
}
- Restart Claude Desktop
Create a .env
file in the project root (optional):
# Optional: API base URL (defaults to https://source.parts/api)
SOURCE_PARTS_API_URL=https://source.parts/api
# Optional: API key for authenticated requests
SOURCE_PARTS_API_KEY=your_api_key_here
The server works without an API key for public product searches. An API key provides access to additional features like:
- Higher rate limits
- Access to private/draft products
- Bulk operations
- Historical data
Search for electronic components and products.
Parameters:
query
(required): Search keywords, part numbers, or descriptionscategory
(optional): Filter by category (e.g., "resistors", "capacitors")limit
(optional): Max results (default: 20, max: 100)offset
(optional): Pagination offset (default: 0)
Example:
Search for "STM32 microcontroller" in the "ics" category
Get detailed information about a specific product.
Parameters:
productId
(required): The unique product ID
Example:
Get details for product ID "prod_123abc"
Check real-time inventory availability.
Parameters:
productIds
(required): Array of product IDs to check
Example:
Check stock for products ["prod_123", "prod_456"]
Get pricing information with quantity breaks.
Parameters:
productId
(required): The product IDquantity
(optional): Desired quantity (default: 1)
Example:
Get pricing for product "prod_123" with quantity 1000
Parametric search by technical specifications.
Parameters:
category
(required): Component categoryspecs
(required): Object with specification key-value pairslimit
(optional): Max results (default: 20)
Example:
Find resistors with specs: {"resistance": "10k", "tolerance": "1%", "power": "0.25W"}
Get datasheet URLs and documentation.
Parameters:
productId
(required): The product ID
Example:
Get datasheets for product "prod_123"
Compare specifications and pricing across products.
Parameters:
productIds
(required): Array of 2-5 product IDs
Example:
Compare products ["prod_123", "prod_456", "prod_789"]
Get product categories and hierarchy.
Parameters:
parentCategory
(optional): Get subcategories of a parent
Example:
Get all top-level categories or subcategories of "passives"
npm run build
npm run dev
This runs TypeScript in watch mode, rebuilding on file changes.
Test the MCP server with the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.js
The server is built using:
- @modelcontextprotocol/sdk: Official MCP SDK for Node.js
- @sourceparts/sdk: Official Source Parts TypeScript SDK
- TypeScript: Type-safe development
- Zod: Runtime validation
The MCP server acts as a thin wrapper around the Source Parts SDK, exposing its functionality through MCP tools for use in Claude and other MCP-compatible clients.
mcp/
├── src/
│ └── index.ts # Main MCP server implementation
├── dist/ # Compiled JavaScript output
├── package.json # Package configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This file
The server connects to the Source Parts API at https://source.parts/api
by default. Available endpoints:
GET /products/search
- Product searchGET /products/:id
- Product detailsPOST /products/stock
- Stock availabilityGET /products/:id/pricing
- Pricing informationPOST /products/search/specs
- Parametric searchGET /products/:id/datasheets
- DatasheetsPOST /products/compare
- Product comparisonGET /products/categories
- Category listing
Once configured, you can ask Claude questions like:
- "Search for STM32 microcontrollers with at least 256KB flash"
- "Compare these three resistors: prod_123, prod_456, prod_789"
- "Check if product prod_abc is in stock and get pricing for 1000 units"
- "Find all ceramic capacitors with 10uF capacitance and 25V rating"
- "Show me the datasheet for product prod_xyz"
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Apache License 2.0 - see LICENSE file for details
Copyright 2025 Source Parts
- Documentation: https://source.parts/docs
- API Docs: https://source.parts/docs/api
- Issues: https://github.com/SourceParts/mcp/issues
- Email: support@source.parts
- Breaking: Refactored to use @sourceparts/sdk instead of direct API calls
- Added 14 tools (expanded from 8):
- Products: search_products, get_product_details, get_categories, get_manufacturers
- Quotes: list_quotes, get_quote, create_quote
- BOMs: list_boms, get_bom, get_bom_pricing
- Orders: list_orders, get_order, get_order_tracking
- Improved error handling through SDK
- Better type safety with SDK types
- Initial release
- 8 core tools for product search and management
- TypeScript support
- Full MCP SDK integration
- Direct API integration
- Source Parts SDK - JavaScript/TypeScript SDK for Source Parts API
- Source Parts CLI - Command-line interface for Source Parts
- Source Parts Docs - Official documentation
Made with ❤️ by Source Parts