# Retrieval-grounded robot program generation and simulation-based correction via Model Context Protocol

Zhichao Zhou, Siyuan Chen, Omkar Salunkhe, Ebru Turanoglu Bekar, Johan Stahre, Anders Skoogh

Zhichao Zhou, Siyuan Chen, Omkar Salunkhe, Ebru Turanoglu Bekar, Johan Stahre, Anders Skoogh (2026). Retrieval-grounded robot program generation and simulation-based correction via Model Context Protocol. arXiv:2608.21417 · Accepted for CIE53 2026.

Accepted for CIE53 2026; presented in Abu Dhabi. The linked version is the arXiv preprint.

## Abstract

Flexible manufacturing requires industrial robots to be reprogrammed rapidly as product variants change. This paper presents a language-model-based workflow that generates, validates, and iteratively corrects ABB RAPID robot programs from natural language task descriptions. A dual-stream retrieval-augmented generation (RAG) pipeline grounds code generation in verified technical documentation and production templates, reducing domain-specific errors produced by ungrounded language models. A custom Model Context Protocol (MCP) server connects the language-model client directly to ABB RobotStudio for automated code upload, simulation execution, and diagnostic feedback. The evaluation combines a 30-query retrieval benchmark, scoped code-generation checks, and RobotStudio case studies in a simulated pickand- place manufacturing cell. The simulation loop exposes execution failures that static and semantic checks alone cannot catch, including suction release-height errors, unreachable placement targets, and configuration-dependent recovery motions. The results show how RAG and MCP can connect grounded code generation with executable feedback from industrial robot simulation software, while reducing but not eliminating expert setup and final supervision.

## In brief

This workflow connects retrieval-grounded ABB RAPID generation to RobotStudio through MCP. Simulation feedback reveals execution errors that static code checks miss and supports iterative correction of robot programs.

## Key points

- Grounds code generation in verified documentation and production templates through dual-stream RAG.
- Uses an MCP server for code upload, simulation and diagnostic feedback in ABB RobotStudio.
- Finds execution errors that static checks miss; expert setup and final supervision remain necessary.

## Siyuan Chen’s role

Second author · presenting author

## Links

- [Publication page](https://siyuanchen2020.github.io/publications/robot-program-generation-mcp/)
- [Source record](https://arxiv.org/abs/2608.21417)
- [DOI](https://doi.org/10.48550/arXiv.2608.21417)
- [Full text](https://arxiv.org/pdf/2608.21417)

## Citation

```bibtex
@misc{Chen2026RobotProgramGeneration,
  title = {{Retrieval-grounded robot program generation and simulation-based correction via Model Context Protocol}},
  author = {Zhou, Zhichao and Chen, Siyuan and Salunkhe, Omkar and Turanoglu Bekar, Ebru and Stahre, Johan and Skoogh, Anders},
  year = {2026},
  doi = {10.48550/arXiv.2608.21417},
  url = {https://arxiv.org/abs/2608.21417},
  eprint = {2608.21417},
  archivePrefix = {arXiv},
  primaryClass = {cs.AI},
  note = {arXiv preprint; accepted for CIE53 2026; presented in Abu Dhabi}
}
```
