1.3 KiB
1.3 KiB
| summary | read_when | ||
|---|---|---|---|
| MCPCommand split notes (Nov 17, 2025) |
|
MCPCommand Split Notes (Nov 17, 2025)
Status: Archived · Focus: decomposing MCPCommand and normalizing formatting/errors.
- Broke the 1.2K-line
MCPCommand.swiftinto per-subcommand files plus small helpers (MCPDefaults,MCPCallTypes,MCPCallFormatter,MCPArgumentParsing,MCPClientManaging) to localize responsibilities and cut duplication. - Behavior remains the same; the next improvement should be introducing an
MCPClientServicefacade (wrappingTachikomaMCPClientManager) and a sharedMCPContextto eliminate leftoverRuntimeStorageboilerplate and make mocking straightforward. - Consolidate output rendering: move List/Info JSON + text formatting into the formatter so field naming/order stays consistent, and decide whether stderr/os_log suppression stays or moves into a single helper.
- Normalize error handling across subcommands with a shared error type mapping to
ErrorCode(today only Call usesCallError), and reuse key/value + JSON parsing helpers everywhere. - Testing gaps: add unit tests for argument parsing, call payload serialization, and list/info formatting with a mock client service; run
swift buildplus the CLI smoke tests once added.