-
Notifications
You must be signed in to change notification settings - Fork 324
[task] Consolidate MCP files into pkg/cli/mcp subpackage #4341
Copy link
Copy link
Closed as not planned
Labels
Description
Objective
Reorganize the 17 MCP-related files in pkg/cli into a dedicated pkg/cli/mcp/ subpackage to improve code organization and maintainability.
Context
The CLI package currently has 17 MCP-related files (all prefixed with mcp_*), which represents a significant portion of the package. This scattered organization makes the MCP functionality harder to navigate and maintain. Part of issue #4321.
Approach
- Create new
pkg/cli/mcp/directory structure with logical subdirectories:pkg/cli/mcp/registry/for registry-related filespkg/cli/mcp/workflow/for workflow loading/scanning
- Move and rename files (remove
mcp_prefix since they'll be in mcp package):mcp_add.go→mcp/add.gomcp_config_file.go→mcp/config.gomcp_inspect.go+mcp_inspect_mcp.go→mcp/inspect.go(consolidate)mcp_list.go→mcp/list.gomcp_list_tools.go→mcp/list_tools.gomcp_logs_guardrail.go→mcp/logs_guardrail.gomcp_registry.go+mcp_registry_list.go+mcp_registry_types.go→mcp/registry/packagemcp_schema.go→mcp/schema.gomcp_secrets.go→mcp/secrets.gomcp_server.go→mcp/server.gomcp_tool_table.go→mcp/tool_table.gomcp_validation.go→mcp/validation.gomcp_workflow_loader.go+mcp_workflow_scanner.go→mcp/workflow/package
- Update all imports across the codebase to reference new package locations
- Run tests to ensure no functionality is broken
Files to Create/Modify
Create:
pkg/cli/mcp/directory and subdirectories- New package files in
pkg/cli/mcp/,pkg/cli/mcp/registry/,pkg/cli/mcp/workflow/
Modify:
- All files that import the moved MCP CLI functions (update import paths)
- Move 17 MCP files from
pkg/cli/to appropriate locations inpkg/cli/mcp/
Delete:
- Original
pkg/cli/mcp_*.gofiles after successful move
Acceptance Criteria
- All 17 MCP files successfully moved to
pkg/cli/mcp/subpackage structure - Registry-related files organized in
pkg/cli/mcp/registry/subpackage - Workflow-related files organized in
pkg/cli/mcp/workflow/subpackage - All imports updated across codebase
- All existing tests pass:
make test-unit - No compilation errors:
make build - CLI commands continue to work correctly (manual testing of
gh aw mcpcommands) - Top-level
pkg/cli/directory reduced from 74 to ~60 files
Estimated Effort
8-10 hours
Priority
High Impact, Medium Effort (Priority 1)
Related to #4321
AI generated by Plan Command for #4321
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.