Skip to main content

InvenTreeMCP

PyPI CI codecov

An MCP (Model Context Protocol) server for InvenTree, exposed as an InvenTree plugin. It lets MCP clients (Claude, other MCP-aware agents) query InvenTree inventory data over a Streamable HTTP endpoint.

Design

Every tool is a thin wrapper around InvenTree's own REST API view classes (see inventree_mcp/proxy.py), dispatched as the authenticated caller - MCP requests go through exactly the same permission checks, filtering, and serialization as the regular REST API. Tool code never queries the Django ORM directly.

Currently read-only, covering parts, stock items/locations, part categories, purchase/sales/return/ build orders (with line items and allocations), companies, contacts, addresses, manufacturer/ supplier parts, BOM items, attachments, parameters, stock tracking history, test results, and project codes. Once write tools land, the MCP_READ_ONLY setting (see Configuration) will block them by default regardless of the calling user's permissions.

Each tool's outputSchema and filter/ordering options are derived live from InvenTree's own serializers and views (not hand-maintained), so they can't drift as InvenTree evolves. Call describe_filters(resource) to see what's available for a given resource. The set of tools an MCP client sees is also filtered to what the calling user can actually use - though every call is still permission-checked in full regardless of what was advertised.

Setup

1. Install the plugin

Install via the InvenTree plugin manager, or via pip:

pip install inventree-mcp

Then enable the plugin under Admin > Plugins, and configure its settings (see Configuration below).

2. Create a token for your MCP client

Create an InvenTree API token for your MCP client.

3. Configure your MCP client

The endpoint is <your-inventree-server>/plugin/inventree-mcp/mcp/, using Streamable HTTP transport with an Authorization: Token <token> header.

For a client that supports remote Streamable HTTP servers directly, add:

{
  "mcpServers": {
    "inventree": {
      "url": "https://<your-inventree-server>/plugin/inventree-mcp/mcp/",
      "headers": {
        "Authorization": "Token <your-api-token>"
      }
    }
  }
}

For a client that only supports local (stdio) servers, bridge it with mcp-remote

Note: You will need to have node available on your system path

{
  "mcpServers": {
    "inventree": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://<your-inventree-server>/plugin/inventree-mcp/mcp/",
        "--header",
        "Authorization: Token <your-api-token>"
      ]
    }
  }
}

Note: On Windows, you may need to substitute npx with C:\\PROGRA~1\\nodejs\\npx.cmd in the command field.

In a setup where the server is running a self-signed certificate, you may need to use the following env arguments to disable certificate verification:

"args": [
  ...
],
"env": {
  "NODE_TLS_REJECT_UNAUTHORIZED": "0"
}

Configuration

Under Settings > Plugin Settings:

  • Require Authentication (REQUIRE_AUTH, default True): reject unauthenticated requests. Only disable for local testing.
  • Read Only (MCP_READ_ONLY, default True): block all write actions via MCP, regardless of the calling user's permissions. A plugin-wide kill switch, independent of per-user roles.

Authentication

Access follows the calling user's normal InvenTree role assignments. Supported auth methods:

  • An InvenTree API token: Authorization: Token <token>.
  • Basic auth (username/password).
  • An OAuth2 bearer token: Authorization: Bearer <token>. A scoped token (e.g. r:view:part) narrows access below the underlying user's roles - useful for issuing an agent a tightly-scoped token without creating a separate low-privilege user.

Session/cookie auth is not supported (not meaningful for a machine client).

Metadata

Release files for inventree-mcp 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inventree-mcp 0.4.1
File Size Uploaded Provenance Actions
inventree_mcp-0.4.1.tar.gz 82.1 kB With provenance Details for inventree_mcp-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for inventree-mcp 0.4.1
File Interpreter ABI Platform Actions
inventree_mcp-0.4.1-py3-none-any.whl Python 3 none any Details for inventree_mcp-0.4.1-py3-none-any.whl

Total release size: 191.0 kB

Release files / inventree_mcp-0.4.1.tar.gz

Download URL inventree_mcp-0.4.1.tar.gz
Size 82.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f2a72e6b402eb55e0360e48df2e4af261597f02a3bd10edd9204a4a50826d4dc
BLAKE2b-256 checksum
How to use checksums
06b6f7eef4c3ea338a0f83f3032d6e9e63d0d49d5842a0e770895940cd07bf5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / inventree_mcp-0.4.1-py3-none-any.whl

Download URL inventree_mcp-0.4.1-py3-none-any.whl
Size 108.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30780b9bb06c00545e8c83400ca270ca403e1b7c6a4dbd1cab9a7d760a6527b4
BLAKE2b-256 checksum
How to use checksums
64e046e3052a2854ebce104444af96ece9a169e1f62d26e65ab9f36dce3e842e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for inventree-mcp 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for inventree_mcp-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page