· 10 min read
What if a single prompt redesigned your entire supply chain for more cost-efficient and sustainable operations?
Supply Chain Network Optimisation determines where goods are produced to serve markets at the lowest cost in an environmentally friendly way.
Examples of network design with different objectives - (Image by Samir Saci)
We must consider real-world constraints (capacity, demand) to find the optimal set of factories that will minimise the objective function.
Example of environmental constraints of maximum impact per unit produced - (Image by Samir Saci)
As a Supply Chain Solution Manager, I have led multiple network design studies that typically took 10–12 weeks.
The final deliverable was usually a deck of slides presenting multiple scenarios, allowing supply chain directors to weigh the trade-offs.
Example of Network Designs with different constraints - (Image by Samir Saci)
But decision-makers were often frustrated during the presentations of the study results:
Direction: "What if we increase the factory capacity by 25%?"
They wanted to challenge assumptions and re-run scenarios live, while all we had were the slides we had taken hours to prepare.
What if we could improve this user experience using conversational agents?
In this article, I show how I connected an MCP server to a FastAPI microservice with a Supply Chain Network Optimisation algorithm.
Example of a request to Claude Desktop connected to an MCP Server calling our FastAPI microservice - (Image by Samir Saci)
The result is a conversational agent that can run one or multiple scenarios and provide a detailed analysis with smart visuals.
We will even ask this agent to advise us on the best decision to take, considering our goals and the constraints.
Example of strategic recommendations provided by the agent - (Image by Samir Saci)
For this experiment, I’ll use:
• Claude Desktop as the conversational interface
• MCP Server to expose typed tools to the agent
• FastAPI microservice with the network optimisation endpoint
In the first section, I will introduce the problem of Supply Chain Network design with a concrete example.
Then, I will show multiple deep analyses performed by the conversational agent to support strategic decision-making.
Example of advanced visuals generated by the agent to answer an open question - (Image by Samir Saci)
For the first time, I have been impressed by AI when the agent selected the correct visuals to answer an open question without any guidance!
Supply chain network optimisation with Python
Problem statement: Supply chain network design
We are supporting the Supply Chain Director of an international manufacturing company that would like to redefine their network for a long-term transformation plan.
Supply Chain Network Design Problem - (Image by Samir Saci)
This multinational company has operations in 5 different markets: Brazil, the USA, Germany, India and Japan.
Example of demand per market - (Image by Samir Saci)
To meet this demand, we can open low or high-capacity factories in each of the markets.
Capacities per factory type and location - (Image by Samir Saci)
If you open a facility, you must consider the fixed costs (associated with electricity, Real Estate, and CAPEX) and the variable costs per unit produced.
Example of fixed and variable costs per production country - (Image by Samir Saci)
In this example, high-capacity plants in India have lower fixed costs than those in the USA with lower capacity.
Example of freight costs per container - (Image by Samir Saci)
Additionally, there are the costs associated with shipping a container from Country XXX to Country YYY.
Everything summed up will define the total cost of producing and delivering products from a manufacturing site to the different markets.
What about sustainability?
In addition to these parameters, we consider the amount of resources consumed per unit produced.
For instance, we consume 780 MJ/Unit of energy and 3,500 litres of water to produce a single unit in Indian factories.
For the environmental impacts, we also consider the pollution resulting from CO2 emissions and waste generation.
Environmental impact per unit produced for each country - (Image by Samir Saci)
In the example above, Japan is the cleanest production country.
Where should we produce to minimise water usage?
The idea is to select a metric to minimise, which could be costs, water usage, CO2 emissions, or energy usage.
Example of the output in the LogiGreen App - (Image by Samir Saci)
The model will indicate where to locate factories and outline the flows from these factories to the various markets.
This solution has been packaged as a web application (FastAPI backend, Streamlit front-end) used as a demo to showcase the capabilities of our startup LogiGreen.
User interface of the LogiGreen App (Sustainability Module) - Image by Samir Saci
The idea of this experiment is to connect the backend with Claude Desktop using a local MCP server built with Python.
Providing context and explanation to the agent for better analyses
Using the MCP server framework, we provide our agent access to the tool.
It can call the tool to simulate any scenario based on input parameters generated by itself.
Thus, we can test its ability to select the right scenarios to answer open questions.
For that, we need to make sure that the agent has all the information needed to use it properly.
Section 1: Context
Prompt explaining the Sustainable Supply Chain Network Optimisation Problem - (Image by Samir Saci)
The first section is only to introduce the context in which the tool is used.
Section 2: Describe input data
This brief description is crucial if we want to be sure that the agent adheres to the Pydantic schema of input parameters imposed by our FastAPI microservice.
Additionally, we provide a description of the types of scenarios the tool may encounter and the expectations we have regarding the analysis.
Everything is ready for our experiment.
Experiment with the Sustainable Supply Chain Optimisation Agent: From simple to complex instructions
To test the workflow, I ask the agent to run the simulation with default parameters.
Sample of analysis provided by the conversation agent - (Image by Samir Saci)
As expected, the agent calls the FastAPI microservice, collects the results, and concisely summarises them.
This is cool, but I already had that with my Production Planning Optimisation Agent built with LangGraph and FastAPI.
Example of output analysis of the Production Planning Optimisation Agent - (Image by Samir Saci)
I wanted to explore MCP Servers with Claude Desktop for a more advanced usage.
Supply Chain Director: "I want to have a comparative study of multiple scenario."
If we come back to the original plan, the idea was to equip our decision-makers (customers who pay us) with a conversational agent that would assist them in their decision-making process.
Let us try a more advanced question:
Here we provide more open questions that reflect the needs of our customers - (Image by Samir Saci)
We explicitly request a comparative study while allowing Claude Sonnet 4 to be creative in terms of visual rendering.
Claude Agent sharing its plan - (Image by Samir Saci)
To be honest, I was impressed by the dashboard that was generated by Claude, which you can access via this link.
At the top, you can find an executive summary listing what can be considered the most important indicators of this problem.
Executive Summary generated by Claude - (Image by Samir Saci)
The model understood, without being explicitly asked in the prompt, that these four indicators were key to the decision-making process resulting from this study.
At this stage, in my opinion, we already get the added value of incorporating an LLM into the loop.
The following outputs are more conventional and could have been generated with deterministic code.
Financial and Environmental Metrics Summary Table - (Image by Samir Saci)
However, I admit that the creativity of Claude outperformed my own web application with this smart visual showing the plant openings per scenario.
Plant open per scenario - (Image by Samir Saci)
While I was starting to worry about getting replaced by AI, I had a look at the strategic analysis generated by the agent.
Example of trade-off analysis - (Image by Samir Saci)
The approach of comparing each scenario vs a baseline of cost optimisation has never been explicitly requested.
The agent took the initiative to bring up this angle when presenting results.
This demonstrated the ability to select the appropriate indicators to convey a message effectively using data.
Can we ask open questions?
Let me explore that in the next section.
A conversation agent capable of decision-making?
To further explore the capabilities of our new tool and test its potential, I will pose open-ended questions.
Question 1: Trade-off between cost and sustainability
Question 1 - (Image by Samir Saci)
This is the type of question I got when I was in charge of network studies.
Executive summary - Image by Samir Saci
This appeared to be a recommendation to adopt the Water-optimised strategy to find the perfect balance.
Visuals - (Image by Samir Saci)
It used compelling visuals to support its idea.
I really like the cost vs. environmental impact scatter plot!
Implementation Plan - (Image by Samir Saci)
Unlike some strategy consulting firms, it did not forget the implementation part.
For more details, you can access the complete dashboard at this link.
Let's try another tricky question.
Question 2: Best CO2 emissions performance
What is the best performance for indicator XXX under budget limits - (Image by Samir Saci)
This is a challenging question that required seven runs to answer.
7 runs to answer the question - (Image by Samir Saci)
This was enough to provide the question with the correct solution.
Optimal solution - (Image by Samir Saci)
What I appreciate the most is the quality of the visuals used to support its reasoning.
Example of visual used - (Image by Samir Saci)
In the visual above, we can see the different scenarios simulated by the tool.
Although we could question the wrong orientation of the (x-axis), the visual remains self-explicit.
Strategic recommendation - (Image by Samir Saci)
Where I feel beaten by the LLM is when we look at the quality and concision of the strategic recommendations.
Considering that these recommendations serve as the primary point of contact with decision-makers, who often lack the time to delve into details, this remains a strong argument in favour of using this agent.
Conclusion
This experiment is a success!
There is no doubt about the added value of MCP Servers compared to the simple AI workflows introduced in the previous articles.
When you have an optimisation module with multiple scenarios (depending on objective functions and constraints), you can leverage MCP servers to enable agents to make decisions based on data.
I really see this tool used in sustainability roadmaps where we have to deal with multiple stakeholders with conflicting interests.
In the article Sustainable business strategy with data analytics, also published on Illuminem, I provide a practical example of the challenges a company can face during their green transformation.
Steering Committee questions — (Image by Samir Saci)
This is where our agentic approach can provide added value by confronting multiple scenarios to find the best consensus.
illuminem Voices is a democratic space presenting the thoughts and opinions of leading Sustainability & Energy writers, their opinions do not necessarily represent those of illuminem.
Interested in the companies shaping our sustainable future? See on illuminem’s Data Hub™ the transparent sustainability performance, emissions, and climate targets of thousands of businesses worldwide.