OPENAPI Specifications => MCP (Model Context Protocol) Tools
OpenAPI specifications => MCP (Model Context Protocol) tools
Overview
openapi2mcptools is a utility library designed for converting OpenAPI specifications into tools compatible with the Model Context Protocol (MCP), streamlining the development of MCP servers based on OpenAPI specifications.
To use openapi2mcptools, import the Converter class from the library, load your OpenAPI specifications, and define your MCP server to handle requests using the converted tools.
- Converts OpenAPI specifications to MCP-compatible tools. - Simplifies the creation of MCP servers based on OpenAPI. - Customizable HTTP client options for flexibility in requests.
- Rapid development of MCP servers using existing OpenAPI documentation.
- Integration of MCP tools in applications leveraging OpenAPI frameworks.
- Automating the translation between OpenAPI specs and MCP functionalities.
Add to your AI client
Use these steps to connect OPENAPI Specifications => MCP (Model Context Protocol) Tools in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"openapi2mcptools-2013xile": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-openapi2mcptools-2013xile"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"openapi2mcptools-2013xile": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-openapi2mcptools-2013xile"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"openapi2mcptools-2013xile": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-openapi2mcptools-2013xile"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"openapi2mcptools-2013xile": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-openapi2mcptools-2013xile"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"openapi2mcptools-2013xile": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-openapi2mcptools-2013xile"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"openapi2mcptools-2013xile": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-openapi2mcptools-2013xile"
]
}
}
}FAQ
Is openapi2mcptools suitable for all types of APIs?
Yes, it effectively converts a wide range of OpenAPI specifications into MCP tools.
Can I customize the HTTP client used in the library?
Yes, the library allows you to set custom HTTP client configurations such as base URL and headers.
What programming language is openapi2mcptools compatible with?
The library is built for TypeScript but can easily be integrated into JavaScript environments.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":385,"uuid":"68b8bc9d-898c-4f55-8b91-197643c5fd1c","name":"openapi2mcptools","title":"OPENAPI Specifications => MCP (Model Context Protocol) Tools","description":"OpenAPI specifications => MCP (Model Context Protocol) tools","avatar_url":"https://avatars.githubusercontent.com/u/3250534?v=4","created_at":"$D2024-12-13T13:26:28.861Z","updated_at":"$D2024-12-13T15:09:10.031Z","status":"created","author_name":"2013xile","author_avatar_url":"https://avatars.githubusercontent.com/u/3250534?v=4","tags":"mcp,openapi,mcp-server,modelcontextprotocol,mcp-tools","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/2013xile/openapi2mcptools","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":null,"user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]