Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddServer ¶
func AddServer(path, name string, raw json.RawMessage) error
AddServer adds a new server entry to the mcpServers section of the config file at path. raw must be a valid JSON object representing a server config block. Returns an error if the name already exists in the config.
func SaveSkillGraph ¶
func SaveSkillGraph(path string, newConfig *SkillGraphConfig) error
SaveSkillGraph writes the updated SkillGraphConfig to the config file at path, preserving the original mcpServers config and layout.
Types ¶
type HTTPServer ¶
type HTTPServer struct {
Type string `json:"type"`
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
ServerOptions
}
func (*HTTPServer) TransportType ¶
func (*HTTPServer) TransportType() TransportType
type SSEServer ¶
type SSEServer struct {
Type string `json:"type"`
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
ServerOptions
}
func (*SSEServer) TransportType ¶
func (*SSEServer) TransportType() TransportType
type Server ¶
type Server interface {
TransportType() TransportType
Options() ServerOptions
}
Server is the common interface for all server transport configurations.
func UnmarshalServer ¶
UnmarshalServer parses a raw JSON server config block into a typed Server.
type ServerOptions ¶
type ServerOptions struct {
Description string `json:"description,omitempty"`
AllowedTools []string `json:"allowedTools,omitempty"`
AllowedResources []string `json:"allowedResources,omitempty"`
}
ServerOptions contains optional fields shared by all server types.
func (ServerOptions) Options ¶
func (o ServerOptions) Options() ServerOptions
type SkillGraphConfig ¶
type SkillGraphConfig struct {
Relations []StaticRelation `json:"relations"`
Descriptions map[string]string `json:"descriptions,omitempty"`
}
type StaticRelation ¶
type StdioServer ¶
type StdioServer struct {
Type string `json:"type"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
ServerOptions
}
func (*StdioServer) TransportType ¶
func (*StdioServer) TransportType() TransportType
type TransportType ¶
type TransportType string
const ( TransportSTDIO TransportType = "stdio" TransportHTTP TransportType = "http" TransportSSE TransportType = "sse" )
Click to show internal directories.
Click to hide internal directories.