gateway

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	Tools             []ToolRegistration
	Prompts           []PromptRegistration
	Resources         []ResourceRegistration
	ResourceTemplates []ResourceTemplateRegistration
}

func (*Capabilities) PromptNames

func (caps *Capabilities) PromptNames() []string

func (*Capabilities) ToolNames

func (caps *Capabilities) ToolNames() []string

type Config

type Config struct {
	Options
	ServerNames        []string
	CatalogPath        []string
	ConfigPath         []string
	RegistryPath       []string
	ToolsPath          []string
	SecretsPath        string
	MCPRegistryServers []catalog.Server // catalog.Server objects from MCP registries
}

type Configuration

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

func (*Configuration) DockerImages

func (c *Configuration) DockerImages() []string

func (*Configuration) Find

func (c *Configuration) Find(serverName string) (*catalog.ServerConfig, *map[string]catalog.Tool, bool)

func (*Configuration) ServerNames

func (c *Configuration) ServerNames() []string

type Configurator

type Configurator interface {
	Read(ctx context.Context) (Configuration, chan Configuration, func() error, error)
}

type FileBasedConfiguration

type FileBasedConfiguration struct {
	CatalogPath        []string
	ServerNames        []string // Takes precedence over the RegistryPath
	RegistryPath       []string
	ConfigPath         []string
	ToolsPath          []string
	SecretsPath        string           // Optional, if not set, use Docker Desktop's secrets API
	OciRef             []string         // OCI references to fetch server definitions from
	MCPRegistryServers []catalog.Server // Servers fetched from MCP registries
	Watch              bool
	McpOAuthDcrEnabled bool
	// contains filtered or unexported fields
}

func (*FileBasedConfiguration) Read

type Gateway

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

func NewGateway

func NewGateway(config Config, docker docker.Client) *Gateway

func (*Gateway) GetSessionCache

func (g *Gateway) GetSessionCache(ss *mcp.ServerSession) *ServerSessionCache

GetSessionCache returns the cached information for a server session

func (*Gateway) ListRoots

func (g *Gateway) ListRoots(ctx context.Context, ss *mcp.ServerSession)

ListRoots checks if client supports Roots, gets them, and caches the result

func (*Gateway) RefreshCapabilities

func (g *Gateway) RefreshCapabilities(ctx context.Context, server *mcp.Server, serverSession *mcp.ServerSession, serverName string) error

RefreshCapabilities implements the CapabilityRefresher interface This method updates the server's capabilities by reloading the configuration

func (*Gateway) RemoveSessionCache

func (g *Gateway) RemoveSessionCache(ss *mcp.ServerSession)

RemoveSessionCache removes the cached information for a server session

func (*Gateway) Run

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

type Options

type Options struct {
	Port                    int
	Transport               string
	ToolNames               []string
	Interceptors            []string
	OciRef                  []string
	Verbose                 bool
	LongLived               bool
	DebugDNS                bool
	LogCalls                bool
	BlockSecrets            bool
	BlockNetwork            bool
	VerifySignatures        bool
	DryRun                  bool
	Watch                   bool
	Cpus                    int
	Memory                  string
	Static                  bool
	OAuthInterceptorEnabled bool
	McpOAuthDcrEnabled      bool
	DynamicTools            bool
	LogFilePath             string
}

type PromptRegistration

type PromptRegistration struct {
	ServerName string
	Prompt     *mcp.Prompt
	Handler    mcp.PromptHandler
}

type ResourceRegistration

type ResourceRegistration struct {
	ServerName string
	Resource   *mcp.Resource
	Handler    mcp.ResourceHandler
}

type ResourceTemplateRegistration

type ResourceTemplateRegistration struct {
	ServerName       string
	ResourceTemplate mcp.ResourceTemplate
	Handler          mcp.ResourceHandler
}

type ServerCapabilities

type ServerCapabilities struct {
	ToolNames            []string
	PromptNames          []string
	ResourceURIs         []string
	ResourceTemplateURIs []string
}

ServerCapabilities tracks the capabilities registered for a specific server

type ServerMatch

type ServerMatch struct {
	Name   string
	Server catalog.Server
	Score  int
}

ServerMatch represents a search result

type ServerSessionCache

type ServerSessionCache struct {
	Roots []*mcp.Root
}

type ToolRegistration

type ToolRegistration struct {
	ServerName string
	Tool       *mcp.Tool
	Handler    mcp.ToolHandler
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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