- Explore MCP Servers
- openapi2mcptools
Openapi2mcptools
What is Openapi2mcptools
openapi2mcptools is a utility library designed to convert OpenAPI specifications into tools compatible with the Model Context Protocol (MCP), facilitating faster development of MCP servers based on OpenAPI specifications.
Use cases
Use cases for openapi2mcptools include developing APIs that need to be compliant with OpenAPI standards while also leveraging the capabilities of MCP, creating tools for automated testing of APIs, and building applications that require dynamic tool execution based on OpenAPI definitions.
How to use
To use openapi2mcptools, import the Converter class from the library, create an instance of it, and load your OpenAPI specifications. You can then retrieve the list of tools and set up an MCP server to handle requests for tool execution.
Key features
Key features of openapi2mcptools include the ability to convert OpenAPI specifications into MCP tools, support for custom HTTP clients, and a structured way to define and handle tool requests and responses.
Where to use
openapi2mcptools can be used in software development environments where there is a need to integrate OpenAPI specifications with MCP servers, particularly in applications requiring model context management.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Openapi2mcptools
openapi2mcptools is a utility library designed to convert OpenAPI specifications into tools compatible with the Model Context Protocol (MCP), facilitating faster development of MCP servers based on OpenAPI specifications.
Use cases
Use cases for openapi2mcptools include developing APIs that need to be compliant with OpenAPI standards while also leveraging the capabilities of MCP, creating tools for automated testing of APIs, and building applications that require dynamic tool execution based on OpenAPI definitions.
How to use
To use openapi2mcptools, import the Converter class from the library, create an instance of it, and load your OpenAPI specifications. You can then retrieve the list of tools and set up an MCP server to handle requests for tool execution.
Key features
Key features of openapi2mcptools include the ability to convert OpenAPI specifications into MCP tools, support for custom HTTP clients, and a structured way to define and handle tool requests and responses.
Where to use
openapi2mcptools can be used in software development environments where there is a need to integrate OpenAPI specifications with MCP servers, particularly in applications requiring model context management.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
OPENAPI Specifications => MCP (Model Context Protocol) Tools
- 🔧 An utility library for converting OpenAPI specifications to MCP tools.
- 🚀 Faster the development of MCP servers based on OPENAPI specifications.
Usage
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import {
CallToolRequestSchema,
ListToolsRequestSchema,
} from '@modelcontextprotocol/sdk/types.js';
import { Converter } from 'openapi2mcptools';
const converter = new Converter({
baseURL, // optional
httpClient // optional
});
await converter.load({
// specs
});
const tools = converter.getToolsList();
const toolCaller = converter.getToolsCaller();
const server = new Server(
{
name: 'mcp-server-openapi',
version: '1.0.0',
},
{
capabilities: {
tools: {},
},
},
);
// Define available tools
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools,
};
});
// Handle tool execution
server.setRequestHandler(CallToolRequestSchema, async (request) => {
return await toolCaller(request);
});
const transport = new StdioServerTransport();
await server.connect(transport);
Custom client
Set baseURL, headers, etc for http client.
export type RequestConfig = {
url?: string;
method?: string;
headers?: any;
params?: any;
data?: any;
}
export interface HTTPClient {
request: (requestConfig: RequestConfig) => Promise<{ data: any }>;
}
Example:
import axios from axios;
import { Converter } from 'openapi2mcptools';
const converter = new Converter({
httpClient: axios
});
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










