Documentation
¶
Overview ¶
Package tools provides MCP tool implementations for system inspection, including CPU, memory, disk, network, Docker, GPU, and other utilities.
Index ¶
- func ExtractField(output, prefix string) string
- func HumanSize(bytes int64) string
- func LogToolCall(ctx context.Context, tool string, dur time.Duration, errs int)
- func ParseProcessField(s string) string
- func RegisterResources(server *mcp.Server)
- func RegisterTools(server *mcp.Server)
- func SplitHostPort(s string) (string, string, bool)
- func WithToolTimeout(ctx context.Context, name string, fallback time.Duration) (context.Context, context.CancelFunc)
- type AuditLogEntry
- type AuditLogsOutput
- type AvailableUpdate
- type BlockDevice
- type BlockDevicesOutput
- type BootBlameEntry
- type BootBlameOutput
- type BootChainLink
- type BootCriticalChainOutput
- type BootPhase
- type BootTimeOutput
- type BusDevice
- type CPUDetails
- type CPUInfoOutput
- type CPUTemperatureOutput
- type CheckUpdatesOutput
- type ConnectionGroup
- type CronEntry
- type CronJob
- type CronJobsOutput
- type DesktopSessionOutput
- type DiskIOMetric
- type DiskIOMetricsOutput
- type DiskInfoOutput
- type DiskUsageStat
- type DockerContainer
- type DockerContainerDetail
- type DockerContainerDetailOutput
- type DockerContainerDiffOutput
- type DockerContainerLogsOutput
- type DockerContainerMount
- type DockerContainerStatEntry
- type DockerContainerStats
- type DockerContainerStatsOutput
- type DockerContainerTopOutput
- type DockerDiskUsageCategory
- type DockerDiskUsageOutput
- type DockerFileChange
- type DockerImage
- type DockerImageDetail
- type DockerImageDetailOutput
- type DockerImageHistoryOutput
- type DockerImageLayer
- type DockerInfoOutput
- type DockerNetworkSummary
- type DockerNetworksOutput
- type DockerStatsAllOutput
- type DockerSystemInfoOutput
- type DockerSystemInfoSummary
- type DockerSystemSnapshotOutput
- type DockerVolumeSummary
- type DockerVolumesOutput
- type EnvironmentVariable
- type EnvironmentVariablesOutput
- type FailedLoginEntry
- type FailedLoginsOutput
- func GatherFailedLogins(ctx context.Context, lines int) (*FailedLoginsOutput, error)
- func GatherFailedLoginsJournalctl(ctx context.Context, lines int) (*FailedLoginsOutput, error)
- func HandleGetFailedLogins(ctx context.Context, _ *mcp.CallToolRequest, input GetFailedLoginsInput) (*mcp.CallToolResult, *FailedLoginsOutput, error)
- type FailedLoginsSummary
- type FileLock
- type FileLocksOutput
- type FilesystemInfo
- type FirewallInfo
- type GPUDevice
- type GPUInfoOutput
- func GatherAMDGPU(ctx context.Context) (*GPUInfoOutput, error)
- func GatherGPUInfo(ctx context.Context) (*GPUInfoOutput, error)
- func GatherNvidiaGPU(ctx context.Context) (*GPUInfoOutput, error)
- func HandleGetGPUInfo(ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs) (*mcp.CallToolResult, *GPUInfoOutput, error)
- type GetAuditLogsInput
- type GetBootCriticalChainInput
- type GetDiskInfoInput
- type GetDockerContainerDetailInput
- type GetDockerContainerDiffInput
- type GetDockerContainerLogsInput
- type GetDockerContainerStatsInput
- type GetDockerContainerTopInput
- type GetDockerImageDetailInput
- type GetDockerImageHistoryInput
- type GetDockerStatsAllInput
- type GetEnvironmentVariablesInput
- type GetFailedLoginsInput
- type GetFileLocksInput
- type GetHardwareBusInfoInput
- type GetIPInfoInput
- type GetInodeUsageInput
- type GetInstalledPackagesInput
- type GetJournalLogsInput
- type GetLargestFilesInput
- type GetListeningPortsInput
- type GetManPageInput
- type GetMountOptionsInput
- type GetNetworkConnectionsInput
- type GetProcDiagnosticsInput
- type GetProcessFDsInput
- type GetProcessInfoInput
- type GetProcessTreeInput
- type GetSMARTHealthInput
- type GetServiceStatusInput
- type GetSharedMemorySegmentsInput
- type GetSystemdUnitsInput
- type GetTopIOProcessesInput
- type GetUserInfoInput
- type GetUserInfoOutput
- type HardwareBusInfoOutput
- type HealthCheckItem
- type IOProcessStat
- type IOStatDevice
- type IOStatsOutput
- type IPInfoOutput
- type InodeUsageOutput
- type InodeUsageStat
- type InstalledPackage
- type InstalledPackagesOutput
- type InterfaceStats
- type JournalLogEntry
- type JournalLogsOutput
- type KernelModule
- type KernelModulesOutput
- type LargestFileEntry
- type LargestFilesOutput
- type ListeningPort
- type ListeningPortsOutput
- type LoadAverageOutput
- type LoggedInUser
- type LoggedInUsersOutput
- type LogrotateConfig
- type LogrotateStatusOutput
- type ManPageOutput
- type MemoryInfoOutput
- type MountEntry
- type MountOptionsOutput
- type NetworkConnection
- type NetworkConnectionsOutput
- func GatherNetworkConnections(ctx context.Context, status string, connType string, resolveHostnames bool, ...) (*NetworkConnectionsOutput, error)
- func HandleGetNetworkConnections(ctx context.Context, _ *mcp.CallToolRequest, input GetNetworkConnectionsInput) (*mcp.CallToolResult, *NetworkConnectionsOutput, error)
- type NetworkInfoOutput
- type NoArgs
- type OutputErrors
- type PasswordPolicyInfo
- type PingHostInput
- type PingOutput
- type PowerAnalyticsOutput
- type ProcDiagnosticsOutput
- type ProcDiskStat
- type ProcessFD
- type ProcessFDsOutput
- type ProcessInfoOutput
- type ProcessStat
- type ProcessTreeNode
- type ProcessTreeOutput
- type RAIDDevice
- type RAIDStatusOutput
- type ResolveDNSInput
- type ResolveDNSOutput
- type RouteEntry
- type RoutingTableOutput
- type SELinuxAppArmorOutput
- type SMARTDeviceHealth
- type SMARTHealthOutput
- type SSHHardeningInfo
- type SecurityAuditOutput
- type ServiceStatusOutput
- type SharedMemoryOutput
- type ShmSegment
- type SlabInfoEntry
- type SoftIRQInfo
- type SystemHealthCheckOutput
- type SystemInfoOutput
- type SystemSnapshotOutput
- type SystemdTimer
- type SystemdUnit
- type SystemdUnitsOutput
- type TemperatureStat
- type TimeSyncStatusOutput
- type TopIOProcessesOutput
- type UserAutomationOutput
- type UserInfo
- type VMStatInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractField ¶
func LogToolCall ¶
func ParseProcessField ¶
func RegisterResources ¶
func RegisterTools ¶
Types ¶
type AuditLogEntry ¶ added in v0.2.10
type AuditLogsOutput ¶ added in v0.2.10
type AuditLogsOutput struct {
Entries []AuditLogEntry `json:"entries"`
OutputErrors
}
func GatherAuditLogs ¶ added in v0.2.10
func HandleGetAuditLogs ¶ added in v0.2.10
func HandleGetAuditLogs( ctx context.Context, _ *mcp.CallToolRequest, input GetAuditLogsInput, ) (*mcp.CallToolResult, *AuditLogsOutput, error)
type AvailableUpdate ¶
type BlockDevice ¶ added in v0.2.9
type BlockDevice struct {
Name string `json:"name"`
MajorMinor string `json:"major_minor"`
Size string `json:"size"`
Type string `json:"type"`
FSType string `json:"fs_type,omitempty"`
MountPoint string `json:"mount_point,omitempty"`
Model string `json:"model,omitempty"`
Vendor string `json:"vendor,omitempty"`
RO bool `json:"ro"`
}
type BlockDevicesOutput ¶ added in v0.2.9
type BlockDevicesOutput struct {
Devices []BlockDevice `json:"devices"`
OutputErrors
}
func GatherBlockDevices ¶ added in v0.2.9
func GatherBlockDevices(ctx context.Context) (*BlockDevicesOutput, error)
func HandleGetBlockDevices ¶ added in v0.2.9
func HandleGetBlockDevices( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *BlockDevicesOutput, error)
type BootBlameEntry ¶ added in v0.2.13
type BootBlameOutput ¶ added in v0.2.13
type BootBlameOutput struct {
Entries []BootBlameEntry `json:"entries"`
OutputErrors
}
func GatherBootBlame ¶ added in v0.2.13
func GatherBootBlame(ctx context.Context) (*BootBlameOutput, error)
func HandleGetBootBlame ¶ added in v0.2.13
func HandleGetBootBlame( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *BootBlameOutput, error)
type BootChainLink ¶ added in v0.2.13
type BootCriticalChainOutput ¶ added in v0.2.13
type BootCriticalChainOutput struct {
Target string `json:"target"`
Chain []BootChainLink `json:"chain"`
OutputErrors
}
func GatherBootCriticalChain ¶ added in v0.2.13
func GatherBootCriticalChain( ctx context.Context, unit string, ) (*BootCriticalChainOutput, error)
func HandleGetBootCriticalChain ¶ added in v0.2.13
func HandleGetBootCriticalChain( ctx context.Context, _ *mcp.CallToolRequest, input GetBootCriticalChainInput, ) (*mcp.CallToolResult, *BootCriticalChainOutput, error)
type BootTimeOutput ¶ added in v0.2.13
type BootTimeOutput struct {
Phases []BootPhase `json:"phases"`
Total string `json:"total,omitempty"`
TotalSeconds float64 `json:"total_seconds,omitempty"`
Target string `json:"target,omitempty"`
TargetReachedTime string `json:"target_reached_time,omitempty"`
TargetReachedSeconds float64 `json:"target_reached_seconds,omitempty"`
OutputErrors
}
func GatherBootTime ¶ added in v0.2.13
func GatherBootTime(ctx context.Context) (*BootTimeOutput, error)
func HandleGetBootTime ¶ added in v0.2.13
func HandleGetBootTime( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *BootTimeOutput, error)
type CPUDetails ¶
type CPUInfoOutput ¶
type CPUInfoOutput struct {
UsagePercent float64 `json:"usage_percent"`
PhysicalCoreCount int32 `json:"physical_core_count"`
Cores []CPUDetails `json:"cores"`
OutputErrors
}
func GatherCPUInfo ¶
func GatherCPUInfo(ctx context.Context) (*CPUInfoOutput, error)
func HandleGetCPUInfo ¶
func HandleGetCPUInfo( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *CPUInfoOutput, error)
type CPUTemperatureOutput ¶
type CPUTemperatureOutput struct {
Temperatures []TemperatureStat `json:"temperatures"`
Message string `json:"message,omitempty"`
OutputErrors
}
func GatherCPUTemperature ¶
func GatherCPUTemperature(ctx context.Context) (*CPUTemperatureOutput, error)
func HandleGetCPUTemperature ¶
func HandleGetCPUTemperature( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *CPUTemperatureOutput, error)
type CheckUpdatesOutput ¶
type CheckUpdatesOutput struct {
Updates []AvailableUpdate `json:"updates"`
Total int `json:"total"`
OutputErrors
}
func GatherCheckUpdates ¶
func GatherCheckUpdates(ctx context.Context) (*CheckUpdatesOutput, error)
func HandleCheckUpdates ¶
func HandleCheckUpdates( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *CheckUpdatesOutput, error)
type ConnectionGroup ¶ added in v0.2.3
type ConnectionGroup struct {
PID int32 `json:"pid"`
ProcessName string `json:"process_name"`
Connections []NetworkConnection `json:"connections"`
}
type CronJobsOutput ¶ added in v0.2.9
type CronJobsOutput struct {
SystemCrontab []CronEntry `json:"system_crontab"`
DailyJobs []string `json:"daily_jobs"`
WeeklyJobs []string `json:"weekly_jobs"`
HourlyJobs []string `json:"hourly_jobs"`
OutputErrors
}
func GatherCronJobs ¶ added in v0.2.9
func GatherCronJobs(ctx context.Context) (*CronJobsOutput, error)
func HandleGetCronJobs ¶ added in v0.2.9
func HandleGetCronJobs( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *CronJobsOutput, error)
type DesktopSessionOutput ¶ added in v0.1.8
type DesktopSessionOutput struct {
SessionType string `json:"session_type"`
CurrentDesktop string `json:"current_desktop"`
RuntimeDir string `json:"runtime_dir"`
Display string `json:"display"`
WaylandDisplay string `json:"wayland_display"`
OutputErrors
}
func GatherDesktopSessionInfo ¶ added in v0.1.8
func GatherDesktopSessionInfo( ctx context.Context, ) (*DesktopSessionOutput, error)
func HandleGetDesktopSessionInfo ¶ added in v0.1.8
func HandleGetDesktopSessionInfo( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *DesktopSessionOutput, error)
type DiskIOMetric ¶ added in v0.2.9
type DiskIOMetric struct {
Device string `json:"device"`
ReadsCompleted uint64 `json:"reads_completed"`
SectorsRead uint64 `json:"sectors_read"`
WritesCompleted uint64 `json:"writes_completed"`
SectorsWritten uint64 `json:"sectors_written"`
IOsInProgress uint64 `json:"ios_in_progress"`
ReadTimeMs uint64 `json:"read_time_ms"`
WriteTimeMs uint64 `json:"write_time_ms"`
}
type DiskIOMetricsOutput ¶ added in v0.2.9
type DiskIOMetricsOutput struct {
Metrics []DiskIOMetric `json:"metrics"`
OutputErrors
}
func GatherDiskIOMetrics ¶ added in v0.2.9
func GatherDiskIOMetrics( ctx context.Context, ) (*DiskIOMetricsOutput, error)
func HandleGetDiskIOMetrics ¶ added in v0.2.9
func HandleGetDiskIOMetrics( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *DiskIOMetricsOutput, error)
type DiskInfoOutput ¶
type DiskInfoOutput struct {
Partitions []DiskUsageStat `json:"partitions"`
OutputErrors
}
func GatherDiskInfo ¶
func HandleGetDiskInfo ¶
func HandleGetDiskInfo( ctx context.Context, _ *mcp.CallToolRequest, input GetDiskInfoInput, ) (*mcp.CallToolResult, *DiskInfoOutput, error)
type DiskUsageStat ¶
type DockerContainer ¶
type DockerContainer struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Status string `json:"status"`
}
func ListDockerContainers ¶
func ListDockerContainers(ctx context.Context) ([]DockerContainer, error)
type DockerContainerDetail ¶
type DockerContainerDetail struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Created string `json:"created"`
State map[string]any `json:"state"`
Status string `json:"status"`
Path string `json:"path"`
Args []string `json:"args"`
Env []string `json:"env"`
Mounts []DockerContainerMount `json:"mounts"`
Network map[string]any `json:"network"`
Ports map[string]any `json:"ports"`
}
type DockerContainerDetailOutput ¶
type DockerContainerDetailOutput struct {
Container DockerContainerDetail `json:"container"`
OutputErrors
}
func GatherContainerDetail ¶
func GatherContainerDetail( ctx context.Context, containerID string, ) (*DockerContainerDetailOutput, error)
func HandleGetContainerDetail ¶
func HandleGetContainerDetail( ctx context.Context, _ *mcp.CallToolRequest, input GetDockerContainerDetailInput, ) (*mcp.CallToolResult, *DockerContainerDetailOutput, error)
type DockerContainerDiffOutput ¶
type DockerContainerDiffOutput struct {
Changes []DockerFileChange `json:"changes"`
OutputErrors
}
func GatherContainerDiff ¶
func GatherContainerDiff( ctx context.Context, containerID string, ) (*DockerContainerDiffOutput, error)
func HandleGetContainerDiff ¶
func HandleGetContainerDiff( ctx context.Context, _ *mcp.CallToolRequest, input GetDockerContainerDiffInput, ) (*mcp.CallToolResult, *DockerContainerDiffOutput, error)
type DockerContainerLogsOutput ¶
type DockerContainerLogsOutput struct {
Logs []string `json:"logs"`
OutputErrors
}
func GatherContainerLogs ¶
func HandleGetContainerLogs ¶
func HandleGetContainerLogs( ctx context.Context, _ *mcp.CallToolRequest, input GetDockerContainerLogsInput, ) (*mcp.CallToolResult, *DockerContainerLogsOutput, error)
type DockerContainerMount ¶
type DockerContainerStatEntry ¶ added in v0.2.0
type DockerContainerStatEntry struct {
ID string `json:"id"`
Name string `json:"name"`
CPUPercent float64 `json:"cpu_percent"`
MemoryUsage uint64 `json:"memory_usage"`
MemoryLimit uint64 `json:"memory_limit"`
MemoryPercent float64 `json:"memory_percent"`
PIDs uint64 `json:"pids"`
Network map[string]map[string]uint64 `json:"network,omitempty"`
BlockRead uint64 `json:"block_read"`
BlockWrite uint64 `json:"block_write"`
Error string `json:"error,omitempty"`
}
type DockerContainerStats ¶
type DockerContainerStats struct {
CPUPercent float64 `json:"cpu_percent"`
MemoryUsage uint64 `json:"memory_usage"`
MemoryLimit uint64 `json:"memory_limit"`
MemoryPercent float64 `json:"memory_percent"`
PIDs uint64 `json:"pids"`
Network map[string]map[string]uint64 `json:"network,omitempty"`
BlockRead uint64 `json:"block_read"`
BlockWrite uint64 `json:"block_write"`
}
type DockerContainerStatsOutput ¶
type DockerContainerStatsOutput struct {
Containers []DockerContainerStatEntry `json:"containers"`
OutputErrors
}
func GatherContainerStats ¶
func GatherContainerStats( ctx context.Context, containerID string, ) (*DockerContainerStatsOutput, error)
func HandleGetContainerStats ¶
func HandleGetContainerStats( ctx context.Context, _ *mcp.CallToolRequest, input GetDockerContainerStatsInput, ) (*mcp.CallToolResult, *DockerContainerStatsOutput, error)
type DockerContainerTopOutput ¶
type DockerContainerTopOutput struct {
Titles []string `json:"titles"`
Processes [][]string `json:"processes"`
OutputErrors
}
func GatherContainerTop ¶
func HandleGetContainerTop ¶
func HandleGetContainerTop( ctx context.Context, _ *mcp.CallToolRequest, input GetDockerContainerTopInput, ) (*mcp.CallToolResult, *DockerContainerTopOutput, error)
type DockerDiskUsageCategory ¶
type DockerDiskUsageOutput ¶
type DockerDiskUsageOutput struct {
Containers DockerDiskUsageCategory `json:"containers"`
Images DockerDiskUsageCategory `json:"images"`
Volumes DockerDiskUsageCategory `json:"volumes"`
BuildCache DockerDiskUsageCategory `json:"build_cache"`
OutputErrors
}
func GatherDockerDiskUsage ¶
func GatherDockerDiskUsage( ctx context.Context, ) (*DockerDiskUsageOutput, error)
func HandleGetDockerDiskUsage ¶
func HandleGetDockerDiskUsage( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *DockerDiskUsageOutput, error)
type DockerFileChange ¶
type DockerImage ¶
type DockerImage struct {
Repository string `json:"repository"`
Tag string `json:"tag"`
ID string `json:"id"`
Size string `json:"size"`
}
func ListDockerImages ¶
func ListDockerImages(ctx context.Context) ([]DockerImage, error)
type DockerImageDetail ¶
type DockerImageDetail struct {
ID string `json:"id"`
RepoTags []string `json:"repo_tags"`
RepoDigests []string `json:"repo_digests"`
Created string `json:"created"`
Author string `json:"author"`
Architecture string `json:"architecture"`
OS string `json:"os"`
Size string `json:"size"`
Entrypoint []string `json:"entrypoint,omitempty"`
Cmd []string `json:"cmd,omitempty"`
Env []string `json:"env,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Layers []string `json:"layers,omitempty"`
}
type DockerImageDetailOutput ¶
type DockerImageDetailOutput struct {
Image DockerImageDetail `json:"image"`
OutputErrors
}
func GatherImageDetail ¶
func GatherImageDetail( ctx context.Context, imageID string, ) (*DockerImageDetailOutput, error)
func HandleGetImageDetail ¶
func HandleGetImageDetail( ctx context.Context, _ *mcp.CallToolRequest, input GetDockerImageDetailInput, ) (*mcp.CallToolResult, *DockerImageDetailOutput, error)
type DockerImageHistoryOutput ¶
type DockerImageHistoryOutput struct {
Layers []DockerImageLayer `json:"layers"`
OutputErrors
}
func GatherImageHistory ¶
func GatherImageHistory( ctx context.Context, imageID string, ) (*DockerImageHistoryOutput, error)
func HandleGetImageHistory ¶
func HandleGetImageHistory( ctx context.Context, _ *mcp.CallToolRequest, input GetDockerImageHistoryInput, ) (*mcp.CallToolResult, *DockerImageHistoryOutput, error)
type DockerImageLayer ¶
type DockerInfoOutput ¶
type DockerInfoOutput struct {
Containers []DockerContainer `json:"containers"`
Images []DockerImage `json:"images"`
OutputErrors
}
func GatherDockerInfo ¶
func GatherDockerInfo(ctx context.Context) (*DockerInfoOutput, error)
func HandleGetDockerInfo ¶
func HandleGetDockerInfo( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *DockerInfoOutput, error)
type DockerNetworkSummary ¶
type DockerNetworkSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Driver string `json:"driver"`
Scope string `json:"scope"`
Attachable bool `json:"attachable"`
Internal bool `json:"internal"`
Ingress bool `json:"ingress"`
IPv6 bool `json:"ipv6"`
Labels map[string]string `json:"labels,omitempty"`
}
type DockerNetworksOutput ¶
type DockerNetworksOutput struct {
Networks []DockerNetworkSummary `json:"networks"`
OutputErrors
}
func GatherDockerNetworks ¶
func GatherDockerNetworks(ctx context.Context) (*DockerNetworksOutput, error)
func HandleGetDockerNetworks ¶
func HandleGetDockerNetworks( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *DockerNetworksOutput, error)
type DockerStatsAllOutput ¶ added in v0.2.0
type DockerStatsAllOutput struct {
Containers []DockerContainerStatEntry `json:"containers"`
OutputErrors
}
func GatherDockerStatsAll ¶ added in v0.2.0
func GatherDockerStatsAll( ctx context.Context, containers []string, ) (*DockerStatsAllOutput, error)
func HandleGetDockerStatsAll ¶ added in v0.2.0
func HandleGetDockerStatsAll( ctx context.Context, _ *mcp.CallToolRequest, input GetDockerStatsAllInput, ) (*mcp.CallToolResult, *DockerStatsAllOutput, error)
type DockerSystemInfoOutput ¶
type DockerSystemInfoOutput struct {
Info DockerSystemInfoSummary `json:"info"`
OutputErrors
}
func GatherDockerSystemInfo ¶
func GatherDockerSystemInfo( ctx context.Context, ) (*DockerSystemInfoOutput, error)
func HandleGetDockerSystemInfo ¶
func HandleGetDockerSystemInfo( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *DockerSystemInfoOutput, error)
type DockerSystemInfoSummary ¶
type DockerSystemInfoSummary struct {
ID string `json:"id"`
ServerVersion string `json:"server_version"`
Architecture string `json:"architecture"`
OSType string `json:"os_type"`
OperatingSystem string `json:"operating_system"`
KernelVersion string `json:"kernel_version"`
NCPU int `json:"ncpu"`
MemTotal string `json:"mem_total"`
Driver string `json:"driver"`
LoggingDriver string `json:"logging_driver"`
CgroupDriver string `json:"cgroup_driver"`
CgroupVersion string `json:"cgroup_version"`
DefaultRuntime string `json:"default_runtime"`
Runtimes []string `json:"runtimes,omitempty"`
ContainersTotal int `json:"containers_total"`
ContainersRunning int `json:"containers_running"`
ContainersPaused int `json:"containers_paused"`
ContainersStopped int `json:"containers_stopped"`
ImagesTotal int `json:"images_total"`
DockerRootDir string `json:"docker_root_dir"`
SecurityOptions []string `json:"security_options,omitempty"`
Swarm map[string]any `json:"swarm,omitempty"`
}
type DockerSystemSnapshotOutput ¶ added in v0.2.0
type DockerSystemSnapshotOutput struct {
Info DockerInfoOutput `json:"info"`
Stats DockerStatsAllOutput `json:"stats"`
DiskUsage DockerDiskUsageOutput `json:"disk_usage"`
OutputErrors
}
func HandleGetDockerSystemSnapshot ¶ added in v0.2.0
func HandleGetDockerSystemSnapshot( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *DockerSystemSnapshotOutput, error)
type DockerVolumeSummary ¶
type DockerVolumesOutput ¶
type DockerVolumesOutput struct {
Volumes []DockerVolumeSummary `json:"volumes"`
OutputErrors
}
func GatherDockerVolumes ¶
func GatherDockerVolumes(ctx context.Context) (*DockerVolumesOutput, error)
func HandleGetDockerVolumes ¶
func HandleGetDockerVolumes( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *DockerVolumesOutput, error)
type EnvironmentVariable ¶ added in v0.1.5
type EnvironmentVariablesOutput ¶ added in v0.1.5
type EnvironmentVariablesOutput struct {
Variables []EnvironmentVariable `json:"variables"`
Count int `json:"count"`
OutputErrors
}
func GatherEnvironmentVariables ¶ added in v0.1.5
func GatherEnvironmentVariables( ctx context.Context, search string, ) (*EnvironmentVariablesOutput, error)
func HandleGetEnvironmentVariables ¶ added in v0.1.5
func HandleGetEnvironmentVariables( ctx context.Context, _ *mcp.CallToolRequest, input GetEnvironmentVariablesInput, ) (*mcp.CallToolResult, *EnvironmentVariablesOutput, error)
type FailedLoginEntry ¶
type FailedLoginEntry struct {
Username string `json:"username"`
Terminal string `json:"terminal"`
Source string `json:"source"`
Timestamp string `json:"timestamp"`
}
func ParseJournalctlFailedLogins ¶
func ParseJournalctlFailedLogins(output string) []FailedLoginEntry
func ParseLastbOutput ¶
func ParseLastbOutput(output string) []FailedLoginEntry
type FailedLoginsOutput ¶
type FailedLoginsOutput struct {
Entries []FailedLoginEntry `json:"entries"`
Summary FailedLoginsSummary `json:"summary"`
OutputErrors
}
func GatherFailedLogins ¶
func GatherFailedLogins( ctx context.Context, lines int, ) (*FailedLoginsOutput, error)
func GatherFailedLoginsJournalctl ¶
func GatherFailedLoginsJournalctl( ctx context.Context, lines int, ) (*FailedLoginsOutput, error)
func HandleGetFailedLogins ¶
func HandleGetFailedLogins( ctx context.Context, _ *mcp.CallToolRequest, input GetFailedLoginsInput, ) (*mcp.CallToolResult, *FailedLoginsOutput, error)
type FailedLoginsSummary ¶ added in v0.2.7
type FileLocksOutput ¶ added in v0.2.10
type FileLocksOutput struct {
Locks []FileLock `json:"locks"`
OutputErrors
}
func GatherFileLocks ¶ added in v0.2.10
func GatherFileLocks() (*FileLocksOutput, error)
func HandleGetFileLocks ¶ added in v0.2.10
func HandleGetFileLocks( ctx context.Context, _ *mcp.CallToolRequest, input GetFileLocksInput, ) (*mcp.CallToolResult, *FileLocksOutput, error)
type FilesystemInfo ¶ added in v0.2.9
type FirewallInfo ¶ added in v0.2.9
type GPUInfoOutput ¶
type GPUInfoOutput struct {
Vendor string `json:"vendor"`
GPUs []GPUDevice `json:"gpus"`
OutputErrors
}
func GatherAMDGPU ¶
func GatherAMDGPU(ctx context.Context) (*GPUInfoOutput, error)
func GatherGPUInfo ¶
func GatherGPUInfo(ctx context.Context) (*GPUInfoOutput, error)
func GatherNvidiaGPU ¶
func GatherNvidiaGPU(ctx context.Context) (*GPUInfoOutput, error)
func HandleGetGPUInfo ¶
func HandleGetGPUInfo( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *GPUInfoOutput, error)
type GetAuditLogsInput ¶ added in v0.2.10
type GetBootCriticalChainInput ¶ added in v0.2.13
type GetBootCriticalChainInput struct {
Unit string `json:"unit,omitempty" jsonschema:"optional unit name to start the chain from (e.g. 'graphical.target')"`
}
type GetDiskInfoInput ¶
type GetDockerContainerDetailInput ¶
type GetDockerContainerDetailInput struct {
ContainerID string `json:"container_id" jsonschema:"container name or ID"`
}
type GetDockerContainerDiffInput ¶
type GetDockerContainerDiffInput struct {
ContainerID string `json:"container_id" jsonschema:"container name or ID"`
}
type GetDockerContainerLogsInput ¶
type GetDockerContainerLogsInput struct {
ContainerID string `json:"container_id" jsonschema:"container name or ID"`
Tail int `json:"tail,omitempty" jsonschema:"number of lines to tail (default: 100, max: 10000)"`
Timestamps bool `json:"timestamps,omitempty" jsonschema:"include timestamps (default: false)"`
}
type GetDockerContainerStatsInput ¶
type GetDockerContainerStatsInput struct {
ContainerIDs string `json:"container_ids" jsonschema:"container name(s) or ID(s), comma-separated, or 'all' for all running containers"`
}
type GetDockerImageDetailInput ¶
type GetDockerImageDetailInput struct {
ImageID string `json:"image_id" jsonschema:"image name or ID"`
}
type GetDockerImageHistoryInput ¶
type GetDockerImageHistoryInput struct {
ImageID string `json:"image_id" jsonschema:"image name or ID"`
}
type GetDockerStatsAllInput ¶ added in v0.2.0
type GetDockerStatsAllInput struct {
Containers []string `json:"containers,omitempty" jsonschema:"optional list of container names or IDs to filter"`
}
type GetEnvironmentVariablesInput ¶ added in v0.1.5
type GetEnvironmentVariablesInput struct {
Search string `json:"search,omitempty" jsonschema:"optional search string to filter by name (matches prefix or substring, case-insensitive)"`
}
type GetFailedLoginsInput ¶
type GetFailedLoginsInput struct {
Lines int `json:"lines,omitempty" jsonschema:"number of recent entries (default: 20)"`
}
type GetFileLocksInput ¶ added in v0.2.10
type GetFileLocksInput struct{}
type GetHardwareBusInfoInput ¶ added in v0.1.5
type GetHardwareBusInfoInput struct {
Search string `json:"search,omitempty" jsonschema:"optional search string to filter devices by any field (bus, slot, class, vendor, device)"`
}
type GetIPInfoInput ¶ added in v0.2.4
type GetIPInfoInput struct {
IP string `json:"ip,omitempty" jsonschema:"optional IP address to lookup (defaults to your public IP)"`
}
type GetInodeUsageInput ¶
type GetInodeUsageInput struct {
MountPoint string `json:"mount_point,omitempty" jsonschema:"optional mount point filter"`
}
type GetInstalledPackagesInput ¶
type GetInstalledPackagesInput struct {
Name string `json:"name,omitempty" jsonschema:"optional package name filter"`
}
type GetJournalLogsInput ¶
type GetJournalLogsInput struct {
Unit string `json:"unit,omitempty" jsonschema:"optional systemd unit name (e.g. 'nginx.service')"`
Priority string `json:"priority,omitempty" jsonschema:"optional log priority: emerg,alert,crit,err,warning,notice,info,debug"`
Since string `json:"since,omitempty" jsonschema:"optional start time (e.g. '1 hour ago', '2024-07-03')"`
Until string `json:"until,omitempty" jsonschema:"optional end time"`
Lines int `json:"lines,omitempty" jsonschema:"number of recent lines (default: 50)"`
User bool `json:"user,omitempty" jsonschema:"query user-level journal (default: false)"`
}
type GetLargestFilesInput ¶
type GetListeningPortsInput ¶
type GetListeningPortsInput struct {
Protocol string `json:"protocol,omitempty" jsonschema:"optional protocol filter: tcp, udp"`
}
type GetManPageInput ¶ added in v0.1.2
type GetManPageInput struct {
Command string `json:"command" jsonschema:"command name to get the man page for"`
MaxLines int `json:"max_lines,omitempty" jsonschema:"maximum number of lines to return (default: 500, max: 10000)"`
CleanSpecialChars bool `json:"clean_special_chars,omitempty" jsonschema:"clean backspace formatting characters (default: true)"`
Search string `json:"search,omitempty" jsonschema:"search term to grep for in the man page (case-insensitive)"`
ContextLines int `` /* 137-byte string literal not displayed */
Offset int `json:"offset,omitempty" jsonschema:"line offset to start reading from (0-based)"`
}
type GetMountOptionsInput ¶
type GetMountOptionsInput struct {
MountPoint string `json:"mount_point,omitempty" jsonschema:"optional mount point filter (e.g. '/')"`
}
type GetNetworkConnectionsInput ¶ added in v0.2.3
type GetNetworkConnectionsInput struct {
Status string `json:"status,omitempty" jsonschema:"optional status filter (e.g. ESTABLISHED, LISTEN, TIME_WAIT)"`
Type string `json:"type,omitempty" jsonschema:"optional type filter: tcp, udp"`
ResolveHostnames bool `json:"resolve_hostnames,omitempty" jsonschema:"optional: resolve remote hostnames via reverse DNS (default: false)"`
Grouped bool `json:"grouped,omitempty" jsonschema:"optional: group connections by PID (default: false)"`
MaxConnections int `json:"max_connections,omitempty" jsonschema:"optional: limit results (max: 200)"`
}
type GetProcDiagnosticsInput ¶ added in v0.2.9
type GetProcDiagnosticsInput struct {
Sections string `` /* 141-byte string literal not displayed */
}
type GetProcessFDsInput ¶ added in v0.2.1
type GetProcessFDsInput struct {
PID int32 `json:"pid" jsonschema:"process ID to list open file descriptors for"`
}
type GetProcessInfoInput ¶
type GetProcessTreeInput ¶ added in v0.2.14
type GetProcessTreeInput struct {
PID *int32 `json:"pid,omitempty" jsonschema:"optional PID to show subtree from (omit for full tree)"`
}
type GetSMARTHealthInput ¶ added in v0.2.9
type GetSMARTHealthInput struct {
Device string `json:"device,omitempty" jsonschema:"optional device name (e.g. sda, nvme0n1). If empty, checks all devices"`
}
type GetServiceStatusInput ¶
type GetSharedMemorySegmentsInput ¶ added in v0.2.10
type GetSharedMemorySegmentsInput struct{}
type GetSystemdUnitsInput ¶
type GetSystemdUnitsInput struct {
State string `json:"state,omitempty" jsonschema:"optional state filter: 'failed', 'active', 'inactive'"`
}
type GetTopIOProcessesInput ¶
type GetTopIOProcessesInput struct {
Limit int `json:"limit,omitempty" jsonschema:"max results (default: 10, max: 50)"`
}
type GetUserInfoInput ¶ added in v0.2.5
type GetUserInfoInput struct {
Search string `json:"search,omitempty" jsonschema:"optional username filter (case-insensitive substring match)"`
}
type GetUserInfoOutput ¶ added in v0.2.5
type GetUserInfoOutput struct {
Users []UserInfo `json:"users"`
OutputErrors
}
func GatherUserInfo ¶ added in v0.2.5
func GatherUserInfo( ctx context.Context, search string, ) (*GetUserInfoOutput, error)
func HandleGetUserInfo ¶ added in v0.2.5
func HandleGetUserInfo( ctx context.Context, _ *mcp.CallToolRequest, input GetUserInfoInput, ) (*mcp.CallToolResult, *GetUserInfoOutput, error)
type HardwareBusInfoOutput ¶ added in v0.1.5
type HardwareBusInfoOutput struct {
PCIDevices []BusDevice `json:"pci_devices"`
USBDevices []BusDevice `json:"usb_devices"`
OutputErrors
}
func GatherHardwareBusInfo ¶ added in v0.1.5
func GatherHardwareBusInfo( ctx context.Context, search string, ) (*HardwareBusInfoOutput, error)
func HandleGetHardwareBusInfo ¶ added in v0.1.5
func HandleGetHardwareBusInfo( ctx context.Context, _ *mcp.CallToolRequest, input GetHardwareBusInfoInput, ) (*mcp.CallToolResult, *HardwareBusInfoOutput, error)
type HealthCheckItem ¶ added in v0.2.9
type IOProcessStat ¶
type IOStatDevice ¶ added in v0.2.14
type IOStatDevice struct {
Device string `json:"device"`
ReadKBs float64 `json:"read_kBs"`
WriteKBs float64 `json:"write_kBs"`
DiscardKBs float64 `json:"discard_kBs,omitempty"`
ReadsPerS float64 `json:"reads_per_s"`
WritesPerS float64 `json:"writes_per_s"`
AVGWaitMs float64 `json:"avg_wait_ms"`
AVGReadMs float64 `json:"avg_read_ms"`
AVGWriteMs float64 `json:"avg_write_ms"`
QueueSize float64 `json:"queue_size,omitempty"`
UtilPct float64 `json:"util_pct,omitempty"`
}
type IOStatsOutput ¶ added in v0.2.14
type IOStatsOutput struct {
Devices []IOStatDevice `json:"devices"`
OutputErrors
}
func GatherIOStats ¶ added in v0.2.14
func GatherIOStats( ctx context.Context, ) (*IOStatsOutput, error)
func HandleGetIOStats ¶ added in v0.2.14
func HandleGetIOStats( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *IOStatsOutput, error)
type IPInfoOutput ¶ added in v0.2.4
type IPInfoOutput struct {
IP string `json:"ip"`
ASN string `json:"asn,omitempty"`
Org string `json:"org,omitempty"`
Country string `json:"country,omitempty"`
City string `json:"city,omitempty"`
Region string `json:"region,omitempty"`
ServiceTags []string `json:"service_tags,omitempty"`
OutputErrors
}
func GatherIPInfo ¶ added in v0.2.4
func GatherIPInfo(ctx context.Context, ip string) (*IPInfoOutput, error)
func HandleGetIPInfo ¶ added in v0.2.4
func HandleGetIPInfo( ctx context.Context, _ *mcp.CallToolRequest, input GetIPInfoInput, ) (*mcp.CallToolResult, *IPInfoOutput, error)
type InodeUsageOutput ¶
type InodeUsageOutput struct {
Mounts []InodeUsageStat `json:"mounts"`
OutputErrors
}
func GatherInodeUsage ¶
func GatherInodeUsage( ctx context.Context, mountPoint string, ) (*InodeUsageOutput, error)
func HandleGetInodeUsage ¶
func HandleGetInodeUsage( ctx context.Context, _ *mcp.CallToolRequest, input GetInodeUsageInput, ) (*mcp.CallToolResult, *InodeUsageOutput, error)
type InodeUsageStat ¶
type InstalledPackage ¶
type InstalledPackagesOutput ¶
type InstalledPackagesOutput struct {
Packages []InstalledPackage `json:"packages"`
Total int `json:"total"`
OutputErrors
}
func GatherInstalledPackages ¶
func GatherInstalledPackages( ctx context.Context, name string, ) (*InstalledPackagesOutput, error)
func HandleGetInstalledPackages ¶
func HandleGetInstalledPackages( ctx context.Context, _ *mcp.CallToolRequest, input GetInstalledPackagesInput, ) (*mcp.CallToolResult, *InstalledPackagesOutput, error)
type InterfaceStats ¶
type InterfaceStats struct {
Name string `json:"name"`
BytesSent uint64 `json:"bytes_sent"`
BytesRecv uint64 `json:"bytes_recv"`
PacketsSent uint64 `json:"packets_sent"`
PacketsRecv uint64 `json:"packets_recv"`
ErrorsIn uint64 `json:"errors_in"`
ErrorsOut uint64 `json:"errors_out"`
DropsIn uint64 `json:"drops_in"`
DropsOut uint64 `json:"drops_out"`
}
type JournalLogEntry ¶
type JournalLogsOutput ¶
type JournalLogsOutput struct {
Entries []JournalLogEntry `json:"entries"`
OutputErrors
}
func GatherJournalLogs ¶
func HandleGetJournalLogs ¶
func HandleGetJournalLogs( ctx context.Context, _ *mcp.CallToolRequest, input GetJournalLogsInput, ) (*mcp.CallToolResult, *JournalLogsOutput, error)
type KernelModule ¶ added in v0.2.14
type KernelModulesOutput ¶ added in v0.2.14
type KernelModulesOutput struct {
Modules []KernelModule `json:"modules"`
Total int `json:"total"`
OutputErrors
}
func GatherKernelModules ¶ added in v0.2.14
func GatherKernelModules( ctx context.Context, ) (*KernelModulesOutput, error)
func HandleGetKernelModules ¶ added in v0.2.14
func HandleGetKernelModules( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *KernelModulesOutput, error)
type LargestFileEntry ¶
type LargestFilesOutput ¶
type LargestFilesOutput struct {
Path string `json:"path"`
Entries []LargestFileEntry `json:"entries"`
OutputErrors
}
func GatherLargestFiles ¶
func HandleGetLargestFiles ¶
func HandleGetLargestFiles( ctx context.Context, _ *mcp.CallToolRequest, input GetLargestFilesInput, ) (*mcp.CallToolResult, *LargestFilesOutput, error)
type ListeningPort ¶
type ListeningPortsOutput ¶
type ListeningPortsOutput struct {
Ports []ListeningPort `json:"ports"`
OutputErrors
}
func GatherListeningPorts ¶
func GatherListeningPorts( ctx context.Context, protocol string, ) (*ListeningPortsOutput, error)
func HandleGetListeningPorts ¶
func HandleGetListeningPorts( ctx context.Context, _ *mcp.CallToolRequest, input GetListeningPortsInput, ) (*mcp.CallToolResult, *ListeningPortsOutput, error)
type LoadAverageOutput ¶
type LoadAverageOutput struct {
Load1 float64 `json:"load_1"`
Load5 float64 `json:"load_5"`
Load15 float64 `json:"load_15"`
OutputErrors
}
func GatherLoadAverage ¶
func GatherLoadAverage(ctx context.Context) (*LoadAverageOutput, error)
func HandleGetLoadAverage ¶
func HandleGetLoadAverage( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *LoadAverageOutput, error)
type LoggedInUser ¶
type LoggedInUsersOutput ¶
type LoggedInUsersOutput struct {
Users []LoggedInUser `json:"users"`
OutputErrors
}
func GatherLoggedInUsers ¶
func GatherLoggedInUsers(ctx context.Context) (*LoggedInUsersOutput, error)
func HandleGetLoggedInUsers ¶
func HandleGetLoggedInUsers( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *LoggedInUsersOutput, error)
type LogrotateConfig ¶ added in v0.2.9
type LogrotateStatusOutput ¶ added in v0.2.9
type LogrotateStatusOutput struct {
Configs []LogrotateConfig `json:"configs"`
StateFile string `json:"state_file,omitempty"`
OutputErrors
}
func GatherLogrotateStatus ¶ added in v0.2.9
func GatherLogrotateStatus( ctx context.Context, ) (*LogrotateStatusOutput, error)
func HandleGetLogrotateStatus ¶ added in v0.2.9
func HandleGetLogrotateStatus( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *LogrotateStatusOutput, error)
type ManPageOutput ¶ added in v0.1.2
type ManPageOutput struct {
Command string `json:"command"`
Content string `json:"content"`
Truncated bool `json:"truncated,omitempty"`
OutputErrors
}
func GatherManPage ¶ added in v0.1.2
func HandleGetManPage ¶ added in v0.1.2
func HandleGetManPage( ctx context.Context, _ *mcp.CallToolRequest, input GetManPageInput, ) (*mcp.CallToolResult, *ManPageOutput, error)
type MemoryInfoOutput ¶
type MemoryInfoOutput struct {
Total uint64 `json:"total"`
Used uint64 `json:"used"`
Free uint64 `json:"free"`
UsedPercent float64 `json:"used_percent"`
SwapTotal uint64 `json:"swap_total"`
SwapUsed uint64 `json:"swap_used"`
SwapFree uint64 `json:"swap_free"`
SwapUsedPercent float64 `json:"swap_used_percent"`
OutputErrors
}
func GatherMemoryInfo ¶
func GatherMemoryInfo(ctx context.Context) (*MemoryInfoOutput, error)
func HandleGetMemoryInfo ¶
func HandleGetMemoryInfo( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *MemoryInfoOutput, error)
type MountEntry ¶
type MountOptionsOutput ¶
type MountOptionsOutput struct {
Mounts []MountEntry `json:"mounts"`
OutputErrors
}
func GatherMountOptions ¶
func GatherMountOptions( ctx context.Context, mountPoint string, ) (*MountOptionsOutput, error)
func HandleGetMountOptions ¶
func HandleGetMountOptions( ctx context.Context, _ *mcp.CallToolRequest, input GetMountOptionsInput, ) (*mcp.CallToolResult, *MountOptionsOutput, error)
type NetworkConnection ¶ added in v0.2.3
type NetworkConnection struct {
FD uint32 `json:"fd"`
Family string `json:"family"`
Type string `json:"type"`
LocalAddr string `json:"local_addr"`
LocalPort uint32 `json:"local_port"`
RemoteAddr string `json:"remote_addr"`
RemotePort uint32 `json:"remote_port"`
Status string `json:"status"`
PID int32 `json:"pid"`
ProcessName string `json:"process_name,omitempty"`
RemoteHostname string `json:"remote_hostname,omitempty"`
}
type NetworkConnectionsOutput ¶ added in v0.2.3
type NetworkConnectionsOutput struct {
Connections []NetworkConnection `json:"connections"`
Groups []ConnectionGroup `json:"groups,omitempty"`
OutputErrors
}
func GatherNetworkConnections ¶ added in v0.2.3
func HandleGetNetworkConnections ¶ added in v0.2.3
func HandleGetNetworkConnections( ctx context.Context, _ *mcp.CallToolRequest, input GetNetworkConnectionsInput, ) (*mcp.CallToolResult, *NetworkConnectionsOutput, error)
type NetworkInfoOutput ¶
type NetworkInfoOutput struct {
Interfaces []InterfaceStats `json:"interfaces"`
OutputErrors
}
func GatherNetworkInfo ¶
func GatherNetworkInfo(ctx context.Context) (*NetworkInfoOutput, error)
func HandleGetNetworkInfo ¶
func HandleGetNetworkInfo( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *NetworkInfoOutput, error)
type NoArgs ¶ added in v0.2.6
type NoArgs struct{}
NoArgs is used for tools that accept no parameters.
type OutputErrors ¶ added in v0.2.1
type OutputErrors struct {
Errors []string `json:"errors,omitempty"`
}
OutputErrors is embedded in output structs for error accumulation.
func (*OutputErrors) Add ¶ added in v0.2.1
func (o *OutputErrors) Add(context string, err error)
func (*OutputErrors) AppendError ¶ added in v0.2.1
func (o *OutputErrors) AppendError(s string)
func (OutputErrors) Err ¶ added in v0.2.1
func (o OutputErrors) Err() error
func (OutputErrors) ErrorCount ¶ added in v0.2.1
func (o OutputErrors) ErrorCount() int
type PasswordPolicyInfo ¶ added in v0.2.9
type PingHostInput ¶
type PingOutput ¶
type PingOutput struct {
Host string `json:"host"`
PacketsTransmitted int `json:"packets_transmitted"`
PacketsReceived int `json:"packets_received"`
PacketLossPercent float64 `json:"packet_loss_percent"`
MinLatencyMs float64 `json:"min_latency_ms"`
AvgLatencyMs float64 `json:"avg_latency_ms"`
MaxLatencyMs float64 `json:"max_latency_ms"`
OutputErrors
}
func GatherPing ¶
func HandlePingHost ¶
func HandlePingHost( ctx context.Context, _ *mcp.CallToolRequest, input PingHostInput, ) (*mcp.CallToolResult, *PingOutput, error)
type PowerAnalyticsOutput ¶ added in v0.2.1
type PowerAnalyticsOutput struct {
ACOnline bool `json:"ac_online"`
BatteryPercent float64 `json:"battery_percent"`
DischargeRateWatts float64 `json:"discharge_rate_watts"`
CapacityDegradation float64 `json:"capacity_degradation_percent"`
OutputErrors
}
func GatherPowerAnalytics ¶ added in v0.2.1
func GatherPowerAnalytics(ctx context.Context) (*PowerAnalyticsOutput, error)
func HandleGetPowerAnalytics ¶ added in v0.2.1
func HandleGetPowerAnalytics( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *PowerAnalyticsOutput, error)
type ProcDiagnosticsOutput ¶ added in v0.2.9
type ProcDiagnosticsOutput struct {
Interrupts []string `json:"interrupts,omitempty"`
SoftIRQs []SoftIRQInfo `json:"softirqs,omitempty"`
VMStat *VMStatInfo `json:"vmstat,omitempty"`
DiskStats []ProcDiskStat `json:"diskstats,omitempty"`
Filesystems []FilesystemInfo `json:"filesystems,omitempty"`
Version string `json:"version,omitempty"`
SlabInfo []SlabInfoEntry `json:"slabinfo,omitempty"`
OutputErrors
}
func GatherProcDiagnostics ¶ added in v0.2.9
func GatherProcDiagnostics( ctx context.Context, sections string, ) (*ProcDiagnosticsOutput, error)
func HandleGetProcDiagnostics ¶ added in v0.2.9
func HandleGetProcDiagnostics( ctx context.Context, _ *mcp.CallToolRequest, input GetProcDiagnosticsInput, ) (*mcp.CallToolResult, *ProcDiagnosticsOutput, error)
type ProcDiskStat ¶ added in v0.2.9
type ProcDiskStat struct {
Device string `json:"device"`
ReadsCompleted uint64 `json:"reads_completed"`
ReadsMerged uint64 `json:"reads_merged"`
SectorsRead uint64 `json:"sectors_read"`
ReadMs uint64 `json:"read_ms"`
WritesCompleted uint64 `json:"writes_completed"`
WritesMerged uint64 `json:"writes_merged"`
SectorsWritten uint64 `json:"sectors_written"`
WriteMs uint64 `json:"write_ms"`
IOsInProgress uint64 `json:"ios_in_progress"`
IoMs uint64 `json:"io_ms"`
WeightedIoMs uint64 `json:"weighted_io_ms"`
}
type ProcessFDsOutput ¶ added in v0.2.1
type ProcessFDsOutput struct {
PID int `json:"pid"`
Name string `json:"name"`
Count int `json:"fd_count"`
FDs []ProcessFD `json:"file_descriptors"`
OutputErrors
}
func GatherProcessFDs ¶ added in v0.2.1
func GatherProcessFDs( ctx context.Context, pid int32, ) (*ProcessFDsOutput, error)
func HandleGetProcessFDs ¶ added in v0.2.1
func HandleGetProcessFDs( ctx context.Context, _ *mcp.CallToolRequest, input GetProcessFDsInput, ) (*mcp.CallToolResult, *ProcessFDsOutput, error)
type ProcessInfoOutput ¶
type ProcessInfoOutput struct {
Processes []ProcessStat `json:"processes,omitempty"`
ByCPU []ProcessStat `json:"by_cpu,omitempty"`
ByMemory []ProcessStat `json:"by_memory,omitempty"`
OutputErrors
}
func GatherProcessInfo ¶
func HandleGetProcessInfo ¶
func HandleGetProcessInfo( ctx context.Context, _ *mcp.CallToolRequest, input GetProcessInfoInput, ) (*mcp.CallToolResult, *ProcessInfoOutput, error)
type ProcessStat ¶
type ProcessStat struct {
PID int32 `json:"pid"`
Name string `json:"name"`
CPUPercent float64 `json:"cpu_percent"`
MemoryPercent float32 `json:"memory_percent"`
Status string `json:"status"`
RSSBytes *int64 `json:"rss_bytes,omitempty"`
PSSBytes *int64 `json:"pss_bytes,omitempty"`
SwapBytes *int64 `json:"swap_bytes,omitempty"`
CgroupPath *string `json:"cgroup_path,omitempty"`
}
type ProcessTreeNode ¶ added in v0.2.14
type ProcessTreeOutput ¶ added in v0.2.14
type ProcessTreeOutput struct {
Nodes []ProcessTreeNode `json:"nodes"`
Total int `json:"total"`
Filtered bool `json:"filtered,omitempty"`
OutputErrors
}
func GatherProcessTree ¶ added in v0.2.14
func GatherProcessTree( ctx context.Context, pid *int32, ) (*ProcessTreeOutput, error)
func HandleGetProcessTree ¶ added in v0.2.14
func HandleGetProcessTree( ctx context.Context, _ *mcp.CallToolRequest, input GetProcessTreeInput, ) (*mcp.CallToolResult, *ProcessTreeOutput, error)
type RAIDDevice ¶ added in v0.2.9
type RAIDStatusOutput ¶ added in v0.2.9
type RAIDStatusOutput struct {
Devices []RAIDDevice `json:"devices"`
OutputErrors
}
func GatherRAIDStatus ¶ added in v0.2.9
func GatherRAIDStatus(ctx context.Context) (*RAIDStatusOutput, error)
func HandleGetRAIDStatus ¶ added in v0.2.9
func HandleGetRAIDStatus( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *RAIDStatusOutput, error)
type ResolveDNSInput ¶
type ResolveDNSInput struct {
Hostname string `json:"hostname" jsonschema:"hostname to resolve (e.g. 'example.com')"`
}
type ResolveDNSOutput ¶
type ResolveDNSOutput struct {
Hostname string `json:"hostname"`
Addresses []string `json:"addresses"`
OutputErrors
}
func GatherDNSResolve ¶
func GatherDNSResolve( ctx context.Context, hostname string, ) (*ResolveDNSOutput, error)
func HandleResolveDNS ¶
func HandleResolveDNS( ctx context.Context, _ *mcp.CallToolRequest, input ResolveDNSInput, ) (*mcp.CallToolResult, *ResolveDNSOutput, error)
type RouteEntry ¶ added in v0.2.14
type RouteEntry struct {
Destination string `json:"destination"`
Gateway string `json:"gateway,omitempty"`
Interface string `json:"interface"`
Proto string `json:"proto,omitempty"`
Scope string `json:"scope,omitempty"`
Type string `json:"type,omitempty"`
Metric int `json:"metric,omitempty"`
MTU int `json:"mtu,omitempty"`
}
type RoutingTableOutput ¶ added in v0.2.14
type RoutingTableOutput struct {
Routes []RouteEntry `json:"routes"`
Total int `json:"total"`
OutputErrors
}
func GatherRoutingTable ¶ added in v0.2.14
func GatherRoutingTable( ctx context.Context, ) (*RoutingTableOutput, error)
func HandleGetRoutingTable ¶ added in v0.2.14
func HandleGetRoutingTable( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *RoutingTableOutput, error)
type SELinuxAppArmorOutput ¶ added in v0.2.9
type SELinuxAppArmorOutput struct {
SELinux string `json:"selinux"`
AppArmor string `json:"apparmor"`
OutputErrors
}
func GatherSELinuxAppArmorStatus ¶ added in v0.2.9
func GatherSELinuxAppArmorStatus( ctx context.Context, ) (*SELinuxAppArmorOutput, error)
func HandleGetSELinuxAppArmorStatus ¶ added in v0.2.9
func HandleGetSELinuxAppArmorStatus( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *SELinuxAppArmorOutput, error)
type SMARTDeviceHealth ¶ added in v0.2.9
type SMARTDeviceHealth struct {
Device string `json:"device"`
Model string `json:"model,omitempty"`
Serial string `json:"serial,omitempty"`
HealthStatus string `json:"health_status"`
Temperature int `json:"temperature,omitempty"`
PowerOnHours int `json:"power_on_hours,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
RawOutput string `json:"raw_output,omitempty"`
}
type SMARTHealthOutput ¶ added in v0.2.9
type SMARTHealthOutput struct {
Devices []SMARTDeviceHealth `json:"devices"`
OutputErrors
}
func GatherSMARTHealth ¶ added in v0.2.9
func GatherSMARTHealth( ctx context.Context, device string, ) (*SMARTHealthOutput, error)
func HandleGetSMARTHealth ¶ added in v0.2.9
func HandleGetSMARTHealth( ctx context.Context, _ *mcp.CallToolRequest, input GetSMARTHealthInput, ) (*mcp.CallToolResult, *SMARTHealthOutput, error)
type SSHHardeningInfo ¶ added in v0.2.9
type SSHHardeningInfo struct {
PermitRootLogin string `json:"permit_root_login,omitempty"`
PasswordAuthentication string `json:"password_authentication,omitempty"`
PubkeyAuthentication string `json:"pubkey_authentication,omitempty"`
X11Forwarding string `json:"x11_forwarding,omitempty"`
MaxAuthTries string `json:"max_auth_tries,omitempty"`
Protocol string `json:"protocol,omitempty"`
ConfigPresent bool `json:"config_present"`
}
type SecurityAuditOutput ¶ added in v0.2.9
type SecurityAuditOutput struct {
Firewall FirewallInfo `json:"firewall"`
SSHHardening SSHHardeningInfo `json:"ssh_hardening"`
SUIDBinaries []string `json:"suid_binaries"`
WorldWritable []string `json:"world_writable_files"`
Umask string `json:"umask"`
PasswordPolicy PasswordPolicyInfo `json:"password_policy"`
Score int `json:"security_score"`
OutputErrors
}
func GatherSecurityAudit ¶ added in v0.2.9
func GatherSecurityAudit(ctx context.Context) (*SecurityAuditOutput, error)
func HandleGetSecurityAudit ¶ added in v0.2.9
func HandleGetSecurityAudit( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *SecurityAuditOutput, error)
type ServiceStatusOutput ¶
type ServiceStatusOutput struct {
Name string `json:"name"`
Loaded string `json:"loaded,omitempty"`
Active string `json:"active,omitempty"`
PID string `json:"pid,omitempty"`
Output string `json:"output"`
OutputErrors
}
func GatherServiceStatus ¶
func HandleGetServiceStatus ¶
func HandleGetServiceStatus( ctx context.Context, _ *mcp.CallToolRequest, input GetServiceStatusInput, ) (*mcp.CallToolResult, *ServiceStatusOutput, error)
type SharedMemoryOutput ¶ added in v0.2.10
type SharedMemoryOutput struct {
}
func GatherSharedMemorySegments ¶ added in v0.2.10
func GatherSharedMemorySegments() (*SharedMemoryOutput, error)
func HandleGetSharedMemorySegments ¶ added in v0.2.10
func HandleGetSharedMemorySegments( ctx context.Context, _ *mcp.CallToolRequest, input GetSharedMemorySegmentsInput, ) (*mcp.CallToolResult, *SharedMemoryOutput, error)
type ShmSegment ¶ added in v0.2.10
type ShmSegment struct {
Key int64 `json:"key"`
ID int64 `json:"id"`
Owner string `json:"owner"`
Bytes int64 `json:"bytes"`
Nattch int32 `json:"nattch"`
CPID int32 `json:"cpid"`
LPID int32 `json:"lpid"`
AttachAt string `json:"attach_at"`
DetachAt string `json:"detach_at"`
CreatTime string `json:"creat_time"`
}
type SlabInfoEntry ¶ added in v0.2.9
type SoftIRQInfo ¶ added in v0.2.9
type SystemHealthCheckOutput ¶ added in v0.2.9
type SystemHealthCheckOutput struct {
Overall string `json:"overall"`
Checks []HealthCheckItem `json:"checks"`
OutputErrors
}
func GatherSystemHealthCheck ¶ added in v0.2.9
func GatherSystemHealthCheck( ctx context.Context, ) (*SystemHealthCheckOutput, error)
func HandleGetSystemHealthCheck ¶ added in v0.2.9
func HandleGetSystemHealthCheck( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *SystemHealthCheckOutput, error)
type SystemInfoOutput ¶
type SystemInfoOutput struct {
Hostname string `json:"hostname"`
OSName string `json:"os_name"`
OSVersion string `json:"os_version"`
KernelVersion string `json:"kernel_version"`
Architecture string `json:"architecture"`
UptimeSeconds uint64 `json:"uptime_seconds"`
Platform string `json:"platform,omitempty"`
PlatformFamily string `json:"platform_family,omitempty"`
BootTime uint64 `json:"boot_time,omitempty"`
Procs uint64 `json:"procs,omitempty"`
VirtualizationSystem string `json:"virtualization_system,omitempty"`
VirtualizationRole string `json:"virtualization_role,omitempty"`
HostID string `json:"host_id,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
ProductName string `json:"product_name,omitempty"`
ProductVersion string `json:"product_version,omitempty"`
BIOSVersion string `json:"bios_version,omitempty"`
BIOSDate string `json:"bios_date,omitempty"`
TPMVersion string `json:"tpm_version,omitempty"`
OutputErrors
}
func GatherSystemInfo ¶
func GatherSystemInfo(ctx context.Context) (*SystemInfoOutput, error)
func HandleGetSystemInfo ¶
func HandleGetSystemInfo( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *SystemInfoOutput, error)
type SystemSnapshotOutput ¶
type SystemSnapshotOutput struct {
System SystemInfoOutput `json:"system"`
CPU CPUInfoOutput `json:"cpu"`
Temperature CPUTemperatureOutput `json:"temperature"`
Memory MemoryInfoOutput `json:"memory"`
Disk DiskInfoOutput `json:"disk"`
Network NetworkInfoOutput `json:"network"`
LoadAverage LoadAverageOutput `json:"load_average"`
Processes ProcessInfoOutput `json:"processes"`
Docker DockerInfoOutput `json:"docker"`
OutputErrors
}
func HandleGetSystemSnapshot ¶
func HandleGetSystemSnapshot( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *SystemSnapshotOutput, error)
type SystemdTimer ¶ added in v0.1.8
type SystemdUnit ¶
type SystemdUnitsOutput ¶
type SystemdUnitsOutput struct {
Units []SystemdUnit `json:"units"`
OutputErrors
}
func GatherSystemdUnits ¶
func GatherSystemdUnits( ctx context.Context, state string, ) (*SystemdUnitsOutput, error)
func HandleGetSystemdUnits ¶
func HandleGetSystemdUnits( ctx context.Context, _ *mcp.CallToolRequest, input GetSystemdUnitsInput, ) (*mcp.CallToolResult, *SystemdUnitsOutput, error)
type TemperatureStat ¶
type TimeSyncStatusOutput ¶ added in v0.2.9
type TimeSyncStatusOutput struct {
NTPService string `json:"ntp_service"`
SyncStatus string `json:"sync_status"`
NTPEnabled bool `json:"ntp_enabled"`
SystemClock string `json:"system_clock_utc"`
RTCTime string `json:"rtc_time,omitempty"`
TimeServer string `json:"time_server,omitempty"`
Stratum int `json:"stratum,omitempty"`
LastSyncMs int `json:"last_sync_ms,omitempty"`
ChronyPresent bool `json:"chrony_present"`
NTPDatePresent bool `json:"ntpdate_present"`
OutputErrors
}
func GatherTimeSyncStatus ¶ added in v0.2.9
func GatherTimeSyncStatus(ctx context.Context) (*TimeSyncStatusOutput, error)
func HandleGetTimeSyncStatus ¶ added in v0.2.9
func HandleGetTimeSyncStatus( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *TimeSyncStatusOutput, error)
type TopIOProcessesOutput ¶
type TopIOProcessesOutput struct {
Processes []IOProcessStat `json:"processes"`
OutputErrors
}
func GatherTopIOProcesses ¶
func GatherTopIOProcesses( ctx context.Context, limit int, ) (*TopIOProcessesOutput, error)
func HandleGetTopIOProcesses ¶
func HandleGetTopIOProcesses( ctx context.Context, _ *mcp.CallToolRequest, input GetTopIOProcessesInput, ) (*mcp.CallToolResult, *TopIOProcessesOutput, error)
type UserAutomationOutput ¶ added in v0.1.8
type UserAutomationOutput struct {
CronJobs []CronJob `json:"cron_jobs"`
SystemdTimers []SystemdTimer `json:"systemd_timers"`
OutputErrors
}
func GatherUserAutomation ¶ added in v0.1.8
func GatherUserAutomation( ctx context.Context, ) (*UserAutomationOutput, error)
func HandleGetUserAutomation ¶ added in v0.1.8
func HandleGetUserAutomation( ctx context.Context, _ *mcp.CallToolRequest, _ NoArgs, ) (*mcp.CallToolResult, *UserAutomationOutput, error)
type VMStatInfo ¶ added in v0.2.9
Source Files
¶
Click to show internal directories.
Click to hide internal directories.