# OpenAPI MCP Server
Core MCP (Model Context Protocol) server implementation for OpenAPI-defined APIs.
This package contains the awslabs openapi-mcp-server code that creates MCP tools and resources from OpenAPI specifications.
## Features
- Creates MCP tools from OpenAPI operations
- Supports multiple authentication types:
- None (public APIs)
- Basic Auth
- Bearer Token
- API Key (header/query/cookie)
- AWS Cognito
- Zoho OAuth
- OpenAPI spec validation and parsing
- Dynamic tool generation from API endpoints
## Installation
```bash
uv pip install -e packages/mcp-server
```
## Usage
### Command Line
```bash
awslabs.openapi-mcp-server \
--api-name MyAPI \
--api-url https://api.example.com \
--spec-url https://api.example.com/openapi.json
```
### As a Library
```python
from awslabs.openapi_mcp_server.server import create_server
server = create_server(
api_name="MyAPI",
api_base_url="https://api.example.com",
spec_url="https://api.example.com/openapi.json"
)
```
## Testing
```bash
cd packages/mcp-server
uv run pytest tests/ -v
```
## Authentication
Configure authentication via environment variables:
- `AUTH_TYPE`: Authentication method (none, basic, bearer, api_key, cognito, zoho)
- `AUTH_TOKEN`: Bearer token (for bearer auth)
- `AUTH_USERNAME`, `AUTH_PASSWORD`: Basic auth credentials
- `AUTH_API_KEY`, `AUTH_API_KEY_NAME`, `AUTH_API_KEY_IN`: API key configuration
- Cognito and Zoho specific variables (see main docs)
## License
Apache-2.0 - Includes code from [awslabs/mcp](https://github.com/awslabs/mcp)