Documentation
¶
Index ¶
- func AddServerTools(serverName string, tools []ToolEntry, configChecksum string)
- func ComputeServerChecksum(command string, args []string, env map[string]string) string
- func GetServerChecksum(serverName string) string
- func GetServerForTool(toolName string) string
- func HasServer(serverName string) bool
- func InvalidateCache()
- func IsEmpty() bool
- func RemoveServer(serverName string)
- func SaveCache() error
- func ValidateChecksums(verbose bool) (needsRefresh []string, removed []string)
- type PersistentToolsCache
- type ToolEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddServerTools ¶
AddServerTools adds or updates tools for a server Also updates the checksum for change detection
func ComputeServerChecksum ¶
ComputeServerChecksum computes a checksum for a server config Used to detect if server config changed
func GetServerChecksum ¶
GetServerChecksum returns the stored checksum for a server
func GetServerForTool ¶
GetServerForTool looks up which server provides a tool Returns empty string if not found
func InvalidateCache ¶
func InvalidateCache()
InvalidateCache clears the in-memory cache, forcing next LoadCache to read from disk
func RemoveServer ¶
func RemoveServer(serverName string)
RemoveServer removes all tools from a server
func ValidateChecksums ¶
ValidateChecksums compares current MCP config checksums against cached checksums Returns lists of servers that need refreshing and servers that were removed
Types ¶
type PersistentToolsCache ¶
type PersistentToolsCache struct {
Version int `json:"version"`
LastUpdated time.Time `json:"lastUpdated"`
Tools []ToolEntry `json:"tools"`
ServerChecksums map[string]string `json:"serverChecksums"` // server name -> config checksum
}
PersistentToolsCache is the structure stored in the cache file
func LoadCache ¶
func LoadCache() (*PersistentToolsCache, error)
LoadCache loads the cache from disk into memory Returns an empty cache if file doesn't exist
type ToolEntry ¶
type ToolEntry struct {
Name string `json:"name"`
Description string `json:"description"`
Source string `json:"source"` // MCP server name or "internal"
}
ToolEntry represents a single tool in the cache
func GetToolsForServer ¶
GetToolsForServer returns all tools from a specific server