Skip to content

[plan] Consolidate MCPServerConfig into single definition #7371

@github-actions

Description

@github-actions

Objective

Eliminate the duplicate MCPServerConfig type definition by using parser.MCPServerConfig as the single source of truth.

Context

MCPServerConfig is defined in two locations:

  1. pkg/cli/mcp_gateway_command.go:30 - Simplified subset (5 fields)
  2. pkg/parser/mcp.go:81 - Complete definition (13 fields)

The CLI version is a subset of the parser version. All fields use omitempty, so the CLI can safely use the full parser type and ignore unused fields.

Approach

  1. Remove MCPServerConfig definition from pkg/cli/mcp_gateway_command.go
  2. Add import for github.com/githubnext/gh-aw/pkg/parser in CLI files
  3. Update all CLI references to use parser.MCPServerConfig
  4. Verify that CLI code works correctly with the extended type (unused fields are ignored)
  5. Run tests to ensure no regression

Files to Modify

  • pkg/cli/mcp_gateway_command.go - Remove duplicate type, import parser package, update references
  • Any other files in pkg/cli/ that reference MCPServerConfig

Acceptance Criteria

  • Only one MCPServerConfig definition exists (in pkg/parser/mcp.go)
  • CLI code successfully uses parser.MCPServerConfig
  • All tests pass (make test)
  • No functional changes to CLI behavior

Estimated Effort

1-2 hours
Related to #7369

AI generated by Plan Command for discussion #7368

Metadata

Metadata

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