adapter

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportGRPC

func ImportGRPC(s *gomcp.Server, conn *grpc.ClientConn, opts GRPCOptions) error

ImportGRPC discovers gRPC services via server reflection and registers each unary method as an MCP tool. Streaming methods are skipped.

func ImportGin

func ImportGin(s *gomcp.Server, engine *gin.Engine, opts ImportOptions)

ImportGin scans a gin.Engine's registered routes and registers each as an MCP Tool. Path params become required string params; query/body are passed through.

func ImportOpenAPI

func ImportOpenAPI(s *gomcp.Server, filePath string, opts OpenAPIOptions) error

ImportOpenAPI parses an OpenAPI 3.x file and registers each operation as an MCP Tool.

Types

type GRPCOptions

type GRPCOptions struct {
	Services   []string // filter to these service names (empty = all)
	NamingFunc func(service, method string) string
}

GRPCOptions controls gRPC import behavior.

type ImportOptions

type ImportOptions struct {
	IncludePaths []string                         // glob-like prefixes to include (e.g. "/api/v1/*")
	ExcludePaths []string                         // glob-like prefixes to exclude
	NamingFunc   func(method, path string) string // custom tool name generator
}

ImportOptions controls which Gin routes are imported as MCP tools.

type OpenAPIOptions

type OpenAPIOptions struct {
	TagFilter  []string // only import operations with these tags
	ServerURL  string   // base URL for API calls
	AuthToken  string   // Bearer token for API calls
	NamingFunc func(operationID, method, path string) string
}

OpenAPIOptions controls OpenAPI import behavior.

Jump to

Keyboard shortcuts

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