internal

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Command is a variable that allows overriding the command creation for testing
	CommandContext = exec.CommandContext
	// LookPath is a variable that allows overriding the lookup behavior for testing
	LookPath = exec.LookPath
)

Functions

func RegisterTools added in v0.6.0

func RegisterTools(server *mcp.Server, specData []byte, client *http.Client, opts ...RegisterToolsOption) error

RegisterTools parses the given OpenAPI specification and registers tools on the provided MCP server. All HTTP calls are executed using the provided http.Client. If the client is nil, http.DefaultClient is used. By default, REST-aware MCP ToolAnnotations are attached to each tool. Pass options to change behavior.

func ResolveSecretReference

func ResolveSecretReference(ctx context.Context, value string) (string, bool, error)

ResolveSecretReference attempts to resolve a 1Password secret reference (e.g. op://vault/item/field) Returns the resolved value and whether it was a secret reference

func RetryableClient

func RetryableClient(opts RetryableClientOptions) (*http.Client, error)

RetryableClient returns a new http.Client with a retryablehttp.Client configured per opts.

Types

type HeaderTransport

type HeaderTransport struct {
	Base    http.RoundTripper
	Headers http.Header
}

HeaderTransport is a custom RoundTripper that adds default headers to requests

func (*HeaderTransport) RoundTrip

func (t *HeaderTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip adds the default headers to the request

type RegisterToolsOption added in v0.6.1

type RegisterToolsOption func(*registerToolsConfig)

RegisterToolsOption configures RegisterTools behavior.

func WithoutAnnotations added in v0.6.1

func WithoutAnnotations() RegisterToolsOption

WithoutAnnotations disables attaching REST-aware MCP ToolAnnotations for generated tools.

type RetryableClientOptions added in v0.7.0

type RetryableClientOptions struct {
	Retries  int
	Timeout  time.Duration
	RPS      int
	Logger   interface{}
	Insecure bool
}

RetryableClientOptions configures the retryable HTTP client.

Jump to

Keyboard shortcuts

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