Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Openapi2mcptools

FreeNot checked

OpenAPI specifications => MCP (Model Context Protocol) tools

GitHubEmbed

About

OpenAPI specifications => MCP (Model Context Protocol) tools

README

  • 🔧 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
});

from github.com/2013xile/openapi2mcptools

Installing Openapi2mcptools

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/2013xile/openapi2mcptools

FAQ

Is Openapi2mcptools MCP free?

Yes, Openapi2mcptools MCP is free — one-click install via Unyly at no cost.

Does Openapi2mcptools need an API key?

No, Openapi2mcptools runs without API keys or environment variables.

Is Openapi2mcptools hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Openapi2mcptools in Claude Desktop, Claude Code or Cursor?

Open Openapi2mcptools on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Openapi2mcptools with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs