mcp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HelperConfig

type HelperConfig struct {
	Command string
	Args    []string
	Env     map[string]string
}

HelperConfig represents the configuration for a credential helper command.

type HelperOutput

type HelperOutput struct {
	Headers   map[string]string `json:"headers"`
	ExpiresAt *time.Time        `json:"expires_at,omitempty"`
}

HelperOutput represents the JSON output from a credential helper command.

type HelperTransport

type HelperTransport struct {
	// contains filtered or unexported fields
}

HelperTransport is a custom http.RoundTripper that executes a credential helper command to dynamically generate HTTP headers for MCP server requests.

func NewHelperTransport

func NewHelperTransport(cfg HelperConfig, staticHeaders map[string]string, base http.RoundTripper) *HelperTransport

NewHelperTransport creates a new HelperTransport. staticHeaders are applied first, then helper-generated headers override them. If base is nil, http.DefaultTransport is used.

func (*HelperTransport) RoundTrip

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

RoundTrip implements http.RoundTripper. It retrieves headers from the credential helper (using cache when valid) and injects them into the request.

Jump to

Keyboard shortcuts

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