MCP server exposing the hw-registry component bundle to AI coding agents.
Project description
hwlib-mcp
An MCP server exposing the hw-registry component bundle to AI coding
agents — Claude Code, Cursor, Cline, and anything else that speaks
Model Context Protocol.
The server is read-only. It serves the deterministic bundle produced
by hwlib-build (see BLUEPRINT.md).
Install
uvx hwlib-mcp # PyPI publish lands in Prompt 10
For local dev, see the root README make mcp-install.
Configuration
| Environment variable | Default | Purpose |
|---|---|---|
HWLIB_DATA_DIR |
<repo>/dist |
Directory holding library.sqlite + friends |
If library.sqlite is missing the server prints a diagnostic and exits
non-zero — it does not auto-build. Run python -m tools.builder --out dist/ first.
Wiring it into agents
Claude Code
claude mcp add hwlib uvx hwlib-mcp
# or, pinned to a release:
claude mcp add hwlib uvx --from hwlib-mcp==0.1.0 hwlib-mcp
Cursor
.cursor/mcp.json:
{
"mcpServers": {
"hwlib": {
"command": "uvx",
"args": ["hwlib-mcp"]
}
}
}
Cline
VS Code settings → cline.mcpServers:
{
"hwlib": {
"command": "uvx",
"args": ["hwlib-mcp"]
}
}
Hosted / Streamable HTTP
HWLIB_DATA_DIR=/srv/hwlib/dist hwlib-mcp --http --port 8080
Agents connect via claude mcp add hwlib --transport http http://host:8080. Stdio is the default; --http is for shared /
hosted deployments. SSE is intentionally not supported (deprecated in
MCP 2025-03-26 spec).
Tool surface
| Tool | Returns | Token-discipline note |
|---|---|---|
hwlib_search |
summaries (≤ 20) | call BEFORE hwlib_get |
hwlib_list |
paginated summaries | filter by kind / interface / voltage |
hwlib_get |
one full record | always pass fields: to project |
hwlib_check_pin_conflicts |
{ok, diagnostics[]} |
call BEFORE generating any pin-using code |
hwlib_compatible_modules |
summaries | best-effort; absence ≠ incompatible |
hwlib_get_drivers |
per-framework bindings | use when scaffolding firmware |
hwlib_suggest_pinmap |
stub | post-MVP; alternative_tool: hwlib_check_pin_conflicts |
hwlib_generate_platformio_ini |
stub | post-MVP; alternative_tool: hwlib_get_drivers |
hwlib_generate_sdkconfig |
stub | post-MVP; alternative_tool: hwlib_get_drivers |
hwlib_get_kicad_refs |
stub | post-MVP; alternative_tool: hwlib_get fields=['kicad'] |
Resources (Claude Code first-class, lower-tier elsewhere):
hwlib://component/{id}hwlib://catalog/indexhwlib://schema/{kind}
Every capability is also available as a Tool — Resources are an ergonomics win for Claude Code's @-mention but never the only path.
Debugging
hwlib-mcp --log-level debug # verbose logs to stderr
hwlib-mcp --http --port 8080 # then point MCP Inspector at localhost:8080
Errors are returned as structured shapes, never exceptions:
{"status": "not_found", "id": "...", "suggestions": [...]} etc. If you
see a Python traceback in agent output, please file a bug.
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 hwlib_mcp-0.1.0.tar.gz.
File metadata
- Download URL: hwlib_mcp-0.1.0.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e52847cb361437154fd09a8b7541098adb8e3aabf8572f742f6a076df6c4b444
|
|
| MD5 |
adc4bd729846fe90bc14dc83f917e7ed
|
|
| BLAKE2b-256 |
9d23b8a8271770af52af0fa2ddca087218d8e4ce5aa3d43ff733b310a1f42889
|
Provenance
The following attestation bundles were made for hwlib_mcp-0.1.0.tar.gz:
Publisher:
release.yml on rnd-southerniot/hw-registry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hwlib_mcp-0.1.0.tar.gz -
Subject digest:
e52847cb361437154fd09a8b7541098adb8e3aabf8572f742f6a076df6c4b444 - Sigstore transparency entry: 1399491294
- Sigstore integration time:
-
Permalink:
rnd-southerniot/hw-registry@a41e4a7e5e7eb71e08cc86d8d44ccab79afc92be -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rnd-southerniot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a41e4a7e5e7eb71e08cc86d8d44ccab79afc92be -
Trigger Event:
push
-
Statement type:
File details
Details for the file hwlib_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hwlib_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4e0ec267a6a236e8eb18f0826564a3875088f15ef22656c6a4d20d8523c8f8e
|
|
| MD5 |
c8f434c21c492302c04c138263a91fa6
|
|
| BLAKE2b-256 |
27b703aa5639ece612477368ad8a05551b26cbc970834cf86f2577f3f95f42f6
|
Provenance
The following attestation bundles were made for hwlib_mcp-0.1.0-py3-none-any.whl:
Publisher:
release.yml on rnd-southerniot/hw-registry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hwlib_mcp-0.1.0-py3-none-any.whl -
Subject digest:
c4e0ec267a6a236e8eb18f0826564a3875088f15ef22656c6a4d20d8523c8f8e - Sigstore transparency entry: 1399491297
- Sigstore integration time:
-
Permalink:
rnd-southerniot/hw-registry@a41e4a7e5e7eb71e08cc86d8d44ccab79afc92be -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rnd-southerniot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a41e4a7e5e7eb71e08cc86d8d44ccab79afc92be -
Trigger Event:
push
-
Statement type: