
openapi2mcptools
OpenAPI specifications => MCP (Model Context Protocol) tools
3 years
Works with Finder
1
Github Watches
3
Github Forks
12
Github Stars
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
});
相关推荐
I find academic articles and books for research and literature reviews.
Teach you all the details related to YouTube. Solve all your YouTube-related issues.
Professional Flask/SQLAlchemy code guide. Follow: https://x.com/navid_re
Confidential guide on numerology and astrology, based of GG33 Public information
Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.
Converts Figma frames into front-end code for various mobile frameworks.
Anime-inspired editor adept at rewriting with new style, keeping core content.
本项目是一个钉钉MCP(Message Connector Protocol)服务,提供了与钉钉企业应用交互的API接口。项目基于Go语言开发,支持员工信息查询和消息发送等功能。
A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.
Mirror ofhttps://github.com/suhail-ak-s/mcp-typesense-server
Reviews

user_hvqHmsKD
As a dedicated MCP application user, I highly recommend the MCP-Recon-Server by seyrup1987. This server has significantly improved my experience by providing reliable and high-performance resources for my projects. The installation was straightforward, and the user interface is intuitive. Excellent product overall!