Documentation
¶
Index ¶
Constants ¶
const MCPSessionContextKey = ContextKey("mcp_session")
MCPSessionContextKey is the context key for storing MCP ServerSession
Variables ¶
This section is empty.
Functions ¶
func HandleK8sError ¶
HandleK8sError sends appropriate MCP log messages based on Kubernetes API error types. operation should describe the operation (e.g., "pod access", "deployment deletion").
func Sanitize ¶ added in v0.0.63
Sanitize redacts secret-shaped substrings (Bearer/Basic credentials, JWTs, JSON "token"/"secret"/"password"/... fields, AWS/GitHub/Anthropic keys, private-key PEM blocks, DB connection strings) from msg. It is intended for log messages that may inline user-supplied or tool-supplied payloads.
This is best-effort: the patterns are a denylist, and content that doesn't match a known shape (e.g. arbitrary YAML kubeconfig fields) passes through unchanged. Callers handling structured credentials should still avoid logging them in the first place.
Types ¶
type Level ¶
type Level int
Level represents MCP log severity levels per RFC 5424 syslog specification. https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/logging#log-levels
const ( // LevelDebug is for detailed debugging information. LevelDebug Level = iota // LevelInfo is for general informational messages. LevelInfo // LevelNotice is for normal but significant events. LevelNotice // LevelWarning is for warning conditions. LevelWarning // LevelError is for error conditions. LevelError // LevelCritical is for critical conditions. LevelCritical // LevelAlert is for conditions requiring immediate action. LevelAlert // LevelEmergency is for system unusable conditions. LevelEmergency )
Log levels from least to most severe, per MCP specification.