OpenAPI

by ivo-toby

62 stars
354 downloads
Not rated
GitHub

About

Integrates with OpenAPI specifications to expose REST API endpoints as MCP resources, enabling dynamic discovery and utilization of many web services.

Details

Author
ivo-toby
Repository
ivo-toby/mcp-openapi-server
GitHub stars
62
Downloads
354
License
MIT License
Categories
AI, Design, Developer Tools, Search, API, Infrastructure, Frontend, Security, Other

- Exposes OpenAPI endpoints as MCP tools automatically
- Supports loading OpenAPI specs via URL, file, stdin, or inline
- Two transports: stdio (default) and Streamable HTTP
- Mutual TLS (mTLS) support for upstream API authentication
- Tool loading modes: all, dynamic, or explicit
- Filtering by tags and custom headers

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name OpenAPI
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @ivotoby/openapi-mcp-server
    Environment
    • API_HEADERS Authorization:Bearer token123,X-API-Key:your-api-key
    • API_BASE_URL https://api.example.com
    • OPENAPI_SPEC_PATH https://api.example.com/openapi.json

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

The server can be configured through environment variables or command line arguments:

- API_BASE_URL - Base URL for the API endpoints
- OPENAPI_SPEC_PATH - Path or URL to OpenAPI specification
- OPENAPI_SPEC_FROM_STDIN - Set to "true" to read OpenAPI spec from standard input
- OPENAPI_SPEC_INLINE - Provide OpenAPI spec content directly as a string
- API_HEADERS - Comma-separated key:value pairs for API headers
- CLIENT_CERT_PATH - Path to client certificate PEM file for mutual TLS
- CLIENT_KEY_PATH - Path to client private key PEM file for mutual TLS
- CA_CERT_PATH - Path to custom CA certificate PEM file for private/internal CAs
- CLIENT_KEY_PASSPHRASE - Passphrase for an encrypted client private key
- REJECT_UNAUTHORIZED - Whether to reject untrusted server certificates (default: true)
- SERVER_NAME - Name for the MCP server (default: "mcp-openapi-server")
- SERVER_VERSION - Version of the server (default: "1.0.0")
- TRANSPORT_TYPE - Transport type to use: "stdio" or "http" (default: "stdio")
- HTTP_PORT - Port for HTTP transport (default: 3000)
- HTTP_HOST - Host for HTTP transport (default: "127.0.0.1")
- ENDPOINT_PATH - Endpoint path for HTTP transport (default: "/mcp")
- TOOLS_MODE - Tools loading mode: "all" (load all endpoint-based tools), "dynamic" (load only meta-tools), or "explicit" (load only tools specified in includeTools) (default: "all")
- DISABLE_ABBREVIATION - Disable name optimization (this could throw errors when name is > 64 chars)
- VERBOSE - Enable operational logging (true by default; set to false to suppress non-essential logs)
- PROMPTS_PATH - Path or URL to prompts JSON/YAML file
- PROMPTS_INLINE - Provide prompts directly as JSON string
- RESOURCES_PATH - Path or URL to resources JSON/YAML file
- RESOURCES_INLINE - Provide resources directly as JSON string

export OPENAPI_SPEC_INLINE='{"openapi": "3.0.0", ...}'
npx @ivotoby/openapi-mcp-server --api-base-url https://api.example.com


For containerized deployments, you can mount OpenAPI specs or use stdin:

bash

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "openapi": {
            "env": {
                "API_HEADERS": "Authorization:Bearer token123,X-API-Key:your-api-key",
                "API_BASE_URL": "https://api.example.com",
                "OPENAPI_SPEC_PATH": "https://api.example.com/openapi.json"
            },
            "args": [
                "-y",
                "@ivotoby/openapi-mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": {
        "API_HEADERS": "Authorization:Bearer token123,X-API-Key:your-api-key",
        "API_BASE_URL": "https://api.example.com",
        "OPENAPI_SPEC_PATH": "https://api.example.com/openapi.json"
    },
    "args": [
        "-y",
        "@ivotoby/openapi-mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": {
        "API_HEADERS": "Authorization:Bearer token123,X-API-Key:your-api-key",
        "API_BASE_URL": "https://api.example.com",
        "OPENAPI_SPEC_PATH": "https://api.example.com/openapi.json"
    },
    "args": [
        "-y",
        "@ivotoby/openapi-mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": {
        "API_HEADERS": "Authorization:Bearer token123,X-API-Key:your-api-key",
        "API_BASE_URL": "https://api.example.com",
        "OPENAPI_SPEC_PATH": "https://api.example.com/openapi.json"
    },
    "args": [
        "/c",
        "npx",
        "-y",
        "@ivotoby/openapi-mcp-server"
    ],
    "command": "cmd"
}

OpenAPI MCP Server

smithery badge

A Model Context Protocol (MCP) server that exposes OpenAPI endpoints as MCP tools, along with optional support for MCP prompts and resources. This server allows Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the MCP protocol.

📖 Documentation

- User Guide - For users wanting to use this MCP server with Claude Desktop, Cursor, or other MCP clients
- Library Usage - For developers creating custom MCP servers using this package as a library
- Developer Guide - For contributors and developers working on the codebase
- AuthProvider Guide - Detailed authentication patterns and examples

---

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.