Implementation:1mcp app Agent removeCommand
| Knowledge Sources | |
|---|---|
| Domains | CLI, Configuration |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete CLI command for manually removing an MCP server entry from the configuration with confirmation and optional backup.
Description
The removeCommand function removes a manually-added MCP server from the configuration file. It prompts for confirmation unless `--yes` is provided, removes the server entry, and optionally creates a backup. Unlike `uninstallCommand` which is for registry-installed servers, `removeCommand` is for servers added via `mcp add`.
Usage
Import this function when you need to:
- Remove a manually-added server from the config file
- Skip confirmation with `--yes` flag
- Remove a server entry without registry interaction
Code Reference
Source Location
- Repository: 1MCP Agent
- File: src/commands/mcp/remove.ts (L27-49)
Signature
export interface RemoveCommandArgs extends GlobalOptions {
name: string;
yes?: boolean;
}
export function buildRemoveCommand(yargs: Argv): Argv;
export async function removeCommand(argv: RemoveCommandArgs): Promise<void>;
Import
import { removeCommand, buildRemoveCommand } from '@src/commands/mcp/remove.js';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Server name to remove |
| yes | boolean | No | Skip confirmation |
Outputs
| Name | Type | Description |
|---|---|---|
| config file | side effect | Server entry removed |
Usage Examples =
Remove a Server
1mcp mcp remove my-server
1mcp mcp remove my-server --yes