This repository provides an OpenAPI MCP server, enabling Large Language Models to interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol. It simplifies API discovery and
This repository hosts an OpenAPI MCP server, enabling Large Language Models to interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol (MCP). It allows LLMs to discover and utilize REST APIs.
To use this server, configure it within Claude Desktop by modifying the claude_desktop_config.json
file. Add the provided JSON configuration snippet, replacing placeholder environment variables like API_BASE_URL
, OPENAPI_SPEC_PATH
, and API_HEADERS
with your actual API details.
The project offers several tools: npm run build
builds the TypeScript source, npm run clean
removes build artifacts, npm run typecheck
performs type checking, npm run dev
watches for changes and rebuilds, npm run inspect-watch
runs the inspector with auto-reload, and npm run lint
executes ESLint.
The server is configurable via environment variables (API_BASE_URL
, OPENAPI_SPEC_PATH
, API_HEADERS
, SERVER_NAME
, SERVER_VERSION
) or command-line arguments.
Start the development environment with npm run inspect-watch
, modify TypeScript files in src/
, and the server will automatically rebuild. Use the MCP Inspector UI to test changes.
Debug logs are outputted to stderr. In development mode, logs appear in the terminal running inspect-watch
.
Fork the repository, create a feature branch, make changes, run npm run typecheck
and npm run lint
, and submit a pull request.
MIT
ivo-toby/mcp-openapi-server
December 5, 2024
March 27, 2025
JavaScript