mcpserverstore

package
v0.2.20 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mcpserverstore manages the global registry of managed MCP server definitions for klausctl. Each server has a URL and an optional secret reference that is resolved at instance start time into a Bearer token header.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type McpServerDef

type McpServerDef struct {
	URL    string `yaml:"url"`
	Secret string `yaml:"secret,omitempty"`
}

McpServerDef describes a managed MCP server with a URL and optional secret reference used for authentication.

type Store

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

Store manages named MCP server definitions persisted as a YAML file.

func Load

func Load(path string) (*Store, error)

Load reads the MCP server definitions from the given file path. If the file does not exist, an empty store is returned.

func (*Store) Add

func (s *Store) Add(name string, def McpServerDef)

Add registers or updates a managed MCP server definition.

func (*Store) All

func (s *Store) All() map[string]McpServerDef

All returns a copy of all server definitions keyed by name.

func (*Store) Get

func (s *Store) Get(name string) (McpServerDef, error)

Get retrieves a server definition by name.

func (*Store) List

func (s *Store) List() []string

List returns all server names in sorted order.

func (*Store) Remove

func (s *Store) Remove(name string) error

Remove deletes a managed MCP server by name.

func (*Store) Save

func (s *Store) Save() error

Save writes the current server definitions to disk.

Jump to

Keyboard shortcuts

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