openapi-to-mcp 0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global openapi-to-mcp --version 0.1.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local openapi-to-mcp --version 0.1.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=openapi-to-mcp&version=0.1.1
                    
nuke :add-package openapi-to-mcp --version 0.1.1
                    

.NET Build

openapi-to-mcp

Use your OpenAPI specification to expose your API's endpoints as strongly typed tools.

Example for https://petstore3.swagger.io/ 🎉

{
  "mcpServers": {
    "petstore": {
      "command": "openapi-to-mcp",
        "args": [
          "https://petstore3.swagger.io/api/v3/openapi.json"
        ]
    }
  }
}

Install

As a Nuget tool: openapi-to-mcp

dotnet tool install --global openapi-to-mcp

Or download the executables from the releases

Usage

Usage:
  openapi-to-mcp <open-api> [options]

Arguments:
  <open-api>  You OpenAPI specification (URL or file) [required]

Options:
  -h, --host-override                          Host override
  -b, --bearer-token                           Bearer token
  -o, -o2, --oauth-2-grant-type                OAuth2 flow to be used
  <client_credentials|password|refresh_token>
  -o2.tu, --oauth-2-token-url                  OAuth2 token endpoint URL (override the one defined in your OpenAPI for
                                               your chosen OAuth2 flow)
  -o2.ci, --oauth-2-client-id                  OAuth2 client id (for the client_credentials grant_type)
  -o2.cs, --oauth-2-client-secret              OAuth2 client secret (for the client_credentials grant_type)
  -o2.rt, --oauth-2-refresh-token              OAuth2 refresh token (for the refresh_token grant_type)
  -o2.un, --oauth-2-username                   OAuth2 username (for the password grant_type)
  -o2.pw, --oauth-2-password                   OAuth2 password (for the password grant_type)
  -?, -h, --help                               Show help and usage information
  -v, --version                                Show version information

Features

Category Feature Support Details
OpenAPI Versions v2.0, v3.0
Formats JSON, YAML
Sources file, URL
$refs Local, Remote
Base path Use the first server URL Prepend with the source URL host if relative
MCP Transport SDTIO
Tool's name Use the operationId Fallback to {httpMethod}_{escaped_path}. ⚠️Tool names >64 chars long are discarded
Tool's description Use the operation's description Fallback to path's description
Inputs Path params, Query params, JSON request bodies Use the JSONSchema from the OpenAPI specification
Outputs Textual responses (json, text, ...)
API Authorization Bearer Token As Authorization header
OAuth2 ClientCredentials, RefreshToken, Password Using the tokenUrl from the securitySchemes

How to publish

Create a new tag/release

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.4.0 277 5/12/2025
0.3.0 156 4/30/2025
0.2.0 165 4/29/2025
0.1.1 157 4/29/2025
0.1.0 156 4/29/2025