Implementation:1mcp app Agent updateCommand
| Knowledge Sources | |
|---|---|
| Domains | CLI, Configuration |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Concrete CLI command for updating an MCP server's configuration with diff preview, dry-run support, and batch update capability.
Description
The updateCommand function updates an existing MCP server's configuration in the config file. It supports updating a single server by name or all servers at once. It provides check-only mode to verify if updates are available, dry-run mode to preview changes, and exclusion lists to skip specific servers. A diff is shown before applying changes, and a config backup is created.
Usage
Import this function when you need to:
- Update a single server's configuration (type, command, url, env, tags, timeout)
- Batch update all servers with `--all`
- Check if updates are available without applying (`--check-only`)
- Preview changes with `--dry-run`
- Exclude specific servers from batch updates
Code Reference
Source Location
- Repository: 1MCP Agent
- File: src/commands/mcp/update.ts (L51-151)
Signature
export interface UpdateCommandArgs extends GlobalOptions {
name?: string;
all?: boolean;
exclude?: string[];
type?: string;
command?: string;
url?: string;
env?: string[];
tags?: string;
timeout?: number;
'check-only'?: boolean;
dryRun?: boolean;
}
export function buildUpdateCommand(yargs: Argv): Argv;
export async function updateCommand(argv: UpdateCommandArgs): Promise<void>;
Import
import { updateCommand, buildUpdateCommand } from '@src/commands/mcp/update.js';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | No | Server to update (or --all) |
| all | boolean | No | Update all servers |
| exclude | string[] | No | Exclude servers from batch |
| type, command, url, env, tags, timeout | various | No | New config values |
| check-only | boolean | No | Check without applying |
| dryRun | boolean | No | Preview changes |
Outputs
| Name | Type | Description |
|---|---|---|
| config file | side effect | Updated server config |
| stdout | text | Diff and update result |
Usage Examples
Update and Check
1mcp mcp update my-server --command=new-server.js
1mcp mcp update --all --exclude=server1,server2
1mcp mcp update my-server --check-only
1mcp mcp update my-server --dry-run