OpenAPI MCP Server
Talk to any OpenAPI (v3.1) compliant API through Claude Desktop!
This is a Model Context Protocol (MCP) server that reads an OpenAPI specification file and exposes each API operation as a tool for Claude AI to use. It acts as a proxy for any API that has an OpenAPI v3.1 specification, allowing you to use Claude Desktop to easily interact with both local and remote server APIs.
🚀 Features
- Automatic OpenAPI Parsing: Automatically parses OpenAPI YAML files
- Dynamic Tool Generation: Generates MCP tools for each API operation
- Parameter Handling: Handles path parameters, query parameters, and request bodies
- Live API Calls: Makes real API calls when Claude uses the tools
- Easy Integration: Simple integration with Claude Desktop
- Error Recovery: Intelligent YAML error recovery and fixing
- Authentication Support: Built-in support for API key authentication
📦 Installation
Quick Start with npx
npx openapi-mcp-server /path/to/your/openapi.yaml
Global Installation
npm install -g openapi-mcp-server
Local Development
# Clone the repository
git clone https://github.com/yourusername/openapi-mcp-server.git
cd openapi-mcp-server
# Install dependencies
npm install
# Run tests
npm test
🔧 Usage
1. Prepare Your OpenAPI Specification
Place your OpenAPI YAML file in the project directory or provide a path to it via environment variables.
2. Set Up Environment Variables (Optional)
# Create a .env file
echo "DEBUG=true" > .env
echo "OPENAPI_FILE=./path/to/your/openapi.yaml" >> .env
echo "HTTP_HEADERS_X_API_KEY=your_api_key_here" >> .env
3. Initialize with Claude Desktop
npm run init
4. Or Run the Server Manually
npm start
⚙️ Configuration
You can configure the server using environment variables:
DEBUG: Set totrueto enable debug logging (default:false)OPENAPI_FILE: Path to your OpenAPI YAML file (default:./openapi.yaml)HTTP_HEADERS_X_API_KEY: API key for authentication (optional)
🔄 How it Works
The server reads your OpenAPI specification file and:
- Extracts all paths and operations
- Creates a tool for each operation with appropriate input schemas
- When Claude calls a tool, the server makes the corresponding API request
- The response is returned to Claude for analysis
📋 Example
With an OpenAPI spec like:
paths:
/users:
get:
operationId: listUsers
summary: List all users
responses:
'200':
description: List of users
Claude can call the listUsers tool, and the server will make a GET request to /users on your behalf.
🧪 Testing
This project includes comprehensive unit and integration tests:
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
Test Coverage
- Unit Tests: Core functionality like OpenAPI parsing, validation, and URL building
- Integration Tests: End-to-end testing of OpenAPI file processing
- Server Tests: Verification of server configuration and dependencies
🚀 Development
Prerequisites
- Node.js 18.x or higher
- npm 8.x or higher
Setup
# Install dependencies
npm install
# Run tests
npm test
# Start development server
npm start
Project Structure
openapi-mcp-server/
├── openapi-mcp.js # Main server file
├── openapi.yaml # Sample OpenAPI specification
├── package.json # Project configuration
├── vitest.config.js # Test configuration
├── test/ # Test files
│ ├── utils.test.js # Unit tests for utilities
│ ├── integration.test.js # Integration tests
│ └── server.test.js # Server configuration tests
└── .github/
└── workflows/
└── ci.yml # GitHub Actions CI/CD
🔒 Security
- API keys are handled securely through environment variables
- Input validation for all API parameters
- Error handling to prevent information leakage
- YAML parsing with error recovery
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Write tests for new features
- Follow the existing code style
- Update documentation as needed
- Ensure all tests pass before submitting
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Model Context Protocol for the MCP specification
- OpenAPI Initiative for the OpenAPI specification
- Anthropic for Claude AI
📞 Support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue if your problem isn’t already reported
- Provide as much detail as possible, including:
- Your OpenAPI specification (sanitized)
- Error messages
- Environment details
Made with ❤️ for the Claude AI community
OpenAPI Proxy Server
Project Details
- fellipesaraiva88/waha-api-mcp-server
- MIT License
- Last Updated: 6/13/2025
Recomended MCP Servers
LSD Model Context Protocol
Model Context Protocol server for Sitecore
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and...
Connect Claude to Linear project management systems. Retrieve, create, and manage issues and projects seamlessly.
An MCP server that provides LLMs with the latest stable package versions when coding
challenge 5 activity
An MCP server that provides control over Android devices via adb
Agentic tool that looks for statistical variations in conversation structure and logs unusual events to a SQLite database.
bluetooth-mcp-server for Claude AI
A Model Context Protocol (MCP) server that provides tools for AI, allowing it to interact with the DataWorks...
A MCP server that analyzes web site performance using Playwright and Lighthouse.





