Connect MRPeasy to ChatGPT: Manage Manufacturing and Inventory
A complete architectural guide to building a secure MRPeasy ChatGPT integration using auto-generated MCP tools. Learn how to expose manufacturing APIs to LLMs.
If you want to connect MRPeasy to ChatGPT to automate bills of materials, manage manufacturing orders, and query real-time inventory, you need a Model Context Protocol (MCP) server. If your team uses Claude, check out our guide on connecting MRPeasy to Claude or explore our broader architectural overview on connecting MRPeasy to AI Agents.
Giving a Large Language Model (LLM) read and write access to a complex manufacturing execution system (MES) and MRP platform is a massive engineering hurdle. You either spend weeks building, hosting, and securing a custom integration layer to translate LLM JSON arguments into MRPeasy's API constraints, or you use a managed infrastructure layer.
This guide breaks down exactly how to use Truto to generate a secure, authenticated MCP server for MRPeasy, connect it natively to ChatGPT, and execute manufacturing workflows using natural language.
The Engineering Reality of the MRPeasy API
Building an MCP server is fundamentally an API translation exercise. While the MCP standard gives models a predictable way to discover and call JSON-RPC tools, implementing it against MRPeasy's specific architecture requires handling several highly specific quirks.
If you build a custom MCP server, you own this entire abstraction layer. Here are the MRPeasy-specific challenges that break standard CRUD assumptions for AI agents:
Asymmetric Return Types on Create Operations
When you create a standard resource in most modern REST APIs, the server responds with a 201 Created and the full JSON representation of the new object. MRPeasy behaves differently. When you call POST to create a Bill of Materials (BOM), Customer, or Item, the API returns the new record's database ID as a bare integer in the response body - not a JSON object, and not the full record.
For an LLM, this is disorienting. If ChatGPT creates a customer order and gets back 9432 instead of an order object, it cannot confirm the final system-generated status or the assigned reference code. Your MCP tool definitions must explicitly instruct the LLM to execute a follow-up GET request using that integer ID to retrieve the complete state.
Strict One-Month Limits on Reporting Endpoints
MRPeasy exposes powerful reporting endpoints - such as list_all_mr_peasy_crm_shippeds (goods shipped) and list_all_mr_peasy_production_orders (production orders for a period). However, these reporting endpoints enforce a strict timeframe limitation: the requested period defaults to the current month and cannot exceed one month.
If a user prompts ChatGPT with "Show me all production orders from Q1," a naive LLM will try to pass a 90-day date range and fail. Your tool schema descriptions must embed explicit instructions forcing the LLM to chunk multi-month queries into sequential 30-day API calls and aggregate the data in memory.
Dynamic Query Parameter Keys for Location Filtering
Filtering stock items by default location in MRPeasy does not use a standard query format like ?site_id=1. Instead, the API requires dynamically named query parameters structured as def_location_{site_id} (e.g., def_location_1=true). LLMs struggle with dynamically mutating keys in tool schemas. The MCP server layer needs to normalize this into a predictable schema (like accepting a site_id parameter) and mutate the outbound request to match MRPeasy's expected format on the fly.
Handling 202 Accepted and Validation Rejections
MRPeasy update endpoints return a 202 Accepted with no content on success, rather than returning the updated object. Delete operations return a 204 No Content. However, MRPeasy strictly enforces relational integrity. If an LLM attempts to delete a customer who has existing customer orders, the API will fail with a rejection error. The MCP server must gracefully pass this failure back to the LLM so it can attempt remediation (like cancelling the orders first) rather than simply crashing the JSON-RPC connection.
sequenceDiagram
participant LLM as ChatGPT
participant Truto as Truto MCP Server
participant Upstream as "MRPeasy API"
LLM->>Truto: Call create_a_mr_peasy_customer_order
Truto->>Upstream: POST /customer-orders
Upstream-->>Truto: 201 Created (4921)
Truto-->>LLM: Success, ID: 4921
Note over LLM,Truto: LLM realizes it needs the order code
LLM->>Truto: Call get_single_mr_peasy_customer_order_by_id (4921)
Truto->>Upstream: GET /customer-orders/4921
Upstream-->>Truto: Full Order Object (Code: ORD-881)
Truto-->>LLM: Full Order ObjectHow to Connect MRPeasy to ChatGPT via MCP
Rather than building and hosting this proxy layer yourself, you can use Truto to auto-generate a secure MRPeasy MCP server. Truto dynamically derives the tool definitions directly from the API's documentation and schemas, wrapping them in a standard JSON-RPC 2.0 endpoint.
Here is how to deploy it.
Step 1: Connect MRPeasy to Truto
Before generating tools, you must establish an authenticated connection. In the Truto dashboard, navigate to Integrated Accounts -> New Integrated Account, select MRPeasy, and input the required API credentials. Truto securely manages the credential lifecycle, meaning your LLM never handles raw API keys.
Once connected, note the integrated_account_id. This ID isolates the subsequent MCP server to this specific MRPeasy tenant.
Step 2: Create the MCP Server
Truto allows you to generate an MCP server URL through the dashboard UI or programmatically via the API. Both methods output a secure URL containing a cryptographically hashed token that authenticates the JSON-RPC requests.
Method A: Via the Truto UI
- Navigate to the integrated account page for your MRPeasy connection.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Select your desired configuration (e.g., restrict methods to
read, filter by specific tags). - Copy the generated MCP server URL (it will look like
https://api.truto.one/mcp/<token>).
Method B: Via the Truto API If you are automating infrastructure for your end-users, you can provision the server dynamically using a POST request.
curl -X POST https://api.truto.one/integrated-account/<INTEGRATED_ACCOUNT_ID>/mcp \
-H "Authorization: Bearer $TRUTO_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "ChatGPT MRPeasy Manufacturing Server",
"config": {
"methods": ["read", "write", "custom"],
"tags": ["inventory", "manufacturing", "orders"]
}
}'The response contains the exact same secure url you would get from the UI.
Step 3: Connect the Server to ChatGPT
You must now register the Truto URL with your LLM client. We will show the process for the ChatGPT UI, as well as the standard config file approach used by desktop clients (like Claude Desktop) and custom agents.
Method A: Via the ChatGPT UI
- Open ChatGPT and click Settings -> Apps -> Advanced settings.
- Ensure Developer mode is enabled (Note: MCP support requires a Plus, Pro, Business, Enterprise, or Education account).
- Under MCP servers / Custom connectors, click Add new server.
- Name the server (e.g., "MRPeasy Production").
- Paste the Truto MCP URL into the Server URL field and click Add.
ChatGPT will immediately handshake with Truto, pull the schema definitions, and list the available MRPeasy tools.
Method B: Via Manual Config File (SSE Transport) If you are testing locally or wiring up an alternative agent framework that uses configuration files, you configure the connection using standard Server-Sent Events (SSE).
{
"mcpServers": {
"mrpeasy_production": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/<YOUR_SECURE_TOKEN>"
]
}
}
}MRPeasy Hero Tools for ChatGPT
By default, Truto exposes dozens of endpoints across the MRPeasy integration. When configuring your MCP server, you should restrict access to high-leverage operations. Here are six essential hero tools for manufacturing and inventory management.
1. list_all_mr_peasy_inventory_sums
Returns the total aggregate inventory quantity and financial cost across the entire MRPeasy stock, including Work In Progress (WIP) values. This is critical for executive dashboards and high-level financial check-ins.
Contextual note: This tool does not return line-item details. It provides a macro-level snapshot (quantity, cost, wip_quantity, wip_cost).
"What is the total financial value of our current on-hand inventory, and how much capital is tied up in WIP right now?"
2. get_single_mr_peasy_stock_inventory_by_id
Fetches the exact on-hand quantity and total cost of a specific stock item.
Contextual note: The id required here is the stock item's article_id. If ChatGPT only knows the product name, it must first call list_all_mr_peasy_items to map the name to the article_id.
"Check the current inventory levels for our 'Titanium Bracket (SKU-882)'. Do we have enough on hand to fulfill a 500-unit order?"
3. list_all_mr_peasy_manufacturing_orders
Retrieves the current list of manufacturing orders (MOs) in the system, returning critical data like article_id, quantity, unit, and order status.
Contextual note: This is a read-only view of active production. It is highly useful for cross-referencing against customer orders to see if an MO has been generated to meet demand.
"Pull up all active manufacturing orders for the next week. Are there any orders assigned to the milling machine that are currently behind schedule?"
4. create_a_mr_peasy_customer_order
Generates a new customer order. This is a highly consequential write operation.
Contextual note: A status of Confirmed (30) or higher automatically books available stock. Updating to Shipped (70) or Delivered (80) will automatically trigger shipment creation within MRPeasy. Remember that this tool returns a bare integer ID.
"Create a confirmed customer order for Acme Corp for 200 units of the standard widget. Once created, fetch the order details and tell me the assigned reference code."
5. list_all_mr_peasy_production_operations
Lists the manufacturing operations planned for a specified period, filtered by the planned finish date.
Contextual note: As mentioned in the API quirks, this report defaults to the current month and cannot exceed a one-month window. The LLM must supply exact date boundaries within a 30-day span.
"What production operations are scheduled to finish between November 1st and November 30th? Summarize the load by routing code."
6. create_a_mr_peasy_bom
Builds a new Bill of Materials in MRPeasy. This requires passing a structured JSON payload defining the product_id, title, and the array of components required for assembly.
Contextual note: Like customer orders, creating a BOM returns a bare integer ID. The LLM will need to query get_single_mr_peasy_bom_by_id to verify the routing details.
"Draft a new BOM for the 'Pro Assembly Unit'. It requires 1 chassis, 4 mounting screws, and 2 logic boards. Create it in MRPeasy and confirm the routing details."
To view the complete list of available operations, schemas, and required parameters, visit the MRPeasy integration page.
Workflows in Action
Providing an LLM with these tools fundamentally changes how teams interact with MRP data. Instead of navigating through multiple dashboard screens, users can execute complex workflows via natural language. Here are two examples.
Scenario 1: Sales Checking Stock and Booking an Order
A sales representative is on a call with a client and needs to immediately verify inventory and book a confirmed order.
"Check if we have at least 150 units of the 'Industrial Bearing' in stock. If we do, create a confirmed customer order for 'Globex Corp' for 150 units. Fetch the final order reference number and tell me so I can give it to the client."
Execution Steps:
list_all_mr_peasy_items: ChatGPT searches for "Industrial Bearing" to locate thearticle_id.get_single_mr_peasy_stock_inventory_by_id: ChatGPT queries the specificarticle_idto verify the on-hand quantity exceeds 150.list_all_mr_peasy_customers: ChatGPT searches for "Globex Corp" to find thecustomer_id.create_a_mr_peasy_customer_order: ChatGPT submits the payload with status 30 (Confirmed), booking the stock. MRPeasy returns an integer (e.g.,8832).get_single_mr_peasy_customer_order_by_id: ChatGPT queries ID8832to retrieve the full object and extracts thecode.- Response: ChatGPT outputs the confirmation and the reference code (e.g., "Order ORD-109 has been booked successfully.")
Scenario 2: Production Manager Auditing Manufacturing Load
A production manager wants a quick status check on shop floor operations for the current month.
"Pull the production operations report for this month. Group the scheduled operations by work station type and tell me which station has the highest volume of planned operations."
Execution Steps:
list_all_mr_peasy_production_operations: ChatGPT queries the operations report, adhering to the one-month constraint.- In-memory Processing: ChatGPT parses the JSON array, examining the routing and operational parameters.
list_all_mr_peasy_work_center_types: If necessary, ChatGPT queries the work center types to cross-reference codes with human-readable titles.- Response: ChatGPT generates a concise textual report summarizing the operational load across the manufacturing floor.
Security and Access Control
Connecting an LLM directly to a core manufacturing system requires strict guardrails. You do not want a prompt injection attack deleting your Bills of Materials. Truto provides several security controls baked into the MCP server configuration:
- Method Filtering: You can restrict a server to safe operations. Setting
methods: ["read"]completely blocks the LLM from executingcreate,update, ordeletetools, rendering the connection strictly read-only. - Tag Filtering: Limit the LLM's scope to specific domains. By applying
tags: ["inventory", "reports"], you expose stock checks while hiding customer billing and HR components of the MRPeasy API. - Require API Token Auth: By setting
require_api_token_auth: true, possession of the MCP URL is no longer sufficient. The caller must also pass a valid Truto API session token, ensuring only authenticated users can trigger the tools. - Time-to-Live (TTL): You can set an
expires_attimestamp. Once the datetime passes, Truto's cleanup alarms automatically tear down the server and revoke the URL, which is ideal for temporary contractor access or limited-duration AI agents.
A Note on Rate Limits and Upstream Errors
It is critical to understand how API limits are handled in this architecture. Truto does not retry, throttle, or apply backoff on rate limit errors.
When the MRPeasy API returns an HTTP 429 Too Many Requests error, Truto passes that error directly back to the caller (the LLM or your agent framework). However, Truto does normalize the upstream rate limit information into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset).
The caller is entirely responsible for detecting these 429 responses, parsing the reset headers, and applying the appropriate retry and backoff logic. Do not assume the infrastructure will automatically absorb these errors during high-volume AI scraping runs.
Re-Engineering Manufacturing Software for AI
Connecting ChatGPT to MRPeasy is not just about making API calls; it is about making legacy manufacturing data fully conversational. By relying on dynamically generated, documentation-driven MCP tools, you ensure your AI agents always have an accurate, validated mapping of your MRP data.
Instead of wasting engineering cycles manually maintaining proxy routes, handling pagination edge cases, and hardcoding authentication flows, you can deploy a secure, compliant MCP server in a single API call.
If you are building LLM features that require deep, read/write access to third-party manufacturing systems, you need infrastructure designed for the task.
FAQ
- How do I securely connect MRPeasy to ChatGPT?
- You can connect MRPeasy to ChatGPT using a Model Context Protocol (MCP) server. Truto generates a secure, hosted MCP server URL that maps MRPeasy's API endpoints to AI-ready tools. You then paste this URL into ChatGPT's developer connector settings.
- Can ChatGPT create MRPeasy bills of materials (BOMs)?
- Yes. By exposing the 'create_a_mr_peasy_bom' and 'get_single_mr_peasy_bom_by_id' tools via an MCP server, ChatGPT can generate BOMs based on natural language prompts and retrieve the created record for verification.
- How does Truto handle MRPeasy API rate limits?
- Truto does not retry, throttle, or apply backoff on rate limit errors. If MRPeasy returns an HTTP 429, Truto passes that error directly to the caller (the AI agent or client), normalizing the headers to standard IETF format (ratelimit-limit, ratelimit-remaining, ratelimit-reset).
- What happens if an LLM asks for MRPeasy reports spanning multiple months?
- The MRPeasy API explicitly limits reporting endpoints (like production orders or goods shipped) to a maximum period of one month. The LLM must be instructed to chunk requests month-by-month if analyzing longer timeframes.