
openapi to tools
将 OpenAPI 规范转换为符合 MCP 标准的工具定义。
Repository Info
About This Server
将 OpenAPI 规范转换为符合 MCP 标准的工具定义。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
OpenAPI to Tools
This is a simple package to convert OpenAPI routes to tools to be used by MCP servers or other LLM applications.
Prerequisites
This project requires NodeJS (version 18 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
10.2.4
v20.11.0
Table of contents
- OpenAPI to Tools
- Prerequisites
- Table of contents
- Installation
- Usage
- CLI
- MCP Server
- Contributing
- Versioning
- License
Installation
BEFORE YOU INSTALL: please read the prerequisites
To install and set up the library, run:
$ npm install @buildwithlayer/openapi-to-tools
Or if you prefer using Yarn:
$ yarn add @buildwithlayer/openapi-to-tools
Usage
CLI
input_file_pathis a path to any valid OpenAPI Spec 3.X.Xoutput_file_pathis a path to a JSON file to write the tools
npx @buildwithlayer/openapi-to-tools <input_file_path> [-o <output_file_path>]
MCP Server
import {addAPIToolsPlugin} from '@buildwithlayer/openapi-to-tools/index.js';
import {apiTools} from './tools.json';
const server = new McpServer(
{
name: 'very-cool-server',
version: '1.0.0',
},
{
capabilities: {
tools: {},
},
},
);
// Add any manual tools
server.tool('hello-world', async () => ({
content: [
{
text: 'Hello, world!',
type: 'text',
},
],
}));
// Add the API tools (generated with CLI or using the library)
addAPIToolsPlugin(server, apiTools);
// Start receiving messages on stdin and sending messages on stdout
const transport = new StdioServerTransport();
await server.connect(transport);
Contributing
These instructions will be updated soon.
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests to us.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Add your changes:
git add . - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :sunglasses:
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
Currently, this is unlicensed and requires explicit permission to use. In the future, we will open up this license.
Quick Start
Clone the repository
git clone https://github.com/buildwithlayer/openapi-to-toolsInstall dependencies
cd openapi-to-tools
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.