Connect MRPeasy to Claude: Automate Sales Orders and Shipments
Learn how to build and configure a managed MCP server to connect MRPeasy to Claude. Automate sales orders, inventory tracking, and shipments using AI agents.
If your team needs to connect MRPeasy to Claude to automate sales order intake, optimize production planning, or track supply chain shipments, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's function-calling capabilities and MRPeasy's REST APIs. You can either build and maintain this integration layer yourself, or use a managed infrastructure platform like Truto to dynamically generate a secure, authenticated MCP server URL. If your team uses ChatGPT, check out our guide on /connect-mrpeasy-to-chatgpt-manage-manufacturing-and-inventory/ or explore our broader architectural overview on /connect-mrpeasy-to-ai-agents-streamline-procurement-and-operations/.
Giving a Large Language Model (LLM) read and write access to a manufacturing execution system (MES) and ERP like MRPeasy is an engineering challenge. You have to map highly relational data structures—Bills of Materials (BOMs), Work Centers, Routing, and Inventory ledgers—into flat MCP tool schemas. Every time MRPeasy deprecates an endpoint or changes an attribute requirement, you have to update your server code, redeploy, and validate the agent's behavior.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for MRPeasy, connect it natively to Claude Desktop, and execute complex production and supply chain workflows using natural language.
The Engineering Reality of the MRPeasy API
A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools over JSON-RPC 2.0, the reality of implementing it against complex manufacturing APIs is painful. MRPeasy's data model tightly couples sales, inventory, and production. Actions taken on one resource frequently trigger side-effects across the system.
If you decide to build a custom MRPeasy MCP server from scratch, you own the entire API lifecycle. Here are the specific challenges you will face when mapping this API to LLM tools:
Asymmetric Read/Write Responses
In a standard RESTful API, a POST request to create a resource typically returns the fully hydrated object. MRPeasy behaves differently. When you execute create_a_mr_peasy_customer_order or create_a_mr_peasy_bom, the API returns the new record's database ID as a bare integer, not a JSON object representing the full record. An LLM expects to use the data it just created in subsequent steps (like reading the generated order code). You must design your integration logic so the LLM understands it must capture that bare integer and immediately pass it to get_single_mr_peasy_customer_order_by_id to get the actual data.
Implicit Status Side-Effects and State Machines
MRPeasy uses status codes to drive severe backend side-effects. For example, when creating or updating a customer order, passing a Status of 30 (Confirmed) automatically books available inventory stock. Passing a Status of 70 (Shipped) or 80 (Delivered) automatically generates a corresponding shipment record in the backend. An LLM has no inherent context about these state transitions. Your MCP tools must provide meticulously defined schemas and descriptions that explicitly warn the model about the downstream consequences of modifying these integer status codes.
Complex Filtering Syntax
Filtering in MRPeasy often relies on dynamic query parameter keys rather than standard key-value pairs. For instance, when querying stock items, per-site default-location filters use a concatenated query name like def_location_1 (where 1 is the site ID). Hardcoding this into an OpenAPI spec or static tool definition is rigid; your MCP server must be capable of dynamically mapping these schema quirks so the agent can construct valid queries.
Factual note on rate limits: Truto does not retry, throttle, or apply backoff on rate limit errors. When the MRPeasy API returns an HTTP 429, Truto passes that error directly to the caller. Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF spec. The caller (the LLM framework or custom agent loop) is responsible for intercepting these headers and managing retry/backoff logic. Do not assume the MCP server absorbs rate limits for you.
Building the MRPeasy MCP Server
Instead of writing and maintaining a custom Express or FastAPI server to handle MRPeasy's API quirks, you can use Truto to dynamically generate an MCP server. This server is scoped to a specific MRPeasy account and translates MRPeasy's endpoints into LLM-ready tools based on existing API documentation.
You can generate this server via the Truto UI for manual agent setups, or programmatically via the API for multi-tenant SaaS applications.
Method 1: Generating via the Truto UI
If you are setting up Claude Desktop for an internal team, the UI is the fastest path.
- Log into your Truto dashboard and connect an MRPeasy account.
- Navigate to the Integrated Account page for that specific connection.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Select the configuration you need (e.g., allow
readandwritemethods, filter by specific tags). - Copy the generated MCP server URL (e.g.,
https://api.truto.one/mcp/abc123def456).
Method 2: Generating via the API
If you are embedding AI agent capabilities into your own product, you must generate MCP servers programmatically on behalf of your users.
Make an authenticated POST request to the /integrated-account/:id/mcp endpoint:
curl -X POST https://api.truto.one/integrated-account/{integrated_account_id}/mcp \
-H "Authorization: Bearer YOUR_TRUTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "MRPeasy Supply Chain Agent",
"config": {
"methods": ["read", "write"],
"tags": ["sales", "inventory"]
}
}'The API provisions the underlying infrastructure, verifies that the requested configuration contains valid tools, and returns a secure, authenticated URL that you can pass to the client's AI framework.
Connecting the MCP Server to Claude
Once you have the Truto MCP URL, you must register it with Claude so the model can discover and execute the MRPeasy tools.
Approach A: Connecting via the Claude UI
For enterprise users leveraging Claude Desktop, ChatGPT, or similar managed client interfaces:
For Claude Desktop/Web:
- Open Claude and navigate to Settings -> Integrations.
- Click Add MCP Server (or Custom Connector).
- Name the connector (e.g., "MRPeasy Operations").
- Paste the Truto MCP URL generated in the previous step.
- Click Add. Claude will perform a handshake, discover the tools, and make them available in your current workspace.
(Note: If your team uses ChatGPT, the process is similar: go to Settings -> Apps -> Advanced settings, enable Developer mode, and add the server URL under Custom Connectors).
Approach B: Connecting via Config File
If you are configuring Claude Desktop locally or injecting the MCP server into a headless agent framework, you can define the connection in your claude_desktop_config.json file.
Because Truto exposes the MCP protocol over Server-Sent Events (SSE) via HTTP POST, you use the standard @modelcontextprotocol/server-sse transport adapter.
{
"mcpServers": {
"mrpeasy_agent": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"--url",
"https://api.truto.one/mcp/YOUR_TRUTO_TOKEN"
]
}
}
}Restart Claude Desktop. The client will establish the SSE connection and load the MRPeasy tool schemas.
Hero Tools for MRPeasy
Exposing an entire ERP to an LLM at once risks overwhelming the model's context window with irrelevant endpoints. The best practice is to curate a focused set of tools based on the specific persona the agent is serving.
Here are the highest-leverage "hero tools" for automating MRPeasy sales and supply chain workflows.
create_a_mr_peasy_customer_order
Creates a new customer order in the system.
Usage Note: The LLM must be explicitly prompted that updating the status to 30 (Confirmed) will immediately book available stock against this order. Furthermore, this tool returns only a bare integer (the internal database ID), so the agent must capture that ID and immediately call the get tool if it needs to read the generated order code.
"A client just emailed approving quote Q-102. Create a customer order for customer ID 455 containing 200 units of product PROD-99. Set the status to 30 to book the stock immediately, and retrieve the newly generated order code."
get_single_mr_peasy_customer_order_by_id
Retrieves the fully hydrated JSON object for a specific customer order.
Usage Note: This is the mandatory follow-up tool to order creation. It returns over 30 fields, including code, reference, shipping_address, and the current fulfillment status.
"Fetch the full details for customer order ID 8901 and summarize the shipping address and the total price in USD."
list_all_mr_peasy_stock_inventories
Returns a comprehensive list of stock items, their current on-hand quantities, and total costs.
Usage Note: This is the primary tool for supply chain agents answering inventory questions. It handles per-site filtering dynamically (e.g., using def_location_1).
"Pull the current stock inventory levels for all items in group code 'RAW-MAT'. Alert me if the on-hand quantity for any item is below 50 units."
list_all_mr_peasy_manufacturing_orders
Retrieves active production runs, known in MRPeasy as manufacturing orders.
Usage Note: Useful for cross-referencing sales demand against current factory output. Returns quantities, expected unit details, and production statuses.
"List all active manufacturing orders for product code 'EB-250'. When are they scheduled to finish, and what is the total quantity currently in production?"
create_a_mr_peasy_bom
Creates a Bill of Materials linking a product to its required component inventory.
Usage Note: Like customer orders, this returns a bare integer ID. It requires a product_id, a title, and an array of components.
"We have a new revision for the Standard Widget. Create a BOM titled 'Widget Rev B' for product ID 102. It requires 2 units of component 55 and 1 unit of component 88."
list_all_mr_peasy_shipments
Fetches current shipment logistics, tying outbound freight to specific customer orders.
Usage Note: Returns delivery dates, status text, and the parent customer order ID. Essential for customer support agents handling "Where is my order?" inquiries.
"Check the shipment status for customer order ID 9920. Has it left the facility, and what is the estimated delivery date?"
For the complete inventory of available MRPeasy tools and their exact JSON schemas, view the MRPeasy integration page.
Workflows in Action
MCP tools transform Claude from a static reasoning engine into an active participant in your supply chain operations. Here are two real-world sequences showing how an AI agent strings these tools together to execute complex MRPeasy tasks.
Scenario 1: Automated Order Intake and Stock Booking
A sales representative forwards an email to the AI agent confirming a large B2B purchase. The agent must parse the intent, create the order, book the inventory, and report back the internal tracking code.
"Acme Corp confirmed they want to proceed with purchasing 50 units of the Industrial Fan (Product ID 84). Create the customer order for Acme (Customer ID 12). Set the order status to Confirmed so the inventory is booked, and tell me the official MRPeasy order code."
Execution Steps:
- Claude calls
create_a_mr_peasy_customer_orderwithcustomer_id: 12, the product array, andstatus: 30. MRPeasy returns a bare integer:10502. - Claude captures the integer and immediately calls
get_single_mr_peasy_customer_order_by_idwithid: 10502. - MRPeasy returns the full JSON object. Claude parses the
codefield (e.g., "ORD-0094"). - Claude generates a natural language response confirming that ORD-0094 has been created and that the stock has been automatically reserved.
sequenceDiagram
participant User as User
participant Claude as Claude Desktop
participant Truto as Truto MCP Server
participant MRPeasy as MRPeasy API
User->>Claude: "Create order for Acme Corp..."
Claude->>Truto: Call create_a_mr_peasy_customer_order (status: 30)
Truto->>MRPeasy: POST /customer-orders
MRPeasy-->>Truto: 201 Created (10502)
Truto-->>Claude: Result: 10502
Claude->>Truto: Call get_single_mr_peasy_customer_order_by_id (10502)
Truto->>MRPeasy: GET /customer-orders/10502
MRPeasy-->>Truto: { "code": "ORD-0094", "status": 30 ... }
Truto-->>Claude: Order Details JSON
Claude-->>User: "Order ORD-0094 created and stock booked."Scenario 2: Manufacturing Bottleneck Analysis
A production manager needs to know if they can accommodate an emergency rush order based on current stock levels and active manufacturing runs.
"We need to fulfill an emergency order for 200 units of Product ID 42. Check our current stock inventory levels for that product. If we are short, check the active manufacturing orders to see if a batch is already in production to cover the difference."
Execution Steps:
- Claude calls
list_all_mr_peasy_stock_inventoriesfiltering for Product ID 42. - The result shows an on-hand
quantityof 50 units (a shortfall of 150). - Claude dynamically decides to call
list_all_mr_peasy_manufacturing_ordersfiltering forproduct_id: 42. - The result shows an active run (status: Work in Progress) for 200 units finishing tomorrow.
- Claude formulates a response: "You currently have 50 units in stock. You are short 150 units for the rush order, but there is an active manufacturing order for 200 units scheduled to complete tomorrow, which will cover the demand."
Security and Access Control
When granting an LLM access to your core manufacturing and ERP systems, strict access boundaries are non-negotiable. Truto's MCP architecture provides multiple layers of control at the token level:
- Method Filtering: Enforce strict CRUD limits. You can configure an MCP server with
config: { methods: ["read"] }to ensure the AI agent can only query inventory levels (list,get) and is mathematically prevented from executingcreate,update, ordeletetools. - Tag Filtering: Group tools by domain. By applying tag filters at server creation, you can generate a "Sales-Only" server that exposes customer orders and invoices, while hiding sensitive manufacturing operations and Bills of Materials.
- Require API Token Auth: By setting
require_api_token_auth: true, the MCP server URL alone is no longer enough to execute tools. The client must also inject a valid Truto API token in theAuthorizationheader, preventing anonymous access if the server URL leaks into logs or chat histories. - Expiration Controls: Assign an
expires_atISO datetime when generating the server. Once the timestamp passes, the underlying token is automatically purged from the infrastructure, ensuring contractor agents or temporary automations do not retain perpetual backdoor access to MRPeasy.
Wrapping Up
Connecting Claude to MRPeasy transforms natural language into actionable supply chain operations. By leveraging a managed MCP server, you bypass the complexity of MRPeasy's integer-based creation responses, status-driven side-effects, and rigid pagination structures.
Instead of writing and maintaining hundreds of lines of integration glue code, your engineering team can generate highly-scoped, secure toolset URLs in seconds. This allows you to focus on writing better agentic prompts and optimizing your production workflows, rather than fighting with API infrastructure.
Ready to put AI to work in your manufacturing pipelines?
FAQ
- How do I create an MCP server for MRPeasy?
- You can generate an MCP server dynamically via the Truto UI by navigating to your Integrated Account and selecting the MCP Servers tab, or programmatically by sending a POST request to the /integrated-account/:id/mcp endpoint.
- Does Truto automatically handle MRPeasy API rate limits?
- No. Truto passes HTTP 429 rate limit errors directly to the caller and normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The caller or LLM client is responsible for implementing retry and backoff logic.
- How do I configure Claude Desktop to use the MRPeasy MCP server?
- You can add the MCP server URL directly in the Claude Desktop UI under Settings -> Integrations -> Add MCP Server, or define it in your claude_desktop_config.json file using the @modelcontextprotocol/server-sse command.
- Why does the MRPeasy create order tool return only an integer ID?
- The MRPeasy API architecture returns the new record's database ID as a bare integer (not the full record object) upon creation. The AI agent must use this ID to make a subsequent 'get' call to retrieve the full object details.