Load Planner MCP
load-planner-mcp
Ein deterministischer Ladungsplanungs-Solver, plus ein MCP-stdio-Server, der ihn als zwei Werkzeuge bereitstellt. Der Solver entscheidet den Frachtmodus für eine Kohorte von Aufträgen – reine Luftfracht, konsolidierte See-LCL oder voller Container –, bepreist jede Option und fügt eine Risikoeinschätzung hinzu (ETA-Perzentile, Wahrscheinlichkeit der Fristverfehlung, CVaR des Verzögerungsendes).
Was ist hier enthalten
Pfad | Inhalt |
| 3D-Bin-Packing (py3dbp): Passen die Paletten in einen 20GP/40GP/40HC, und mit welchem Füllgrad |
| Fixkosten-MILP über OR-Tools CP-SAT: günstigste zulässige Zuordnung pro aufgezähltem Modusmuster |
| Faltung der Verzögerungsverteilung: p50/p90-ETA, Fristverfehlungswahrscheinlichkeit, CVaR(alpha) |
| Zählt die Karten auf, bewertet sie auf einem identischen Vektor, ordnet sie und wählt eine Empfehlung |
| Eine einfache stdin/stdout-JSON-Grenze, für Hosts, die einen Kindprozess einem Import vorziehen |
| Der MCP-stdio-Server: JSON-RPC 2.0, zwei Werkzeuge und |
| Eine synthetische 20-Paletten-Kohorte mit einer synthetischen Tarifkarte, verwendet von den Tests |
Die beiden Teilprobleme sind geschichtet statt zusammengeführt. Das Lösen echter 3D-Platzierung innerhalb des MILP explodiert kombinatorisch, daher läuft der Packer zuerst und übergibt CP-SAT einen Füllgrad und ein Machbarkeitsflag.
Related MCP server: freight-pulse
Der Zwei-Werkzeuge-Vertrag
solve(problem) führt den Solver aus und gibt seine Ausgabe unverändert zurück – nicht umformatiert, nicht gerundet, nicht zusammengefasst – zusammen mit einer result_id und einem SHA-256-content_hash des Ergebnisses. Das Ergebnis wird in einem prozessinternen Speicher gehalten.
explain(result_id) gibt eine Erzählung zurück, die aus einer festen Vorlage aufgebaut ist, deren Platzhalter aus diesem gespeicherten Ergebnis gefüllt werden.
Die Trennung ist das Design. Ein Sprachmodell, das diesen Server aufruft, wählt, was gelöst werden soll, und formuliert die Antwort in Worte; es erzeugt keine Zahl. Drei Eigenschaften machen das strukturell, nicht nur wünschenswert:
explainnimmt eine opake ID und sonst nichts. Sein Eingabeschema hat eine einzige Eigenschaft. Es kann keine Rate, kein Gewicht und keine Frist erhalten, also kann es keine wiederholen.Der gespeicherte Datensatz enthält nur das Solver-Ergebnis.
solveverwirft die Problem-Payload, sobald der Solver gelaufen ist. Es gibt kein Feld auf dem gespeicherten Datensatz, das einen Eingabewert tragen könnte.Auf dem
explain-Pfad gibt es keine Arithmetik. Werte werden per Schlüssel nachgeschlagen und als Text gerendert. Die Auswahl der empfohlenen Karte liest ein Flag, das der Solver bereits gesetzt hat; es vergleicht oder berechnet nicht.
verify_narration(narration, stored) macht aus der Behauptung eine Prüfung. Es durchsucht den Text nach Ziffernfolgen und lehnt jedes Token ab, das nicht im gespeicherten Ergebnis vorkommt. So schlägt eine Erzählung fehl, die 11480.0 auf „11500“ rundet, 0.1246 in „12.46%“ umwandelt oder zwei gespeicherte Kosten addiert – jede dieser Zahlen hat der Solver nie erzeugt. Ein Host kann es auf jede Erzählung anwenden, bevor sie angezeigt wird, auch auf eine, die das Modell in eigenen Worten geschrieben hat, statt auf eine, die explain zurückgegeben hat. explain führt es auf seiner eigenen Ausgabe aus, bevor es zurückgibt.
Was die Absicherung bewusst zulässt, damit sie nicht als stärkere Behauptung verstanden wird: Ziffern in gespeicherten Zeichenketten und Dict-Keys gelten als vorhanden, weil eine Erzählung diese Zeichenketten wörtlich zitieren kann. "ortools-cpsat+py3dbp" lässt 3 zu, und der Feldname eta_p90_days lässt 90 zu. Es ist eine lexikalische Prüfung auf numerische Token, kein Beweis semantischer Korrektheit: Eine Erzählung, die die richtige Zahl an das falsche Label hängt, besteht weiterhin.
Installation
Python 3.10 oder neuer.
python -m venv .venv
./.venv/bin/pip install ortools py3dbp pytestOder installieren Sie das Paket selbst, das die beiden Laufzeitabhängigkeiten zieht:
pip install -e .ortools ist die CP-SAT-Engine; py3dbp ist der 3D-Packer, MIT-lizenziert. Der MCP-Server fügt nichts über die Standardbibliothek hinaus hinzu – die stdio-Protokolloberfläche ist klein genug, um sie direkt zu implementieren, was die Abhängigkeitsliste überprüfbar hält.
Ausführen
Der Server spricht zeilengetrenntes JSON-RPC 2.0 auf stdin/stdout:
python -m solver_mcpDer Solver ist auch ohne MCP nutzbar, als Bibliothek oder als Kindprozess:
from load_planner import generate_scenarios
result = generate_scenarios(problem)cat fixtures/cohort_urgent.json | python -m load_planner.cliEinbindung in einen MCP-Client
Jeder Client, der stdio-Server startet, nimmt einen Befehl und Argumente entgegen. Für einen Client, der die übliche mcpServers-Konfigurationsform verwendet:
{
"mcpServers": {
"load-planner": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "solver_mcp"],
"env": { "PYTHONPATH": "/absolute/path/to/load-planner-mcp" }
}
}
}PYTHONPATH wird nur benötigt, wenn das Paket nicht in die Umgebung des Interpreters installiert wurde; nach pip install -e . kann der env-Block entfallen.
Der Handshake ist der Standard: initialize, dann die notifications/initialized-Benachrichtigung, dann tools/list. Der Server meldet Protokollversion 2025-06-18 und akzeptiert 2025-03-26 und 2024-11-05, wobei er diejenige zurückgibt, die der Client angefordert hat, wenn sie eine dieser ist.
Tests
python -m pytest tests/ -qDrei Test-Suiten: die eigenen Tests des Solvers gegen die Fixture; der MCP-Handshake und beide Werkzeuge, in Prozess und über einen echten stdio-Subprozess getestet; und die Manipulations-Suite, die bestätigt, dass eine Erzählung, die einen Wert enthält, der nicht im gespeicherten Ergebnis vorkommt, abgelehnt wird.
Einschränkungen
Einzelne Maschine, einzelner Prozess. Der Ergebnisspeicher ist im Speicher und lebt für die Lebensdauer des Serverprozesses. Eine
result_idaus einem Prozess wird in einem anderen aufgelöst, weil IDs inhaltsadressiert sind und der Solver deterministisch ist – das erneute Lösen desselben Problems reproduziert die ID. Es gibt keinen gemeinsamen Speicher, keine Verdrängung und keine Begrenzung für die Anzahl aufbewahrter Ergebnisse.Solver-Laufzeiten. CP-SAT wird einmal pro aufgezähltem Modusmuster aufgerufen, höchstens dreimal pro
solve, auf einem Modell mit einer ganzzahligen Variable und zwei Nebenbedingungen; es antwortet in Millisekunden. Die Kosten, die skalieren, sind der 3D-Packer, der ein Element pro Palette platziert – ein paar hundert Paletten sind in Ordnung, Zehntausende nicht.solveläuft synchron und hat kein internes Timeout, daher sollte ein Host ein eigenes setzen.Nur Zuordnung ganzer Aufträge. Die Aufteilung eines Auftrags auf zwei Modi (eine Basis-plus-Spitze-Politik) wird nicht modelliert; jeder Auftrag wird vollständig einem Modus zugeordnet.
Gesetzte Risiko-Eingaben. Die Verzögerungsverteilungen in
risk.pysind veröffentlichte Träger-Zuverlässigkeits-Seeds, keine Messungen aus Ihrer eigenen Streckenhistorie. Sie haben die richtige Form und die falsche Genauigkeit, bis ein Aufrufer sie ersetzt.Die Absicherung ist lexikalisch. Siehe die obige Anmerkung:
verify_narrationprüft, dass jede Zahl in einer Erzählung im Ergebnis vorkommt. Es prüft nicht, dass die Zahl verwendet wurde, um das Richtige zu bedeuten.
Available Tools
2 toolsexplainNarrate a stored solver resultA
Return a narration template populated only from a stored solver result. Takes a result_id and nothing else: it has no access to the problem inputs and performs no arithmetic, so it cannot state a number the solver did not produce.
| Name | Required | Description | Default |
|---|---|---|---|
| result_id | Yes | A result_id returned by solve. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the transparency burden. It explicitly discloses key behavioral constraints: no access to problem inputs, no arithmetic, and inability to state numbers the solver did not produce. It does not cover failure modes or detailed return structure, but the core limitation is clearly communicated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the primary action and followed by a concise constraint. Every sentence earns its place, and there is no repetition of schema fields or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with no output schema, the description explains the input source, what the tool returns, and its limitations. It could specify the narration template's structure, but the tool's simplicity and clear boundaries make it adequately complete for selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the single parameter is already described as 'A result_id returned by solve.' The description adds value by emphasizing that it takes 'a result_id and nothing else' and by clarifying the tool's isolation from problem inputs, reinforcing the parameter's purpose beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Return a narration template populated only from a stored solver result,' which is a specific verb and object. It clearly distinguishes this tool from the sibling solve by emphasizing that it consumes a stored result rather than producing one.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use after solve by stating it takes a result_id and nothing else, and the schema's parameter description says the result_id is 'returned by solve.' It also provides a clear exclusion: it has no access to problem inputs and performs no arithmetic, so it should not be used to derive or verify numbers.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
solveSolve a load planA
Run the CP-SAT load-planning solver on a problem and return its numeric result verbatim, with a result_id and a content hash. This is the only tool that produces numbers.
| Name | Required | Description | Default |
|---|---|---|---|
| problem | Yes | The load-planning problem. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses that it runs a solver and returns the numeric result verbatim with result_id and content hash, which is useful. However, it does not mention side effects, performance implications, error behavior, or prerequisites, leaving a moderate gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the action, and contains no redundant or irrelevant information. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the rich schema for the input and no output schema, the description adequately describes the output format (numeric result, result_id, content hash) and provides context (only numeric tool). However, it omits details like failure handling or solver constraints, which could be important. Overall it is fairly complete for a simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the schema itself defines the problem structure thoroughly. The tool description adds no specific parameter guidance beyond 'run on a problem', so it meets the baseline of 3 but does not elevate it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (run the CP-SAT load-planning solver) and resource (a problem), and specifically notes 'This is the only tool that produces numbers', which differentiates it from the sibling 'explain'. This meets the standard of a specific verb+resource that distinguishes from siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides clear guidance on when to use this tool (when numeric results are needed) by stating it is the only tool that produces numbers. However, it does not explicitly mention when not to use it or alternative usage scenarios beyond that differentiation, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
explain - First observed
solve
TDQS
Scored across 2 tools
solve and explain have clearly separated responsibilities: solve is the only numeric-producing tool, while explain only consumes a stored result_id and never touches inputs or arithmetic. There is no overlap or plausible misselection.
Both tool names are bare imperative verbs following the same style: solve and explain. Although the pattern is not verb_noun, it is entirely consistent across the server.
With only two tools, the server is minimal and borderline thin. Each tool has a distinct role, but the surface feels light for a load-planning MCP.
The core solve-then-explain workflow is covered, and solve returns a result_id for later explanation. Gaps appear around stored result management, such as listing or retrieving prior results independently.
Maintenance
Related MCP Connectors
Plan optimal container & truck loads: 3D layouts, utilization, centre of gravity, crush checks.
Pack cargo into containers & onto pallets; a verifiable 3D loading plan. Free tier + REST API.
Load planning for containers, trucks & pallets in Claude & ChatGPT, with a 3D load plan in the chat.
Calculate required trucks or containers, verify shipment fit, and manage Haulista loading plans.
Related MCP Servers
AlicenseAqualityDmaintenanceLets AI agents pack shipping containers using the Kubova calculator, with tools for container loading and API key verification.415 npmMIT- AlicenseAqualityDmaintenanceOcean and multimodal freight intelligence suite providing cross-validated rates, total landed cost, transit reliability, customs, risk, emissions, and unified ship decisions through 47 tools.4710 npmMIT
- AlicenseAqualityDmaintenanceEnables AI agents to pack trucks and shipping containers by generating validated 3D load plans with metrics like LDM, linear feet, and pallet positions through the Hansatic packing API.37 npmMIT
- AlicenseAqualityBmaintenanceEnables AI assistants to query and manage logistics shipment data, supporting operations like tracking, quoting, and performance analysis via nine tools backed by a demo dataset or a REST API.9253 npmMIT