Documentation
¶
Overview ¶
Copyright 2026 Teradata
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package manager provides multi-server orchestration for MCP clients.
Copyright 2026 Teradata ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package manager provides multi-server orchestration for MCP clients.
Index ¶
- type ClientInfo
- type Config
- type DynamicDiscoveryConfig
- type Manager
- func (m *Manager) AddServer(ctx context.Context, name string, config ServerConfig) error
- func (m *Manager) GetClient(serverName string) (*client.Client, error)
- func (m *Manager) GetServerConfig(serverName string) (ServerConfig, error)
- func (m *Manager) HealthCheck(ctx context.Context) map[string]bool
- func (m *Manager) IsHealthy(ctx context.Context, serverName string) bool
- func (m *Manager) ListServers() []ServerInfo
- func (m *Manager) RemoveServer(name string) error
- func (m *Manager) ServerNames() []string
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop() error
- func (m *Manager) StopServer(name string) error
- type ServerConfig
- type ServerInfo
- type ToolFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInfo ¶
type ClientInfo struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version" json:"version"`
}
ClientInfo provides implementation details sent to MCP servers.
type Config ¶
type Config struct {
// Servers maps server name to server configuration
Servers map[string]ServerConfig `yaml:"servers" json:"servers"`
// DynamicDiscovery enables runtime tool discovery
DynamicDiscovery DynamicDiscoveryConfig `yaml:"dynamic_discovery" json:"dynamic_discovery"`
// ClientInfo provides implementation details sent to MCP servers
ClientInfo ClientInfo `yaml:"client_info" json:"client_info"`
}
Config defines the configuration for the MCP manager.
type DynamicDiscoveryConfig ¶
type DynamicDiscoveryConfig struct {
// Enabled enables dynamic tool discovery
Enabled bool `yaml:"enabled" json:"enabled"`
// CacheSize is the maximum number of discovered tools to cache
CacheSize int `yaml:"cache_size" json:"cache_size"`
}
DynamicDiscoveryConfig configures runtime tool discovery.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager orchestrates multiple MCP server connections.
func NewManager ¶
NewManager creates a new MCP manager.
func (*Manager) GetServerConfig ¶
func (m *Manager) GetServerConfig(serverName string) (ServerConfig, error)
GetServerConfig returns the configuration for a server.
func (*Manager) HealthCheck ¶
HealthCheck checks the health of all servers.
func (*Manager) ListServers ¶
func (m *Manager) ListServers() []ServerInfo
ListServers returns information about all servers.
func (*Manager) RemoveServer ¶
RemoveServer stops and completely removes a server from the manager. This removes the server from both the clients map and the config.
func (*Manager) ServerNames ¶
ServerNames returns a list of all active server names.
func (*Manager) StopServer ¶
StopServer stops a specific MCP server.
type ServerConfig ¶
type ServerConfig struct {
// Enabled indicates whether this server should be started
Enabled bool `yaml:"enabled" json:"enabled"`
// Command is the executable to run for stdio transport
Command string `yaml:"command" json:"command"`
// Args are the command-line arguments for the command
Args []string `yaml:"args" json:"args"`
// Env are environment variables to set for the subprocess
Env map[string]string `yaml:"env" json:"env"`
// ToolFilter controls which tools are registered from this server
ToolFilter ToolFilter `yaml:"tools" json:"tools"`
// Transport specifies the transport type ("stdio" or "sse")
Transport string `yaml:"transport" json:"transport"`
// URL is the server URL (for SSE transport)
URL string `yaml:"url" json:"url"`
// Timeout for server operations (e.g., "30s", "1m")
Timeout string `yaml:"timeout" json:"timeout"`
}
ServerConfig defines the configuration for a single MCP server.
func (*ServerConfig) Validate ¶
func (s *ServerConfig) Validate() error
Validate checks the server configuration for errors.
type ServerInfo ¶
ServerInfo provides information about a server.
type ToolFilter ¶
type ToolFilter struct {
// All indicates whether to register all tools (default: false)
All bool `yaml:"all" json:"all"`
// Include is a whitelist of tool names (if set, only these are registered)
Include []string `yaml:"include" json:"include"`
// Exclude is a blacklist of tool names (applied after include)
Exclude []string `yaml:"exclude" json:"exclude"`
}
ToolFilter controls which tools are registered from a server.
func (*ToolFilter) ShouldRegisterTool ¶
func (f *ToolFilter) ShouldRegisterTool(toolName string) bool
ShouldRegisterTool checks if a tool should be registered based on the filter.