Skip to main content
Glama
inventree-mcp

inventree-mcp

by hvkshetry

InvenTree MCP Server

MCP server for InvenTree inventory management. Provides 12 parameterized tools covering 117 operations for parts, stock, build orders, purchase/sales/return orders, companies, barcodes, labels, reports, attachments, and system administration.

Requirements

  • Python 3.11+

  • uv (recommended) or pip

  • An InvenTree instance with API access enabled

  • An API token (generate from InvenTree > Settings > API Tokens)

Related MCP server: MCP Inflow Ingredients

Setup

# Clone the repository
git clone https://github.com/puran-water/inventree-mcp.git
cd inventree-mcp

# Copy the example environment file and fill in your values
cp .env.example .env

# Install dependencies
uv sync

Edit .env with your InvenTree instance URL and API token:

INVENTREE_URL=https://your-inventree-instance.example.com
INVENTREE_TOKEN=your-api-token-here

Usage

STDIO mode (default)

uv run python server.py

SSE mode (HTTP transport)

uv run python server.py sse --port 3074

Claude Desktop / MCP client configuration

Add to your MCP client config (e.g. ~/.claude/mcp.json):

{
  "mcpServers": {
    "inventree-mcp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/inventree-mcp", "python", "server.py"],
      "env": {
        "INVENTREE_URL": "https://your-inventree-instance.example.com",
        "INVENTREE_TOKEN": "your-api-token-here"
      }
    }
  }
}

Or for SSE transport:

{
  "mcpServers": {
    "inventree-mcp": {
      "url": "http://localhost:3074/sse"
    }
  }
}

Tools

Each tool uses a parameterized operation field to select the specific action.

Tool

Operations

Description

part

21

Part & category management (list, get, create, update, delete, BOM, suppliers, parameters)

stock

16

Stock item & location management (list, get, create, transfer, count, add, remove)

build_order

9

Manufacturing build orders (list, get, create, update, allocate, complete, cancel)

purchase_order

12

Purchase order lifecycle (list, get, create, update, issue, receive, complete)

sales_order

14

Sales order lifecycle (list, get, create, shipments, allocations)

return_order

8

Return order management

company

12

Suppliers, manufacturers, customers, contacts, addresses

barcode

4

Barcode scan, assign, unassign, lookup

label

5

Label template listing and printing

report

3

Report template listing and generation

attachment

5

File attachments on any object (upload, download, delete)

system

8

Health, version, settings, users, groups, currencies

Architecture

  • server.py — FastMCP server with 12 parameterized tools and dual transport (STDIO/SSE)

  • client.py — Async adapter wrapping the official inventree-python library via asyncio.to_thread() with a semaphore for concurrency control

The inventree-python library is synchronous (requests-based). All calls are offloaded to threads to maintain async compatibility with the MCP framework.

License

MIT

Available Tools

12 tools
attachmentA
Destructive

File attachment management for any InvenTree object.

Operations: Read: list, download Write: upload, upload_link Delete: delete

Args: operation: One of the operations listed above. model_type: Object type (part, stockitem, build, purchaseorder, salesorder, company). model_id: Object ID for list/upload/upload_link. attachment_id: Attachment ID for download/delete. file_path: Local file path for upload. link: URL for upload_link. comment: Optional comment for uploads. destination: File path to save downloaded attachment to.

Returns: JSON string with attachment data or {"error": "..."}.

Inputs: operation (required), model_type, model_id, attachment_id, +4 more. Returns: result

barcodeA

Barcode scanning and assignment in InvenTree.

Operations: Read: scan, lookup Write: assign, unassign

Args: operation: One of the operations listed above. barcode_data: Barcode string for scan/assign/lookup. model_type: Model type for assign/unassign (part, stockitem, stocklocation, build, purchaseorder, salesorder, returnorder). pk: Object ID for assign/unassign.

Returns: JSON string with barcode result or {"error": "..."}.

Inputs: operation (required), barcode_data, model_type, pk. Returns: result

build_orderA

Manufacturing build order management in InvenTree.

Operations: Read: list, get, get_outputs, get_lines Write: create, update, allocate, complete, cancel

Args: operation: One of the operations listed above. pk: Build order ID. data: Dict of fields for create/update/complete. items: List of allocation dicts for allocate (e.g. [{"stock_item": 1, "quantity": 5, "build_line": 3}]). search: Text search filter for list. limit: Max results (default 25). offset: Pagination offset.

Returns: JSON string with build order data or {"error": "..."}.

Inputs: operation (required), pk, data, items, +3 more. Returns: result

companyA
Destructive

Supplier, manufacturer, and customer management in InvenTree.

Operations: Read: list, get, list_supplier_parts, get_supplier_part, list_manufacturer_parts, get_manufacturer_part, list_contacts, list_addresses, get_price_breaks Write: create, update Delete: delete

Args: operation: One of the operations listed above. pk: Company, supplier part, or manufacturer part ID. data: Dict of fields for create/update. company_id: Company ID for list_supplier_parts/list_manufacturer_parts/list_contacts/list_addresses. supplier_part_id: Supplier part ID for get_price_breaks. search: Text search filter for list/list_supplier_parts/list_manufacturer_parts. is_supplier/is_manufacturer/is_customer: Boolean filters for list. limit: Max results (default 25). offset: Pagination offset.

Returns: JSON string with company data or {"error": "..."}.

Inputs: operation (required), pk, data, company_id, +7 more. Returns: result

labelA

Label printing and template management in InvenTree.

Operations: list_templates, print_part, print_stock, print_location, download_template

Args: operation: One of the operations listed above. label_type: Filter for list_templates (part, stock, location). template_id: Label template ID for print/download operations. item_ids: List of item IDs to print labels for. destination: File path to save downloaded template to.

Returns: JSON string with label templates or print result.

Inputs: operation (required), label_type, template_id, item_ids, +1 more. Returns: result

partA
Destructive

Part & category management in InvenTree.

Operations: Read: list, get, get_stock, get_bom, get_bom_usage, get_suppliers, get_manufacturers, get_parameters, get_parameter_templates, get_test_templates, get_related, get_builds, get_internal_prices, get_sale_prices, list_categories, get_category, get_category_parameters Write: create, update, create_category Delete: delete

Args: operation: One of the operations listed above. pk: Part or category ID (required for get/update/delete and sub-queries). data: Dict of fields for create/update (e.g. {"name": "Seal Kit", "category": 5}). search: Text search filter for list/list_categories. category: Category ID filter for list. limit: Max results for list (default 25). offset: Pagination offset for list.

Returns: JSON string with part/category data or {"error": "..."}.

Inputs: operation (required), pk, data, search, +3 more. Returns: result

purchase_orderA

Purchase order lifecycle management in InvenTree.

Operations: Read: list, get, get_line_items Write: create, update, issue, receive, complete, cancel, hold, add_line_item, add_extra_line_item

Args: operation: One of the operations listed above. pk: Purchase order ID. data: Dict of fields for create/update/add_line_item. location_id: Receiving location for receive operation. items: Line items to receive (e.g. [{"line_item": 1, "quantity": 10}]). search: Text search filter for list. limit: Max results (default 25). offset: Pagination offset.

Returns: JSON string with PO data or {"error": "..."}.

Inputs: operation (required), pk, data, location_id, +4 more. Returns: result

reportB

Report generation and template management in InvenTree.

Operations: list_templates, print_report, download_template

Args: operation: One of the operations listed above. template_id: Report template ID for print_report/download_template. item_ids: List of item IDs to include in report. model_type: Model type for print_report. destination: File path to save downloaded template to.

Returns: JSON string with report templates or print result.

Inputs: operation (required), template_id, item_ids, model_type, +1 more. Returns: result

return_orderA

Return order lifecycle management in InvenTree.

Operations: Read: list, get, get_line_items Write: create, update, complete, cancel, add_line_item

Args: operation: One of the operations listed above. pk: Return order ID. data: Dict of fields for create/update/add_line_item. search: Text search filter for list. limit: Max results (default 25). offset: Pagination offset.

Returns: JSON string with RO data or {"error": "..."}.

Inputs: operation (required), pk, data, search, +2 more. Returns: result

sales_orderA

Sales order lifecycle management in InvenTree.

Operations: Read: list, get, get_line_items, get_allocations Write: create, update, complete, cancel, hold, add_line_item, add_extra_line_item, create_shipment, complete_shipment

Args: operation: One of the operations listed above. pk: Sales order ID. data: Dict of fields for create/update/add_line_item. shipment_id: Shipment ID for complete_shipment. reference: Reference string for create_shipment. search: Text search filter for list. limit: Max results (default 25). offset: Pagination offset.

Returns: JSON string with SO data or {"error": "..."}.

Inputs: operation (required), pk, data, shipment_id, +4 more. Returns: result

stockA

Stock item & location management in InvenTree.

Operations: Read: list, get, get_by_location, get_by_part, list_locations, get_location, get_tracking, get_test_results Write: create, update, transfer, count, add, remove, create_location, upload_test_result

Args: operation: One of the operations listed above. pk: Stock item or location ID. data: Dict of fields for create/update. part_id: Filter stock by part (for list, get_by_part). location_id: Filter stock by location or transfer destination. quantity: Quantity for transfer/count/add/remove operations. test_name: Name for upload_test_result. test_result: Boolean pass/fail for upload_test_result. search: Text search filter for list/list_locations. limit: Max results (default 25). offset: Pagination offset.

Returns: JSON string with stock/location data or {"error": "..."}.

Inputs: operation (required), pk, data, part_id, +7 more. Returns: result

systemA
Read-onlyIdempotent

InvenTree system administration and health checks.

Operations: health, version, settings, list_users, get_user, list_groups, list_owners, get_project_codes, list_currencies

All operations are read-only.

Args: operation: One of the operations listed above. pk: User ID for get_user.

Returns: JSON string with system data.

Inputs: operation (required), pk. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool addresses a distinct domain (e.g., attachment, barcode, build_order), with no overlap in purpose. The operations within each tool are specific to that domain, making it clear which tool to use for a given task.

    Naming Consistency5/5

    All tool names are lowercase snake_case single words or compound words (e.g., build_order, purchase_order), following a consistent pattern. Operation names within tools are also uniform and descriptive.

    Tool Count5/5

    12 tools is well-scoped for an inventory management system, covering all major entities (parts, stock, orders, etc.) without unnecessary granularity or missing core areas.

    Completeness5/5

    The tool set provides full lifecycle management for parts, stock, all order types (build, purchase, sales, return), companies, attachments, barcodes, labels, reports, and system administration. No obvious gaps in core functionality.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to manage Snipe-IT inventory systems through comprehensive asset and consumable operations. Supports creating, updating, tracking, and managing IT assets, consumables, maintenance records, file attachments, and generating labels.
      1
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to perform full CRUD operations on Snipe-IT inventory systems, managing assets, users, licenses, and more via 39 tools.
      40
      38
      MIT