API to MCP Tool in One Click: Let AI Agents Easily Call Any API

An open-source tool that converts any REST API into an MCP Server with a single command for AI agents.
API to MCP is an open-source tool that automatically converts any REST API into an MCP Server with one command, enabling AI agents like Claude Code and Codex to directly call third-party API services. By leveraging OpenAPI specifications, it eliminates the tedious manual process of writing tool definitions, authentication logic, and parameter schemas, significantly lowering the barrier to MCP ecosystem integration.
Overview
With the rise of AI coding agents like Claude Code and Codex, MCP (Model Context Protocol) has become the standard protocol for agents to call external tools. MCP is an open protocol officially released by Anthropic in late 2024, designed to establish a standardized communication interface between AI models and external tools and data sources. Before MCP, different AI agents had their own ways of calling external tools — OpenAI had Function Calling, LangChain had its own Tool abstraction, and various Agent frameworks had their own plugin mechanisms. MCP's design draws from the architectural philosophy of LSP (Language Server Protocol), adopting a Client-Server model where the AI model acts as the Client initiating tool call requests, while the MCP Server is responsible for translating these requests into actual API calls or data operations. The protocol itself is based on JSON-RPC 2.0 and supports both stdio and HTTP transport methods.
However, manually converting existing APIs into MCP Servers has always been a tedious process — requiring hand-written tool definitions, parameter declarations, authentication logic, and more. Recently, an open-source tool called "API to MCP" solves this pain point, enabling you to automatically convert any API into an MCP tool that agents can call directly with just one command.



Pain Points of Traditional API Integration with MCP
In previous workflows, if you wanted Claude Code or Codex to call a third-party API (such as DeepSeek's API), you needed to:
- Manually write MCP tool definition files
- Declare parameter types and descriptions for each endpoint one by one
- Implement authentication logic (API Key management)
- Handle request/response serialization
- Write error handling code
It's important to understand that there is a fundamental structural difference between traditional REST APIs and MCP Servers. REST APIs follow the HTTP protocol, defining interfaces through URL paths, HTTP methods (GET/POST/PUT/DELETE), and JSON request bodies. MCP Servers, on the other hand, need to re-encapsulate these interfaces as "Tools" — each tool must include a name, description, JSON Schema definition of input parameters, and the actual execution logic. This conversion is not merely a format mapping; it also involves semantic-level adaptation: MCP tool descriptions need to be clear enough for AI models to understand when and how to call the tool. Additionally, MCP Servers must handle protocol-level interactions such as tool discovery (listing) and capability negotiation.
This process had to be repeated for every new API, drastically reducing development efficiency.
The API to MCP Solution
The core idea behind this tool is straightforward: you provide an API's documentation or specification, and it automatically generates the complete MCP Server code for you. Its automatic conversion capability largely relies on OpenAPI (formerly known as Swagger), the industry-standard specification for describing REST APIs. OpenAPI uses YAML or JSON format to define API endpoints, parameters, request bodies, response formats, and authentication methods. When an API has a complete OpenAPI document, the tool can extract each endpoint's path, HTTP method, parameter types, and descriptions, then automatically map them to the corresponding fields in MCP tool definitions. For APIs without OpenAPI documentation, the tool may need to use AI to parse natural language documentation and infer the interface structure — this is one reason why the tool works better within Claude Code.
The generated server can be directly recognized and called by agents like Claude Code and Codex, achieving a one-click conversion from API to MCP.
Installation and Usage
Installing API to MCP
The entire workflow is very streamlined. First, install the npm package in your terminal:
npm install -g api-to-mcp
One-Click MCP Server Generation
After installation, open Claude Code, provide the target API information (e.g., DeepSeek API) to the tool, and it will automatically complete the following tasks:
- Code Generation: Automatically generates the complete MCP Server code
- Build & Compile: Compiles the code into a runnable MCP server
- Configuration Output: Provides the server's runtime address and configuration details
Claude Code, mentioned here, is Anthropic's command-line AI coding agent that can directly understand codebases, perform file operations, run commands, and call external tools via the MCP protocol in the terminal. OpenAI's Codex is its counterpart, also equipped with code comprehension and tool-calling capabilities. These two products represent a paradigm shift in AI coding assistants from "conversational suggestions" to "autonomous execution" — they can not only offer code suggestions but also directly modify files, run tests, and deploy services. MCP plays a role similar to an operating system's driver interface, enabling agents to "drive" various external services in a unified manner.
Once generation is complete, you simply configure the corresponding API Key and you're ready to go.
Auto-Completion and Tool Registration
The generated MCP Server includes not only basic API calling capabilities but also supports:
- Automatic identification and registration of callable tool paths
- Generation of tool descriptions and method documentation
- Parameter auto-completion
- Auxiliary features (such as querying account balances, etc.)
Technical Value Analysis
Lowering the Barrier to MCP Ecosystem Entry
Although the MCP protocol is elegantly designed, the development cost of its Server side has been one of the factors hindering ecosystem expansion. The emergence of tools like API to MCP means that any existing REST API can be quickly integrated into the MCP ecosystem, significantly reducing the cost of building agent tool chains.
Accelerating Agent Toolification
When API-to-MCP conversion becomes simple enough, developers can rapidly equip agents with a large number of tools. This means the capability boundaries of AI coding assistants will no longer be limited to officially pre-built tool sets but can be extended on demand to any service that provides an API.
From a broader perspective, the evolution of agent tool chains is going through a phase similar to the early "App Store" era of mobile internet. The MCP protocol is essentially defining a unified "application interface standard," while various MCP Servers are the "applications" available for agents to call. Currently, the MCP ecosystem already has hundreds of official and community-contributed Servers covering file systems, databases, Git, browsers, various SaaS services, and more. The emergence of automated bridging tools like API to MCP is similar to the "website-to-app" conversion tools of that era, capable of rapidly expanding the number of available tools in the ecosystem. In the future, as agent capabilities grow, the richness of the tool chain will directly determine the upper limit of an agent's actual productivity.
Open Source Community Collaboration
As an open-source project, API to MCP welcomes community PR contributions. As more developers participate, the tool's support for different API specifications (OpenAPI, GraphQL, etc.) will become more comprehensive, and conversion quality will continue to improve.
Use Cases
- Developers who need to call custom APIs within Claude Code
- Teams looking to quickly integrate third-party services (such as DeepSeek, various SaaS platforms) into AI workflows
- Building complex agent applications with multi-tool collaboration
- Rapid prototyping and validation to test whether a specific API is suitable as an agent tool
Conclusion
API to MCP is a small but powerful efficiency tool that addresses a real pain point in the current MCP ecosystem — the high cost of API integration. While auto-generated code may still require manual fine-tuning in complex scenarios, the one-click conversion experience is already practical enough for rapid integration and prototype validation. As the MCP protocol continues to gain adoption, the value of such bridging tools will only grow — they are becoming an indispensable infrastructure layer connecting the traditional API world with the emerging agent ecosystem.
Key Takeaways
Related articles

Claude Code Installation Guide & The Five Stages of AI Programming Tools Explained
Complete Claude Code installation guide with the five stages of AI programming tools, from manual coding to agents. Learn 0-to-1 project building and 1-to-100 iteration challenges.

Enterprise-Level AI Project Rules Files: 5 Hard Rules + 6 Writing Techniques
AI keeps messing up your code? Learn 5 hard rules and 6 writing techniques for enterprise-level Rules files in Claude Code, Cursor & more, with templates.

Building Cloud Computing Clusters from Old Phones: Google and UCSD Explore a New Path to Sustainable Computing
Google and UCSD explore building cloud clusters from old phones, leveraging ARM chip efficiency to cut e-waste and data center carbon footprints.