Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatMemberStatus ¶
FormatMemberStatus formats member status with visual indicators
func FormatNetworkStatus ¶
FormatNetworkStatus formats network status for better readability
func ValidateIPAddress ¶
ValidateIPAddress validates IP address format
func ValidateNetworkID ¶
ValidateNetworkID validates ZeroTier network ID format
Types ¶
type Config ¶
type Config struct {
LocalToken string `json:"local_token,omitempty"`
CentralToken string `json:"central_token,omitempty"`
}
Config represents MCP configuration
func LoadConfig ¶
func LoadConfig() *Config
LoadConfig loads configuration from environment and default locations
type McpServer ¶
type McpServer struct {
// contains filtered or unexported fields
}
MCP Server for ZeroTier - Model Context Protocol integration
func (*McpServer) ExecuteTool ¶
func (s *McpServer) ExecuteTool(ctx context.Context, toolName string, params map[string]interface{}) ToolResult
ExecuteTool executes a specific MCP tool. ctx 用于底层 ZeroTier API 的超时与取消控制。
func (*McpServer) WithCentralToken ¶
WithCentralToken sets the central API token
type Param ¶
type Param struct {
Name string `json:"name"`
Type string `json:"type"`
Description string `json:"description"`
Required bool `json:"required"`
}
Param represents a tool parameter
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters []Param `json:"parameters"`
}
Tool represents an MCP tool definition
type ToolResult ¶
type ToolResult struct {
Success bool `json:"success"`
Data string `json:"data"`
Error string `json:"error,omitempty"`
}
ToolResult represents the result of a tool execution
func CreateErrorResponse ¶
func CreateErrorResponse(format string, args ...interface{}) ToolResult
CreateErrorResponse creates a standardized error response
func CreateSuccessResponse ¶
func CreateSuccessResponse(message string, data interface{}) ToolResult
CreateSuccessResponse creates a standardized success response
func (ToolResult) ToJSON ¶
func (r ToolResult) ToJSON() string
ToJSON converts the result to JSON format