SELGMASep 7, 2025

Code2MCP: Transforming Code Repositories into MCP Services

arXiv:2509.05941v211 citationsh-index: 2Has Code
Originality Highly original
AI Analysis

It addresses the bottleneck of tool availability for the MCP ecosystem by automating the transformation of GitHub repositories, potentially accelerating protocol adoption.

The paper tackles the problem of automatically converting existing software projects into MCP-compatible services to populate the tool pool for Large Language Models, introducing Code2MCP, which successfully transforms open-source computing libraries in fields like bioinformatics, mathematics, and fluid dynamics.

The Model Context Protocol (MCP) aims to create a standard for how Large Language Models use tools. However, most current research focuses on selecting tools from an existing pool. A more fundamental, yet largely overlooked, problem is how to populate this pool by converting the vast number of existing software projects into MCP-compatible services. To bridge this gap, we introduce Code2MCP, an agent-based framework that automatically transforms a GitHub repository into a functional MCP service with minimal human intervention. Code2MCP employs a multi-agent workflow for code analysis, environment setup, tool function design, and service generation, enhanced by a self-correcting loop to ensure reliability. We demonstrate that Code2MCP successfully transforms open-source computing libraries in scientific fields such as bioinformatics, mathematics, and fluid dynamics that are not available in existing MCP servers. By providing a novel automated pathway to unlock GitHub, the world's largest code repository, for the MCP ecosystem, Code2MCP serves as a catalyst to significantly accelerate the protocol's adoption and practical application. The code is public at https://github.com/DEFENSE-SEU/Code2MCP.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes