Papers
Topics
Authors
Recent
Search
2000 character limit reached

Making REST APIs Agent-Ready: From OpenAPI to Model Context Protocol Servers for Tool-Augmented LLMs

Published 21 Jul 2025 in cs.SE | (2507.16044v2)

Abstract: LLMs are evolving from passive text generators into active agents that invoke external tools. To support this shift, scalable protocols for tool integration are essential. The Model Context Protocol (MCP), introduced by Anthropic in 2024, offers a schema-driven standard for dynamic tool discovery and invocation. Yet, building MCP servers remains manual and repetitive, requiring developers to write glue code, handle authentication, and configure schemas by hand-replicating much of the integration effort MCP aims to eliminate. This paper investigates whether MCP server construction can be meaningfully automated. We begin by analyzing adoption trends: among 22,000+ MCP-tagged GitHub repositories created within six months of release, fewer than 5% include servers, typically small, single-maintainer projects dominated by repetitive scaffolding. To address this gap, we present AutoMCP, a compiler that generates MCP servers from OpenAPI 2.0/3.0 specifications. AutoMCP parses REST API definitions and produces complete server implementations, including schema registration and authentication handling. We evaluate AutoMCP on 50 real-world APIs spanning 5,066 endpoints across over 10 domains. From a stratified sample of 1,023 tool calls, 76.5% succeeded out of the box. Manual failure analysis revealed five recurring issues, all attributable to inconsistencies or omissions in the OpenAPI contracts. After minor fixes, averaging 19 lines of spec changes per API, AutoMCP achieved 99.9% success. Our findings (i) analyze MCP adoption and quantify the cost of manual server development, (ii) demonstrate that OpenAPI specifications, despite quality issues, enable near-complete MCP server automation, and (iii) contribute a corpus of 5,066 callable tools along with insights on repairing common specification flaws.

Summary

  • The paper introduces AutoMCP to automatically generate MCP servers from OpenAPI specs, significantly reducing manual coding efforts.
  • It details a systematic process including specification normalization, authentication handling, and endpoint stub generation for RESTful APIs.
  • AutoMCP achieved a success rate improvement from 76.5% to 99.9%, demonstrating its practical impact on tool-enabled LLM integration.

Automated MCP Server Generation from OpenAPI Specifications

The paper "Making REST APIs Agent-Ready: From OpenAPI to Model Context Protocol Servers for Tool-Augmented LLMs" (2507.16044) presents a mechanism to convert RESTful APIs into Model Context Protocol (MCP) servers, using OpenAPI specifications. This approach is designed to advance the automation of MCP server creation, thus streamlining the tool integration process for LLMs. This essay explores the paper's methodology, implementation strategies, and the broader implications of its findings.

Introduction to MCP and AutoMCP

MCP is a standardized protocol that facilitates dynamic tool discovery and invocation by LLMs, enabling these models to perform real-world tasks autonomously. Despite its benefits, manually constructing MCP servers remains labor-intensive, requiring repeated code scaffolding and schema configuration. AutoMCP is a compiler introduced to automate the creation of MCP servers directly from structured REST API definitions in OpenAPI 2.0/3.0 specifications. It automates schema registration, authentication handling, and server implementation generation without requiring manual coding.

Implementation and Evaluation

AutoMCP performs several automated steps to convert OpenAPI specifications into functional MCP server stubs:

  1. Input Parsing and Spec Normalization: AutoMCP parses the OpenAPI spec to detect the format and resolve all $ref pointers, ensuring structural consistency.
  2. Authentication Handling: The compiler extracts declared authentication schemes and generates a .env template for environment-based secret management. It also supports OAuth2 by emitting a login handler.
  3. Stub Generation: Each endpoint in the specification is transformed into a callable MCP tool, complete with parameter validation and authentication injection, adhering to MCP conventions.
  4. Tool Execution and Validation: AutoMCP was evaluated on 50 public APIs, totaling 5,066 endpoints, selecting a stratified sample of 1,023 tool calls. A success rate of 76.5% out-of-the-box following minor specification fixes resulted in a 99.9% successful execution rate. Figure 1

    Figure 1: End-to-end message flow for Trello card creation mediated by Trello MCP server ( created using AutoMCP).

    Figure 2

    Figure 2: Approach overview and addressed RQs (RQ1: Green arrows, RQ2: Blue arrows, and RQ3: Red arrows).

Results and Analysis

The evaluation of AutoMCP demonstrated that the OpenAPI specifications provide sufficient detail for automating MCP server generation, with minor specification corrections. The baseline of 76.5% success was increased to 99.9% after addressing issues like incomplete authentication metadata and malformed base URLs.

Out of 17 vendor-maintained servers analyzed, AutoMCP achieved or exceeded tool coverage in 82% of cases while reducing code size considerably, proving the capability of the proposed automated approach to match or surpass manual server implementations. Figure 3

Figure 3: Incremental growth of MCP-related GitHub repositories (Oct 2024 – Apr 2025).

Implications and Future Work

The implications of AutoMCP are broad, offering a pathway to significantly reduce the engineering efforts needed for integrating REST APIs into LLM workflows. By ensuring the quality of OpenAPI specifications, developers can deploy MCP-compatible servers rapidly, facilitating the integration of external tools into LLM systems.

Future advancements may focus on refining AutoMCP to handle more complex specification flaws autonomously and expanding support to additional API documentation standards beyond OpenAPI. Furthermore, increasing the scope of automatic detection and correction for specification errors will bolster the reliability and efficiency of AutoMCP-driven server generation.

Conclusion

AutoMCP effectively automates the generation of MCP servers from OpenAPI specifications, addressing a significant bottleneck in the adoption and integration of tool-augmented LLMs. The study illustrates potential enhancements to scalability and flexibility, fostering a more seamless and efficient tool ecosystem for LLMs. With continued development and adoption, tools like AutoMCP herald a shift towards LLM-native environments, enhancing LLMs' capability to function as autonomous, tool-augmented agents.

Paper to Video (Beta)

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 2 likes about this paper.