Get the FREE Ultimate OpenClaw Setup Guide →

openapi

MCP server for OpenAPI

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository
  1. Install dependencies
  • npm install
  1. 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
  1. 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

Sponsor this space

Reach thousands of developers