mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 05:00:46 +00:00
- Added a new reconnect command to the MCP CLI. - Implemented auto-reconnect functionality in DiscoveredMCPToolInvocation to handle connection errors with retry logic. - Enhanced tests to cover reconnect scenarios and ensure reliability during connection failures.
29 lines
863 B
TypeScript
29 lines
863 B
TypeScript
/**
|
|
* @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';
|
|
import { reconnectCommand } from './mcp/reconnect.js';
|
|
|
|
export const mcpCommand: CommandModule = {
|
|
command: 'mcp',
|
|
describe: 'Manage MCP servers',
|
|
builder: (yargs: Argv) =>
|
|
yargs
|
|
.command(addCommand)
|
|
.command(removeCommand)
|
|
.command(listCommand)
|
|
.command(reconnectCommand)
|
|
.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.
|
|
},
|
|
};
|