npm package: @ryancardin/openapi-spec-master-mcp
Description: MCP server for OpenAPI-Spec-Master
Author: Ryan Cardin
Latest version: 1.1.3

# 🚀 OpenAPI Spec Master MCP Server 🚀

[![Open in Cursor](https://cursor.sh/assets/images/badge.svg)](https://cursor.sh/gh/RyanCardin15/OpenAPI-Spec-Master-MCP)

Welcome to the **OpenAPI Spec Master MCP Server**! This server provides a powerful set of tools to work with your OpenAPI specifications, all accessible through the Model Context Protocol (MCP).

## ⚡ Quick Start ⚡

Get up and running in a flash with `npx`:

```bash
npx @ryancardin/openapi-spec-master-mcp@latest
```

This command fires up the MCP server using the **STDIO** transport by default. This is ideal for local development and integration with tools that use standard input/output.

For remote access or use cases requiring an HTTP interface, you can start the server in HTTP mode:
```bash
npx @ryancardin/openapi-spec-master-mcp@latest http
```

## ⚙️ Configuration ⚙️

You can configure the server using command-line arguments and environment variables:

-   **Transport (Command-Line Argument)**:
    -   (default): Starts the server with `stdio` transport.
    -   `http`: Starts an HTTP server.
-   **`PORT` (Environment Variable)**: Set the port for the HTTP server (defaults to `3001`).

### Examples

**Running with STDIO (default):**
```bash
npx @ryancardin/openapi-spec-master-mcp@latest
```

**Running with HTTP:**
```bash
npx @ryancardin/openapi-spec-master-mcp@latest http
```

**Running with a specific port for HTTP:**
```bash
PORT=8080 npx @ryancardin/openapi-spec-master-mcp@latest http
```

## 🛠️ Tools 🛠️

This server exposes a rich set of tools for deep interaction with OpenAPI specifications. Once the server is running, your AI assistant can leverage the following capabilities:

| Tool Name | Description |
| --- | --- |
| `load_openapi_spec` | Load and parse an OpenAPI specification from text, URL, or file content. |
| `get_api_overview` | Get a comprehensive overview of the loaded API including basic info, statistics, and analytics. |
| `search_endpoints` | Search and filter API endpoints with advanced criteria. |
| `get_endpoint_details` | Get detailed information about a specific endpoint. |
| `generate_code_examples`| Generate code examples for specific endpoints in various languages. |
| `get_api_analytics` | Get comprehensive analytics and insights about the API. |
| `validate_api_design` | Analyze the API design and provide recommendations for improvements. |
| `export_documentation` | Export API documentation in various formats. |
| `search_request_body_properties` | Deep search through request body schemas to find specific properties, types, or patterns. |
| `generate_typescript_types` | Generate TypeScript interfaces and types from OpenAPI schemas. |
| `find_schema_dependencies` | Trace and analyze schema references and dependencies throughout the API. |
| `validate_request_examples` | Validate that request/response examples match their schemas. |
| `extract_auth_patterns` | Analyze and extract authentication and authorization patterns across the API. |
| `generate_mock_data` | Generate realistic mock data based on OpenAPI schemas. |
| `find_unused_schemas` | Identify schemas that are defined but never referenced in the API. |
| `analyze_schema_evolution` | Analyze how schemas might evolve and suggest versioning strategies. |

### Example Workflow
1.  Use `load_openapi_spec` with the content of your OpenAPI file.
2.  Use `search_endpoints` to find endpoints related to "users".
3.  Use `get_endpoint_details` on a specific user endpoint.
4.  Use `generate_code_examples` to get a Python snippet for that endpoint.