Documentation
¶
Overview ¶
Package importer converts MCP server entries found in client configs into gridctl stack entries. It is pure logic: callers (the import CLI) do all file I/O. The package normalizes the client dialect matrix (key spellings, transport names, command shapes), unwraps bridge entries, dedupes servers found in several clients, filters gridctl's own gateway entries, and classifies plaintext secrets so the CLI can offer vault moves.
Index ¶
Constants ¶
const ( SkipGatewaySelfEntry = "gateway_self_entry" SkipUnsupported = "unsupported_entry" SkipNameCollision = "name_collision" )
Skip reasons attached to candidates that will not be imported.
Variables ¶
This section is empty.
Functions ¶
func ClassifySecretKeys ¶
ClassifySecretKeys returns the env keys whose values are literal secrets: non-empty, not a recognized reference, with a secret-suggestive key name. Sorted for deterministic prompts and output.
func IsGatewaySelfEntry ¶
IsGatewaySelfEntry reports whether a scanned entry is gridctl's own gateway connection. The entry key matching the link server name is the primary signal; a localhost URL pointing at the gateway's /sse or /mcp endpoints (directly or through an mcp-remote bridge) is the secondary one. A user's own localhost server under a different name and path is NOT flagged.
func IsReferenceValue ¶
IsReferenceValue reports whether an env value is a reference that must be preserved verbatim rather than treated as a secret literal: interpolation dialects (${env:VAR}, ${input:id}, ${file:...}, ${VAR}, ${{ secrets.X }}), bare $VAR and %VAR%, 1Password op:// URIs, and gridctl's own ${var:KEY}.
func MapEntry ¶
func MapEntry(slug string, entry provisioner.ServerEntry) (config.MCPServer, []string, error)
MapEntry converts one raw client entry into a config.MCPServer plus warnings. An error means the entry cannot be represented (for example a websocket transport) and should surface as a skipped candidate.
Types ¶
type Candidate ¶
type Candidate struct {
Name string
Server config.MCPServer
FoundIn []string // client slugs the server was found in, sorted
Source string // canonical slug (first client in registry order)
Warnings []string
SkipReason string // empty means importable
SecretKeys []string // env keys whose literal values look like secrets
}
Candidate is one importable server assembled from client config entries.