Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureCacheDir ¶
EnsureCacheDir creates the cache directory if it doesn't exist.
func ParseConfig ¶
func ParseConfig() (*types.ProxyConfig, error)
ParseConfig parses proxy configuration from environment variables.
func RegisterUpstreamTools ¶
RegisterUpstreamTools attempts to connect to configured upstreams and register their tools. This function supports two modes controlled by the fastPath parameter:
fastPath=true: Uses 5-second timeout, only succeeds if tokens are cached. Intended for startup path to avoid blocking MCP server initialisation.
fastPath=false: Uses 30-second timeout, allows OAuth flow if needed. Intended for background goroutine registration after server starts.
Returns true if tools were successfully registered, false otherwise. The fallback ProxyTool is registered via init() and is always available.
Types ¶
type DynamicProxyTool ¶
type DynamicProxyTool struct {
// contains filtered or unexported fields
}
DynamicProxyTool represents a single upstream tool exposed as a first-class tool.
func (*DynamicProxyTool) Definition ¶
func (d *DynamicProxyTool) Definition() mcp.Tool
Definition returns the tool's definition for MCP registration.
type ProxyManager ¶
type ProxyManager struct {
// contains filtered or unexported fields
}
ProxyManager is a singleton that manages upstream connections and is shared across all dynamic tools.
func GetGlobalProxyManager ¶
func GetGlobalProxyManager() *ProxyManager
GetGlobalProxyManager returns the singleton proxy manager instance.
func (*ProxyManager) EnsureInitialised ¶
EnsureInitialised ensures the proxy manager is initialised (lazy initialisation).
func (*ProxyManager) GetAggregator ¶
func (pm *ProxyManager) GetAggregator() *aggregator.Aggregator
GetAggregator returns the tool aggregator (after initialisation).
func (*ProxyManager) GetManager ¶
func (pm *ProxyManager) GetManager() *upstream.Manager
GetManager returns the upstream manager (after initialisation).
func (*ProxyManager) IsInitialised ¶
func (pm *ProxyManager) IsInitialised() bool
IsInitialised returns whether the manager has been initialised.
type ProxyTool ¶
type ProxyTool struct {
// contains filtered or unexported fields
}
ProxyTool implements the tools.Tool interface for proxying to upstream MCP servers. This tool uses lazy initialisation to connect to upstreams on first use.
func (*ProxyTool) Definition ¶
Definition returns the tool's definition for MCP registration.