arXiv:2608.22167cs.AIAug 2026

Manuscript Offprint

arXiv:2608.22167

MCP-Universe RL: A Framework for Training MCP Tool-Use Agents via Reinforcement Learning

Ziyang Luo, Yan Yang, Xiangru Jian, Ziji Shi, Xiaoqiang Lin, Jun Hao Liew, Silvio Savarese, Junnan Li

Abstract

Reinforcement learning (RL) has become an effective way to improve the tool-use ability of large language models (LLMs), but most existing RL frameworks stop at the policy update. For every new domain, the user is left with two hard systems problems: standing up an isolated environment for each of hundreds of concurrent trajectories and connecting it to training, and scheduling the rollout so that the GPU stays busy across long, multi-turn episodes that spend much of their time stalled on slow tool calls. We present MCP-Universe RL (MCP-U RL), an open-source framework that takes over both. It uses the Model Context Protocol (MCP) as the interface to the environment, so any tool already exposed as an MCP server plugs into training with no RL-specific integration code. It builds the two missing layers once and reuses them across domains: an environment-orchestration layer that provisions, isolates, and recycles the MCP environments over a pluggable container backend, and a rollout-orchestration layer whose staged pipeline overlaps trajectories to keep the GPU busy while episodes wait on tools. A backend-agnostic training layer then applies the update through an existing RL backend, with veRL and slime integrations. With one configuration, changing only the task specification, we train software-engineering, deep-research, and general tool-use agents on gpt-oss-20b and improve task reward in all three.

1 Introduction

Large language models (LLMs) are increasingly expected to act in the real world through external tools (Luo et al., 2025b), such as running code, sending emails, querying databases, or operating real applications, rather than producing text answers alone. Reinforcement learning (RL) has become an effective way to improve this behavior: by rewarding task completion, algorithms such as GRPO (Shao et al., 2024; DeepSeek-AI et al., 2025) and DAPO (Yu et al., 2025) teach an agent to plan, call tools, and recover from errors over many turns. Putting this into practice takes more than the algorithm. General RL frameworks (Sheng et al., 2025; Hu et al., 2024; THUDM, 2025; Fu et al., 2025) provide the optimization, the policy update and distributed training, but to train a tool-use agent the user still has to build two further layers for every new domain.

The first is the environment-orchestration layer. Agentic RL samples many trajectories per update, and each one acts on a live environment whose state it changes, editing files, writing database rows, or navigating a stateful session (Jimenez et al., 2023; de Chezelles et al., 2024). The reward is usually read back from that state, so if two trajectories shared an environment their edits would collide and the reward would be wrong; each trajectory therefore needs its own isolated environment. At the scale of RL, hundreds of these are started on a container backend, kept reachable, and recycled at once, which is a systems problem in itself. Yet the work is nearly the same from one domain to the next: a web-search environment and a code repository differ in what they run, not in how they are provisioned and recycled. The second is the rollout-orchestration layer that turns those environments into training signal. Each tool-use turn alternates between generating on the GPU and calling a tool that runs in the environment, and a tool call can stall for seconds. Running one trajectory at a time leaves the GPU idle through every such stall; running many at once keeps it busy but can exhaust host memory with live environments. Keeping the GPU fed without running out of memory is therefore a scheduling problem. Both layers are rebuilt per project today, which is what makes agentic RL slow to set up and hard to reproduce.

In this work, we present MCP-Universe RL (MCP-U RL), an open-source framework that builds both layers once and shares them across

Figure

Figure 1: Overview of our MCP-Universe RL framework. Each domain is exposed as one or several MCP servers, and all domains funnel through a single MCP interface into one shared training loop, whose environment-orchestration, rollout-orchestration, and training-engine layers are reused for every domain; only the task specification changes.

domains (Figure 1). The key idea is to use the Model Context Protocol (MCP) (Anthropic, 2024) as a single interface to every environment: MCP standardizes how an agent calls tools, and a large ecosystem of MCP servers already exists. Once a domain's tools are exposed as an MCP server, the user only writes a task specification and presses run, with no environment-integration or rollout code. Because every domain is now reached the same way, the environment-orchestration layer manages the whole life cycle in one place, provisioning, isolating, and recycling environments over a container backend that can be swapped when one runtime cannot create them fast enough.

Each ready environment is then handed to the rollout-orchestration layer, which runs the episodes and turns them into training signal: for each trajectory it drives the agent against its environment, records the tokens for training, and scores the finished episode with the task's evaluator. Running these episodes fast is the hard part, because a tool-use episode leaves the GPU idle whenever the agent is waiting on a tool. The layer hides that wait by running the episodes as an overlapping pipeline, so that some trajectories generate on the GPU while others are acquiring an environment or waiting on a tool call. Acquiring an environment and generating draw on different resources, host memory and the GPU, so we let more trajectories generate than acquire, which keeps the GPU busy without running out of memory. A backend-agnostic training layer then applies the policy update through an existing RL backend, with integrations for veRL (Sheng et al., 2025) and slime (THUDM, 2025). Changing only the task specification, we train software-engineering (Jain et al., 2025), deep-research (Lu et al., 2025), and general tool-use (Wang et al., 2026) agents, and improve task reward in all three.