gateway

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gateway

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

Gateway represents an MCP gateway that proxies to multiple MCP servers

func NewGateway

func NewGateway(config GatewayConfig) (*Gateway, error)

NewGateway creates a new MCP gateway from configuration

func (*Gateway) Close

func (g *Gateway) Close() error

Close closes all client connections

func (*Gateway) Start

func (g *Gateway) Start(ctx context.Context) error

Start starts the gateway HTTP server and connects to all configured MCP servers

type GatewayConfig

type GatewayConfig struct {
	MCPServers       map[string]MCPServerConfig `json:"mcpServers"`
	Port             int                        `json:"port"`
	APIKey           string                     `json:"apiKey,omitempty"`
	SafeInputsConfig string                     `json:"-"` // Path to safe-inputs tools.json file
}

GatewayConfig represents the configuration for the MCP gateway

func LoadConfigFromJSON

func LoadConfigFromJSON(filename string) (GatewayConfig, error)

LoadConfigFromJSON loads gateway configuration from a JSON file

func LoadConfigFromReader

func LoadConfigFromReader(r io.Reader) (GatewayConfig, error)

LoadConfigFromReader loads gateway configuration from an io.Reader

type MCPServerConfig

type MCPServerConfig struct {
	Type      string            `json:"type,omitempty"`
	Command   string            `json:"command,omitempty"`
	Container string            `json:"container,omitempty"`
	Args      []string          `json:"args,omitempty"`
	Env       map[string]string `json:"env,omitempty"`
	URL       string            `json:"url,omitempty"`
}

MCPServerConfig represents a single MCP server configuration

Jump to

Keyboard shortcuts

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