Skip to content

Commit fccc444

Browse files
author
Eric Oliver
committed
address reviewer feedback
1 parent 05c1a12 commit fccc444

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

docs/product-stories/cli-utility/dev-prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
we are ready to work on issue #14 (docs/product-stories/cli-utility/story-14-non-interactive-mode.md) in repo https://github.com/sakamotopaya/code-agent.
1+
we are ready to work on issue #15 (docs/product-stories/cli-utility/story-15-mcp-server-support.md) in repo https://github.com/sakamotopaya/code-agent.
22
follow the normal git flow. create a new local branch for the story.
33
code the tasks and unit tests that prove the task are complete.
44
if you need information about prior stories, you can find them locally here docs/product-stories/cli-utility

src/cli/config/CliConfigManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export const cliEnvironmentConfigSchema = z.object({
3232
.optional(),
3333
ROO_MAX_REQUESTS: z
3434
.string()
35-
.transform((val) => parseInt(val))
35+
.transform((val) => parseInt(val, 10))
3636
.optional(),
3737
ROO_REQUEST_DELAY: z
3838
.string()
39-
.transform((val) => parseInt(val))
39+
.transform((val) => parseInt(val, 10))
4040
.optional(),
4141

4242
// File paths

src/cli/index.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ interface CliOptions {
5050
mcpTimeout?: number
5151
mcpRetries?: number
5252
mcpAutoConnect?: boolean
53+
noMcpAutoConnect?: boolean
5354
mcpLogLevel?: string
5455
}
5556

@@ -154,10 +155,20 @@ program
154155
.option("--mcp-config <path>", "Path to MCP configuration file", validatePath)
155156
.option("--mcp-server <id>", "MCP server IDs to connect to (can be repeated)", collectArray, [])
156157
.option("--mcp-timeout <ms>", "Timeout for MCP operations in milliseconds", validateTimeout)
157-
.option("--mcp-retries <count>", "Number of retry attempts for MCP operations", parseInt)
158-
.option("--mcp-auto-connect", "Automatically connect to enabled MCP servers", true)
158+
.option("--mcp-retries <count>", "Number of retry attempts for MCP operations", (value) => parseInt(value, 10))
159+
.option("--mcp-auto-connect", "Automatically connect to enabled MCP servers")
160+
.option("--no-mcp-auto-connect", "Do not automatically connect to enabled MCP servers")
159161
.option("--mcp-log-level <level>", "MCP logging level (error, warn, info, debug)", validateMcpLogLevel)
160162
.action(async (options: CliOptions) => {
163+
// Handle MCP auto-connect logic: default to true, but allow explicit override
164+
if (options.mcpAutoConnect === undefined && options.noMcpAutoConnect === undefined) {
165+
options.mcpAutoConnect = true // Default behavior
166+
} else if (options.noMcpAutoConnect) {
167+
options.mcpAutoConnect = false
168+
} else if (options.mcpAutoConnect) {
169+
options.mcpAutoConnect = true
170+
}
171+
161172
try {
162173
// Handle config generation
163174
if (options.generateConfig) {

0 commit comments

Comments
 (0)