openapi
MCP server for OpenAPI
claude mcp add --transport stdio onewalker-openapi-mcp-server node build/index.js \ --env PORT="8000" \ --env OPENAPI_PATH="./example.yaml" \ --env BASE_SERVER_URL="https://api.example.com"
How to use
This MCP server provides a standardized RESTful interface to interact with model services described by an OpenAPI document. It adheres to the Model Context Protocol (MCP) and uses a StreamableHTTP transport implementation to efficiently stream data to and from model services. The server loads its configuration from an OpenAPI spec and exposes endpoints to retrieve documentation for individual model services as well as to invoke those services with the required parameters. With the provided .env configuration, you can tailor the base API URL, point to your OpenAPI file (local or remote), and set the port for the MCP server to listen on. The core capabilities include: retrieving OpenAPI-based documentation for model services, and invoking model services by posting parameter payloads to the correct endpoints. The server is implemented in TypeScript, built to ensure type safety and easier integration into your MCP ecosystem.
How to install
Prerequisites:
- Node.js v20 or higher
- npm v6 or higher
Steps:
- Clone the repository
- git clone https://github.com/oneWalker/openapi-mcp-server.git
- cd openapi-mcp-server
- Install dependencies
- npm install
- Configure environment variables
- Create a .env file in the project root and set at least the following: BASE_SERVER_URL=https://api.example.com OPENAPI_PATH=./example.yaml (or a URL to your OpenAPI spec) PORT=8000
- Build and run the server
- npm run build
- npm run start
Optionally, for development workflows you can also run in watch mode:
- npm run watch
Additional notes
Tips and notes:
- The server expects an OpenAPI specification to drive the available model service endpoints. Ensure OPENAPI_PATH points to a valid OpenAPI document.
- The BASE_SERVER_URL should be the base URL of the underlying original API you are exposing through the MCP.
- If you encounter port conflicts, adjust PORT in the .env file.
- The project depends on the openapi-mcp-generator and @modelcontextprotocol/sdk; note that there may be pending fixes in openapi-mcp-generator as indicated in the dependencies section.
- The implementation uses Express and TypeScript; ensure your environment can compile TypeScript during build.
- Logs and error messages typically indicate configuration issues with the OpenAPI document or environment variables.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.