Objective
Introduce an MCPServerID semantic type in pkg/constants and apply it to the 3 MCP server ID constants, providing compile-time safety when referencing MCP server identifiers.
Context
Discussion #17885 (Typist - Go Type Consistency Analysis) identified 3 untyped string constants for MCP server IDs used in 15+ locations across pkg/workflow and pkg/cli. Typing them makes the intent explicit and prevents accidental string mixing.
Location
File: pkg/constants/constants.go (around lines 648–657)
// Current — untyped strings
const SafeOutputsMCPServerID = "safeoutputs"
const SafeInputsMCPServerID = "safeinputs"
const AgenticWorkflowsMCPServerID = "agenticworkflows"
// Proposed — typed
type MCPServerID string
func (m MCPServerID) String() string { return string(m) }
const SafeOutputsMCPServerID MCPServerID = "safeoutputs"
const SafeInputsMCPServerID MCPServerID = "safeinputs"
const AgenticWorkflowsMCPServerID MCPServerID = "agenticworkflows"
Approach
- Add
type MCPServerID string with String() and IsValid() methods (consistent with other semantic types in pkg/constants) in pkg/constants/constants.go
- Apply the type to all 3 MCP server ID constants
- Update the 15+ usage sites — many use string concatenation for YAML builders (e.g.,
"[mcp_servers." + constants.SafeOutputsMCPServerID + "]"). These will require .String() or string() conversion
Files to Modify
pkg/constants/constants.go — add MCPServerID type, apply to 3 constants
pkg/workflow/*.go — update usage sites in YAML builders
pkg/cli/*.go — update any usage sites
Acceptance Criteria
Generated by Plan Command for issue #discussion #17885
Objective
Introduce an
MCPServerIDsemantic type inpkg/constantsand apply it to the 3 MCP server ID constants, providing compile-time safety when referencing MCP server identifiers.Context
Discussion #17885 (Typist - Go Type Consistency Analysis) identified 3 untyped string constants for MCP server IDs used in 15+ locations across
pkg/workflowandpkg/cli. Typing them makes the intent explicit and prevents accidental string mixing.Location
File:
pkg/constants/constants.go(around lines 648–657)Approach
type MCPServerID stringwithString()andIsValid()methods (consistent with other semantic types inpkg/constants) inpkg/constants/constants.go"[mcp_servers." + constants.SafeOutputsMCPServerID + "]"). These will require.String()orstring()conversionFiles to Modify
pkg/constants/constants.go— addMCPServerIDtype, apply to 3 constantspkg/workflow/*.go— update usage sites in YAML builderspkg/cli/*.go— update any usage sitesAcceptance Criteria
type MCPServerID stringdefined withString()andIsValid()methodsMCPServerIDtypemake buildandmake test-unitpassmake fmtandmake lintpass