Table of Contents
Fetching ...

MCP-Flow: Facilitating LLM Agents to Master Real-World, Diverse and Scaling MCP Tools

Wenhao Wang, Peizhi Niu, Zhao Xu, Zhaoyu Chen, Jian Du, Yaxin Du, Xianghe Pang, Keduan Huang, Yanfeng Wang, Qiang Yan, Siheng Chen

TL;DR

This work introduces MCP-Flow, an automated web-agent–driven pipeline that discovers real-world MCP servers, synthesizes large-scale training data, and trains LLMs to master MCP tool usage. By collecting data from 1,166 servers and 11,536 tools, the authors generate 68,733 ground-truth instruction-function-call pairs and 6,439 trajectories, enabling training of small LLMs, retrieval-augmented reasoning, and evaluation playgrounds. The experiments show that MCP-Flow-trained small models outperform larger SOTA models in tool selection and function-call formatting, while retrieval augmentation further boosts performance for large models and reduces inference cost. Beyond model improvements, MCP-Flow supplies a scalable dataset and evaluation framework to study MCP servers/tools heterogeneity and to drive future MCP ecosystem research.

Abstract

Large Language Models (LLMs) increasingly rely on external tools to perform complex, realistic tasks, yet their ability to utilize the rapidly expanding Model Contextual Protocol (MCP) ecosystem remains limited. Existing MCP research covers few servers, depends on costly manual curation, and lacks training support, hindering progress toward real-world deployment. To overcome these limitations, we introduce MCP-Flow, an automated web-agent-driven pipeline for large-scale server discovery, data synthesis, and model training. MCP-Flow collects and filters data from 1166 servers and 11536 tools, producing 68733 high-quality instruction-function call pairs and 6439 trajectories, far exceeding prior work in scale and diversity. Extensive experiments demonstrate MCP-Flow's effectiveness in driving superior MCP tool selection, function-call generation, and enhanced agentic task performance. MCP-Flow thus provides a scalable foundation for advancing LLM agents' proficiency in real-world MCP environments. MCP-Flow is publicly available at \href{https://github.com/wwh0411/MCP-Flow}{https://github.com/wwh0411/MCP-Flow}.

MCP-Flow: Facilitating LLM Agents to Master Real-World, Diverse and Scaling MCP Tools

TL;DR

This work introduces MCP-Flow, an automated web-agent–driven pipeline that discovers real-world MCP servers, synthesizes large-scale training data, and trains LLMs to master MCP tool usage. By collecting data from 1,166 servers and 11,536 tools, the authors generate 68,733 ground-truth instruction-function-call pairs and 6,439 trajectories, enabling training of small LLMs, retrieval-augmented reasoning, and evaluation playgrounds. The experiments show that MCP-Flow-trained small models outperform larger SOTA models in tool selection and function-call formatting, while retrieval augmentation further boosts performance for large models and reduces inference cost. Beyond model improvements, MCP-Flow supplies a scalable dataset and evaluation framework to study MCP servers/tools heterogeneity and to drive future MCP ecosystem research.

Abstract

Large Language Models (LLMs) increasingly rely on external tools to perform complex, realistic tasks, yet their ability to utilize the rapidly expanding Model Contextual Protocol (MCP) ecosystem remains limited. Existing MCP research covers few servers, depends on costly manual curation, and lacks training support, hindering progress toward real-world deployment. To overcome these limitations, we introduce MCP-Flow, an automated web-agent-driven pipeline for large-scale server discovery, data synthesis, and model training. MCP-Flow collects and filters data from 1166 servers and 11536 tools, producing 68733 high-quality instruction-function call pairs and 6439 trajectories, far exceeding prior work in scale and diversity. Extensive experiments demonstrate MCP-Flow's effectiveness in driving superior MCP tool selection, function-call generation, and enhanced agentic task performance. MCP-Flow thus provides a scalable foundation for advancing LLM agents' proficiency in real-world MCP environments. MCP-Flow is publicly available at \href{https://github.com/wwh0411/MCP-Flow}{https://github.com/wwh0411/MCP-Flow}.

Paper Structure

This paper contains 54 sections, 17 figures, 17 tables, 1 algorithm.

Figures (17)

  • Figure 2: Dataset statistics of servers, tools, function calls and trajectories.
  • Figure 2: Process of web-agent automated server crawling with more details in Appendix \ref{['sec:dataset_detail']}.
  • Figure 3: Dataset statistics. (a) MCP-Flow encompasses a large-scale collection of MCP servers and tools from six distinct marketplaces. (b) T-SNE visualization of instruction embeddings (1,000 random samples per marketplace) shows the dataset diversity. (c) Each MCP server is classified into one of ten categories, with the distributions reflecting the heterogeneity across marketplaces.
  • Figure 4: Data example using the https://smithery.ai/server/@pinkpixel-dev/mcpollinations from Smithery. The first column is collected as described in Section \ref{['sec:server_collection']}, and the remaining data as described in Section \ref{['sec:instruction_generation']}. The server returns a URL linking to the image shown above. Note that all 1,166 servers have corresponding tool information and generated function calls, but not all yield valid tool responses.
  • Figure 5: Comparing API model performance with and without retrieval augmented samples from MCP-Flow.
  • ...and 12 more figures