Skip to content

[plan] Add MCPServerID semantic type for MCP server ID constants #17891

@github-actions

Description

@github-actions

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

  1. Add type MCPServerID string with String() and IsValid() methods (consistent with other semantic types in pkg/constants) in pkg/constants/constants.go
  2. Apply the type to all 3 MCP server ID constants
  3. 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

  • type MCPServerID string defined with String() and IsValid() methods
  • All 3 MCP server ID constants use the MCPServerID type
  • All usage sites (string concatenation in YAML builders and elsewhere) compile correctly
  • make build and make test-unit pass
  • make fmt and make lint pass

Generated by Plan Command for issue #discussion #17885

  • expires on Feb 25, 2026, 11:40 AM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions