Help us shape the future of Go! Take the 2026 Go Developer Survey

mcpproxy

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPProxy

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

MCPProxy serves /mcp endpoint.

This implements [extproc.ConfigReceiver] to gets the up-to-date configuration.

type ProxyConfig

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

ProxyConfig holds the main MCP proxy configuration.

func NewMCPProxy

func NewMCPProxy(l *slog.Logger, mcpMetrics metrics.MCPMetrics, tracer tracing.MCPTracer, sessionCrypto SessionCrypto) (*ProxyConfig, *http.ServeMux, error)

NewMCPProxy creates a new MCPProxy instance.

func (*ProxyConfig) LoadConfig

func (p *ProxyConfig) LoadConfig(_ context.Context, config *filterapi.Config) error

LoadConfig implements [extproc.ConfigReceiver.LoadConfig] which will be called when the configuration is updated on the file system.

type SessionCrypto

type SessionCrypto interface {
	// Encrypt encrypts the given plaintext string and returns ciphertext.
	Encrypt(plaintext string) (string, error)
	// Decrypt decrypts the given ciphertext string and returns plaintext bytes.
	Decrypt(encrypted string) (string, error)
}

SessionCrypto provides methods to encrypt and decrypt session data.

func DefaultSessionCrypto

func DefaultSessionCrypto(seed, fallbackSeed string) SessionCrypto

DefaultSessionCrypto returns a SessionCrypto implementation using PBKDF2 for key derivation and AES-GCM for encryption.

Jump to

Keyboard shortcuts

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