summaryrefslogtreecommitdiff
path: root/packages/cli/src/commands/mcp.ts
diff options
context:
space:
mode:
authorJack Wotherspoon <[email protected]>2025-08-06 11:52:29 -0400
committerGitHub <[email protected]>2025-08-06 15:52:29 +0000
commitca4c745e3b620e3ac4eca24b610cc7b936c0a50d (patch)
treeeb1b9cfb46bd4fa2e7f9631828b0704df1050eb7 /packages/cli/src/commands/mcp.ts
parentb38f377c9a2672e88dd15119b38d908c0f00b54a (diff)
feat(mcp): add `gemini mcp` commands for `add`, `remove` and `list` (#5481)
Diffstat (limited to 'packages/cli/src/commands/mcp.ts')
-rw-r--r--packages/cli/src/commands/mcp.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/cli/src/commands/mcp.ts b/packages/cli/src/commands/mcp.ts
new file mode 100644
index 00000000..5e55286c
--- /dev/null
+++ b/packages/cli/src/commands/mcp.ts
@@ -0,0 +1,27 @@
+/**
+ * @license
+ * Copyright 2025 Google LLC
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+// File for 'gemini mcp' command
+import type { CommandModule, Argv } from 'yargs';
+import { addCommand } from './mcp/add.js';
+import { removeCommand } from './mcp/remove.js';
+import { listCommand } from './mcp/list.js';
+
+export const mcpCommand: CommandModule = {
+ command: 'mcp',
+ describe: 'Manage MCP servers',
+ builder: (yargs: Argv) =>
+ yargs
+ .command(addCommand)
+ .command(removeCommand)
+ .command(listCommand)
+ .demandCommand(1, 'You need at least one command before continuing.')
+ .version(false),
+ handler: () => {
+ // yargs will automatically show help if no subcommand is provided
+ // thanks to demandCommand(1) in the builder.
+ },
+};