InvenTreeMCP
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:
{
"mcpServers": {
"inventree": {
"command": "npx",
"args": [
"mcp-remote",
"https://<your-inventree-server>/plugin/inventree-mcp/mcp/",
"--header",
"Authorization: Token <your-api-token>"
]
}
}
}
Configuration
Under Settings > Plugin Settings:
- Require Authentication (
REQUIRE_AUTH, defaultTrue): reject unauthenticated requests. Only disable for local testing. - Read Only (
MCP_READ_ONLY, defaultTrue): 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).
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 inventree_mcp-0.1.0.tar.gz.
File metadata
- Download URL: inventree_mcp-0.1.0.tar.gz
- Upload date:
- Size: 65.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8aec5025ea0ee3716c9efcd4881d2415133e759ed772ce3d43df4ebdaa81e83c
|
|
| MD5 |
dad2c96eba83e85b7beefdececc469db
|
|
| BLAKE2b-256 |
f0917de77fb01d3878e7f6964ca2002096eebc64e6c72abbc26c0ec1bfdae118
|
File details
Details for the file inventree_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: inventree_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 89.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a97ecd480b6ce948c7e829d2280d7eb02873a6c2ad4286ef0facde5c54deac52
|
|
| MD5 |
97467d02f82c2db3bbaf249edf97bbdb
|
|
| BLAKE2b-256 |
bc92ec7be56546426baa935fff95c3576137c4ca5196a109b89085978f5b491e
|