Skip to main content

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/index
  • hwlib://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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hwlib_mcp-0.1.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hwlib_mcp-0.1.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

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

Hashes for hwlib_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e52847cb361437154fd09a8b7541098adb8e3aabf8572f742f6a076df6c4b444
MD5 adc4bd729846fe90bc14dc83f917e7ed
BLAKE2b-256 9d23b8a8271770af52af0fa2ddca087218d8e4ce5aa3d43ff733b310a1f42889

See more details on using hashes here.

Provenance

The following attestation bundles were made for hwlib_mcp-0.1.0.tar.gz:

Publisher: release.yml on rnd-southerniot/hw-registry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for hwlib_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4e0ec267a6a236e8eb18f0826564a3875088f15ef22656c6a4d20d8523c8f8e
MD5 c8f434c21c492302c04c138263a91fa6
BLAKE2b-256 27b703aa5639ece612477368ad8a05551b26cbc970834cf86f2577f3f95f42f6

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page