Documentation
¶
Overview ¶
Package host detects the MCP host (Claude Code, Codex, Cursor, Windsurf, etc.) that launched this proxy process and returns its issuer/operator identity for stamping on every emitted receipt.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Identity ¶
type Identity struct {
IssuerName string // e.g. "Claude Code"
IssuerModel string // optional, e.g. ""
OperatorID string // e.g. "did:web:anthropic.com"
OperatorName string // e.g. "Anthropic"
Source string // "auto:<comm>" | "env:<var>" | "flags" | "unknown" — for logging only
}
Identity is what the proxy reports to the daemon about the host that launched it.
func Detect ¶
func Detect() Identity
Detect inspects the parent process name via /proc/<ppid>/comm and returns the best-guess Identity. A registry hit yields Source "auto:<comm>". When /proc gives no useful result — the parent comm is unknown (e.g. aliased by a wrapper shell) or unreadable — detection falls through to an environment marker scan, yielding Source "env:<var>". Source is "unknown" when neither signal matches.