Model Context Protocol server for the Mouser Electronics Search API
Project description
mouser-search-mcp
Model Context Protocol server for the Mouser Electronics Search API.
Exposes the Mouser Search API as MCP tools so MCP-aware clients (Claude Code, Claude Desktop, etc.) can query Mouser's parts catalog.
Tools
| Tool | Endpoint | What it does |
|---|---|---|
search_by_keyword |
POST /api/v1/search/keyword |
Keyword search across the catalog (up to 50 parts). Supports paging and RoHS/in-stock filters. |
search_by_part_number |
POST /api/v1/search/partnumber |
Look up 1–10 part numbers (pipe-separated), with optional exact-match. |
search_by_keyword_and_manufacturer |
POST /api/v2/search/keywordandmanufacturer |
Keyword search scoped to one manufacturer by name. |
search_by_part_number_and_manufacturer |
POST /api/v2/search/partnumberandmanufacturer |
Part-number lookup scoped to one manufacturer by name. |
list_manufacturers |
GET /api/v2/search/manufacturerlist |
Enumerate manufacturer names (use the result to populate the manufacturer_name argument on the two manufacturer-filtered tools). |
Prerequisites
- Python 3.10+
- A Mouser Search API key — request one at https://www.mouser.com/api-search/.
Install
Using uv (recommended):
uv pip install -e .
Or with pip:
pip install -e .
Configure
The server reads the API key from the MOUSER_API_KEY environment variable. Copy .env.example to .env and fill in your key, or export it in your shell.
Run
The server speaks MCP over stdio:
MOUSER_API_KEY=... mouser-search-mcp
Use with Claude Code
Register the server (replace the path and key):
claude mcp add mouser-search \
--env MOUSER_API_KEY=your-key \
-- mouser-search-mcp
Use with Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"mouser-search": {
"command": "mouser-search-mcp",
"env": {
"MOUSER_API_KEY": "your-key"
}
}
}
}
If mouser-search-mcp is not on your PATH, point command at the absolute path to the script (e.g. inside your venv's bin/).
Notes
- Mouser returns at most 50 records per search response. Use
records+starting_record(v1 keyword search) orrecords+page_number(v2 keyword+manufacturer search) to page. search_optionsacceptsNone,Rohs,InStock, orRohsAndInStock— only one at a time.part_search_optionsacceptsNoneorExact.- The cart and order endpoints documented by Mouser require an Ordering API key and are not exposed by this server — it covers search only.
Releasing
Versioning and releases are fully automated by python-semantic-release. Every push to main runs .github/workflows/release.yml, which:
- Inspects commits since the last tag.
- Decides the next version (or does nothing if no release-worthy commits).
- Updates
versioninpyproject.toml, generates the changelog, commits, and pushes avX.Y.Ztag. - Builds wheel + sdist and uploads them to PyPI.
- Creates a GitHub Release with auto-generated notes.
Commit grammar
Commits must follow Conventional Commits. The leading keyword decides the bump:
| Prefix | Bump | Example |
|---|---|---|
feat: |
minor | feat: add list_manufacturers tool |
fix: |
patch | fix: handle empty Errors array |
perf: |
patch | perf: reuse httpx client |
feat!: / BREAKING CHANGE: in body |
major | feat!: rename tools |
docs:, chore:, refactor:, test:, ci:, style: |
none | (no release cut) |
Anything else is ignored. If you push a flurry of small commits, semantic-release collapses them into a single release on the next workflow run.
One-time setup
These steps need to be done once in the GitHub UI before the workflow can publish:
- PyPI account + token — create a PyPI account, then on the API tokens page generate an account-scoped token (the project doesn't exist on PyPI yet, so it can't be project-scoped on the first release; re-scope it to
mouser-search-mcpafter the first successful publish). - Repo secret — in GitHub: Settings → Secrets and variables → Actions → New repository secret, name
PYPI_API_TOKEN, paste the token value. - Workflow permissions — Settings → Actions → General → Workflow permissions must be set to Read and write permissions so semantic-release can push the version bump commit and tag.
After that, just merge to main with a feat: or fix: commit and the rest happens automatically. To skip a release, use a non-bumping prefix (docs:, chore:, etc.) or include [skip ci] in the commit message.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mouser_search_mcp-0.0.1.tar.gz.
File metadata
- Download URL: mouser_search_mcp-0.0.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fbe3100f46e1945a2a950ec9c2d678060f0d4ff87d1187b8d3e32a8d297411a
|
|
| MD5 |
98ed996508789446d380cebd70aa880f
|
|
| BLAKE2b-256 |
dfa9a17a7fac6e40b3135ae21666063dd4671c1c30ff715f1dbcc28d0f7eb5ba
|
File details
Details for the file mouser_search_mcp-0.0.1-py3-none-any.whl.
File metadata
- Download URL: mouser_search_mcp-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a7cea780254e4dc30f8eb2af70a649f9bc86e158efd8a838bf7d0354dfee8e6
|
|
| MD5 |
c17108eac59189fe4e23294289e30a2d
|
|
| BLAKE2b-256 |
c4e7a8a11cb0545b28f6748baf39d71ef4284c67bf9e6c630e8a7e5e200892aa
|