Skip to main content
Glama

parts-mcp - KiCAD to TME cart and InvenTree inventory

Unofficial hobby project. Not affiliated with, endorsed by or supported by TME. No warranty, no responsibility for how it is used. See the Disclaimer. WARNING This MCP was FULLY vibe-coded. Later tested on my own setup (with success).

A local MCP server that lets Claude (Desktop / Cowork / Claude Code) turn a KiCad BOM into a checked, priced TME Quick Buy file, and keep a local InvenTree inventory, so you don't buy parts you already have.

KiCad (.kicad_sch / .net / .csv) ──bom_read──► consolidated lines (need + spares)
                                      │
            InvenTree ◄──inv_check_bom┘   (what's already in the drawers?)
                                      │
TME API v2 ◄─tme_lookup_mpns / tme_search / tme_parameters (match each line to a TME symbol)
                                      │
            tme_quote  ── MOQ, multiples, price breaks, stock, status flags
                                      │
            tme_export_quickbuy ──► orders/<name>.csv  ──► tme.eu Quick Buy ──► cart (you check out)
                                      │
   after delivery: inv_receive ──► InvenTree (part + TME supplier part + MPN + stock item)

It can't place orders. TME's API has no basket or order endpoints, and this server doesn't try anything else. You upload the generated file in Quick Buy, review it, and check out yourself.

Tools

Tool

What it does

parts_status

Shows config (no secrets) and tests the TME and InvenTree connections

bom_read

Reads .kicad_sch (via kicad-cli, or a direct parser for single-sheet schematics), KiCad .net or CSV files, several boards at once with board multipliers. Groups lines by MPN, then TME symbol, then value+package. Adds spares. Lists excluded test points, pads and DNP parts

tme_lookup_mpns

Matches MPNs to TME symbols in bulk (exact / fuzzy / not_found), with MOQ, multiples, stock and price tiers

tme_search

Catalogue search (e.g. 100k 0603 1%, in stock only)

tme_parameters

Technical parameters, to confirm generic passives

tme_products, tme_prices_stock, tme_delivery, tme_alternatives, tme_datasheets

Details, live stock and your prices, delivery estimates, substitutes, documents

tme_quote

Prices a list the way TME will sell it: rounds to MOQ and multiples, applies price tiers, moves to the next price break when that costs no more, and flags stock shortages and statuses like NOT_IN_OFFER

tme_export_quickbuy

Writes <name>.csv for Quick Buy (SYMBOL;QTY per line, no header, LF, the same shape as TME's own cart export) and an optional <name>-review.csv for you to read. Upload only the first one. Never overwrites an existing file

inv_check_bom

Checks BOM lines against stock: exact matches by TME symbol or MPN; value+package lines only return candidates for you to confirm

inv_find, inv_structure

Finds parts, lists locations and categories

inv_receive

Books a delivery: creates the part, TME supplier part and manufacturer part if missing, then adds a stock item (qty 0 creates only the part cards, no stock). Dry run by default; confirm=true also needs INVENTREE_ALLOW_WRITE=1

Related MCP server: TME MCP Server

Setup (macOS)

  1. TME API credentials. At developers.tme.eu, sign in with your tme.eu account and create an application. You get an app token (50 chars) and an app secret (20 chars). Apps created after 14 May 2026 work only with API v2, which this server uses.

  2. Install uv (brew install uv). Note its path: which uv.

  3. Create the config file ~/.config/parts-mcp/.env and run chmod 600 on it:

    mkdir -p ~/.config/parts-mcp && cp .env.example ~/.config/parts-mcp/.env
    chmod 600 ~/.config/parts-mcp/.env && open -e ~/.config/parts-mcp/.env
  4. Install the dependencies once, so the first start in Claude isn't slow: uv --directory /path/to/parts-mcp sync (the folder you cloned this repo into)

  5. Register the server with Claude Desktop. Go to Settings → Developer → Edit Config (~/Library/Application Support/Claude/claude_desktop_config.json):

    {
      "mcpServers": {
        "parts": {
          "command": "/opt/homebrew/bin/uv",
          "args": ["--directory", "/path/to/parts-mcp", "run", "parts-mcp"]
        }
      }
    }

    Use the absolute path from which uv, and the absolute path of your clone in place of /path/to/parts-mcp, then restart Claude Desktop.

  6. Ask Claude to run parts_status.

Claude Code alternative: claude mcp add parts -- uv --directory /path/to/parts-mcp run parts-mcp

Configuration (~/.config/parts-mcp/.env)

Variable

Default

TME_APP_TOKEN, TME_APP_SECRET

—

Required for TME tools

TME_COUNTRY / TME_CURRENCY / TME_LANGUAGE

PL / PLN / en

TME_MIN_INTERVAL

0.25

Seconds between API calls. TME doesn't publish a rate limit, and 429/5xx responses are retried with backoff

INVENTREE_URL, INVENTREE_TOKEN

—

Required for inv_* tools

INVENTREE_ALLOW_WRITE

0

Must be 1 for inv_receive confirm=true

INVENTREE_SUPPLIER_NAME

TME

Supplier company used for TME supplier parts

PARTS_EXPORT_DIR

~/Projects/parts-orders

Where Quick Buy files are written

PARTS_ALLOWED_ROOTS

~/Projects

bom_read only reads below these (:-separated)

KICAD_CLI

/Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli

Used for .kicad_sch; without it a direct single-sheet parser is used

KiCad conventions that make it work well

  • Give every specific part an MPN field. A Manufacturer field is optional.

  • To force a particular TME product, add a TME field with the TME symbol.

  • Generic passives can stay as value + footprint (e.g. 100k on R_0603). Claude searches TME and confirms with tme_parameters, using the rules in the skill.

  • Mark unpopulated parts DNP or exclude them from the BOM. Test points, contact pads, solder wire pads and mounting holes are excluded automatically and listed under excluded.

InvenTree

The inv_* tools are optional. They work with an InvenTree server that you run yourself; this repo doesn't include a deployment, so install it with InvenTree's own instructions. Then create an API token for the user that parts-mcp should act as, and put INVENTREE_URL and INVENTREE_TOKEN in the .env.

That user needs roles for part, part_category, stock, stock_location and purchase_order (supplier and manufacturer parts count as purchase_order); a user without a group gets 403 on every endpoint. The TME supplier company is created on the first inv_receive if it doesn't exist yet.

Development

uv sync --extra test
uv run pytest                          # unit + mock TME + stdio MCP round-trip
INVENTREE_TEST_URL=http://127.0.0.1:8000 INVENTREE_TEST_TOKEN=... uv run pytest tests/test_inventree_live.py

The TME mock follows the shapes in TME's OpenAPI v2 spec (https://developers.tme.eu/openapi.json). The InvenTree tests ran against InvenTree 1.7.2 and 1.7.3 (API v570), with a token whose user has the roles listed under InvenTree.

References and prior art

Disclaimer

This is an independent hobby project, maintained on a best-effort basis. It is not affiliated with, endorsed by, sponsored by or supported by Transfer Multisort Elektronik Sp. z o.o. ("TME"). TME and tme.eu are names of their respective owner and are used here only to describe what the software talks to.

  • Public API only. The server calls TME's publicly documented developer API with credentials that you create yourself on developers.tme.eu. It does not scrape the shop, bypass any protection or place orders. You are responsible for reading and following the TME API Terms and Conditions (the version dated 2026-07-01 at the time of writing), for the use you make of the data, and for keeping your API token and secret private.

  • TME data. Data powered by TME.eu Data – no guarantee of data accuracy. All intellectual property rights to content obtained via the API belong to TME, its subsidiaries, the manufacturers of the goods and/or other creators and owners. Prices, stock, MOQs and product details can be wrong or out of date: check the Quick Buy file and the cart on tme.eu before you pay. inv_receive stores this notice as a note on the parts and TME supplier parts it creates (existing records are not changed). InvenTree 1.7 keeps notes in a separate Note model (/api/note/) instead of a notes field on the record, and the tool uses that endpoint.

  • No warranty, no liability. The software is provided "as is", without warranty of any kind. The author accepts no responsibility or liability for how you use it, including orders and purchasing decisions, incorrect or outdated data, suspension or blocking of your TME API access, or changes made to your InvenTree database (also see the LICENSE).

License

MIT

Available Tools

16 tools
bom_readA
Read-only

Read one or more BOM sources and consolidate them into purchase lines.

Args: files: [{"path": "~/Projects/x/board.net", "boards": 2, "label": "main"}]. Supported: KiCad netlist (.net), KiCad schematic (.kicad_sch, exported with kicad-cli), CSV BOM. "boards" multiplies quantities (default 1). spare_policy: "default" (extra for small/losable parts) or "none".

Lines are grouped by MPN, else TME symbol, else value+package. Each line has need (= parts on the boards), spares and suggested_qty. Test points, pads, mounting holes and DNP parts are listed under "excluded" - check them.

Inputs: files (required), spare_policy.

inv_check_bomA
Read-only

Check BOM lines (as returned by bom_read) against stock.

Per line: matches (exact via TME symbol/MPN; generic value+package lines only get search "candidates" that must be confirmed), available, and suggested_buy: 0 if available >= need, else need - available + spares.

Inputs: lines (required).

inv_findA
Read-only

Find parts in InvenTree by TME symbol (supplier SKU), MPN, or free-text search. Returns stock on hand, available (unallocated) quantity and locations.

Inputs: mpn, query, tme_symbol.

inv_receiveA

Book delivered parts into InvenTree. Run with confirm=false first (dry run), show the plan to the user, and only call with confirm=true after they agree.

items: [{"tme_symbol", "mpn", "manufacturer", "name"?, "description", "qty", "location_id"?, "category_id"?, "unit_price"?, "currency"?, "batch"? (e.g. TME order number), "keywords"? , "value"?, "package"?, "kind"?}] Creates the part, the TME supplier part and the manufacturer part when missing (matched by TME symbol, then MPN), then adds a stock item. Needs INVENTREE_ALLOW_WRITE=1. With qty 0 (or no qty) only the part cards are created and no stock is booked. New parts and supplier parts get the TME data attribution in their notes (TME API terms 8.7, 8.8).

Inputs: items (required), confirm.

inv_structureA
Read-only

List InvenTree stock locations and part categories (ids for inv_receive).

Inputs: no named parameters.

parts_statusA
Read-only

Show configuration (no secrets) and test the TME and InvenTree connections.

Inputs: no named parameters.

tme_alternativesC
Read-only

Alternatives for a symbol: kind="similar" (substitutes) or "related" (accessories).

Inputs: symbol (required), kind.

tme_datasheetsC
Read-only

Document links (datasheets, drawings) per TME symbol.

Inputs: symbols (required).

tme_deliveryC
Read-only

Delivery estimate per symbol for the given quantities (same order).

Inputs: amounts (required), symbols (required).

tme_export_quickbuyA

Write a TME Quick Buy file into PARTS_EXPORT_DIR: "SYMBOL;QTY" per line, no header, LF line endings, extension .csv (byte-for-byte the shape of TME's own cart export).

Upload only this file at tme.eu -> Quick Buy -> "Upload products from file", review, then "Add to cart". Optionally also writes review_rows (list of dicts) as -review.csv, which is for you to read and must NOT be uploaded. Existing files are never overwritten (a timestamp is appended).

Inputs: name (required), lines (required), review_rows.

tme_lookup_mpnsA
Read-only

Match manufacturer part numbers to TME symbols, in bulk.

Per MPN returns status "exact" (one or more TME symbols carry exactly this MPN - e.g. cut tape vs reel), "fuzzy" (only search candidates; needs judgement) or "not_found", with MOQ/multiples and (optionally) stock and price tiers.

Inputs: mpns (required), fuzzy_fallback, include_prices.

tme_parametersC
Read-only

Technical parameters (resistance, tolerance, voltage, case...) per TME symbol.

Inputs: symbols (required).

tme_prices_stockB
Read-only

Stock and price tiers (your customer prices; NET/GROSS as returned) per symbol.

Inputs: symbols (required).

tme_productsA
Read-only

Product details (MOQ, multiples, status, packing) for TME symbols OR manufacturer part numbers. Any length; batched by 50 internally.

Inputs: mpns, symbols.

tme_quoteA
Read-only

Price a list of {"symbol", "qty", "ref"?} lines exactly as TME would sell them.

Rounds to MOQ/multiples, picks the price tier, and (optimize_price_breaks) moves to a higher tier when that costs no more than max_extra_cost_per_line extra. Flags: UNKNOWN_SYMBOL, NOT_IN_OFFER, CANNOT_BE_ORDERED, STOCK_SHORT_n, ROUNDED_UP_FROM_n, PRICE_BREAK_a_TO_b, HARDLY_AVAILABLE, ... Totals are in the API's currency and price type.

Inputs: lines (required), optimize_price_breaks, max_extra_cost_per_line.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 16 tools

    Disambiguation4/5

    Tools split cleanly along a workflow (BOM read → search/lookup → details/params/prices → quote/export → inventory check/receive), and prefixes make the TME vs InvenTree boundary obvious. There is mild overlap between tme_products (details, MOQ, status) and tme_prices_stock (stock/price tiers), and tme_products vs tme_lookup_mpns both accept MPNs, but descriptions clarify which to use when.

    Naming Consistency4/5

    Nearly everything is snake_case with a domain prefix (parts_, bom_, tme_, inv_) and a verb-ish second token, which reads predictably. The only deviations are noun-only names (tme_parameters, tme_datasheets, inv_structure) mixed with verb names like inv_find or tme_search, a minor irregularity rather than a real inconsistency.

    Tool Count4/5

    16 tools is at the upper end but each covers a distinct step: catalogue search, bulk MPN resolution, parameters, prices, datasheets, alternatives, delivery, quoting, export, plus four inventory tools. Nothing looks redundant enough to be dropped, though the catalogue-side tools could plausibly be consolidated.

    Completeness3/5

    The procure-to-stock lifecycle is covered end to end (read BOM, resolve MPNs, price/quote, export cart file, check stock, book goods in). Gaps remain: there is no way to adjust or consume existing stock, no order/PO tracking back from TME, and no tool to update or correct an already-created InvenTree part — only creation via inv_receive.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      F
      maintenance
      Enables interaction with InvenTree inventory management system, providing tools for parts, stock, orders, companies, barcodes, labels, reports, attachments, and system administration.
      12
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables searching and retrieving detailed information on electronic components from TME, including pricing, stock, datasheets, and delivery estimates.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables automated KiCad-adjacent workflows by parsing and round-tripping S-expression files, classifying DRC/ERC reports, and generating pin-header footprints without a running KiCad instance.
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides read-only MCP tools for parsing KiCad netlists and schematics, running evidence-based audits, and generating deterministic sizing and BOMs.
      MIT