openapi2mcp

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MCP proxy modes, matching the ai-mcp-proxy plugin's PLUGIN_MODES (kong-ee).
	ModePassthroughListener = "passthrough-listener"
	ModeConversionListener  = "conversion-listener"
	ModeConversionOnly      = "conversion-only"
	ModeListener            = "listener"

	// ModeConversion is a deprecated alias for ModeConversionOnly. It was never
	// a real ai-mcp-proxy mode - callers should use ModeConversionOnly instead.
	ModeConversion = "conversion"
)

Variables

This section is empty.

Functions

func Convert

func Convert(content []byte, opts O2MOptions) (map[string]interface{}, error)

Convert converts an OpenAPI spec to a Kong declarative file with MCP configuration.

func MustConvert

func MustConvert(content []byte, opts O2MOptions) map[string]interface{}

MustConvert is the same as Convert, but will panic if an error is returned.

Types

type O2MOptions

type O2MOptions struct {
	// Array of tags to mark all generated entities with, taken from 'x-kong-tags' if omitted.
	Tags []string
	// Base document name, will be taken from x-kong-name, or info.title (for UUID generation!)
	DocName string
	// Namespace for UUID generation, defaults to DNS namespace for UUID v5
	UUIDNamespace uuid.UUID
	// Skip ID generation (UUIDs)
	SkipID bool
	// MCP proxy mode: one of "passthrough-listener", "conversion-listener",
	// "conversion-only", or "listener". "conversion" is accepted as a
	// deprecated alias for "conversion-only".
	Mode string
	// Custom path prefix for the MCP route (default: /{service-name}-mcp)
	PathPrefix string
	// Also generate direct (non-MCP) routes for API access
	IncludeDirectRoute bool
	// Ignore security errors (unsupported schemes, missing x-kong-mcp-acl extension)
	IgnoreSecurityErrors bool
}

O2MOptions defines the options for an OpenAPI to MCP conversion operation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL