config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 5 Imported by: 0

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

func UnmarshalServer(data []byte) (Server, error)

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"`
}

func Load

func Load(path string) (map[string]Server, *SkillGraphConfig, error)

type StaticRelation

type StaticRelation struct {
	Source      string `json:"source"`
	Target      string `json:"target"`
	Type        string `json:"type"`
	Description string `json:"description,omitempty"`
}

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"
)

Jump to

Keyboard shortcuts

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