AgentKit
ReferenceCLI commands

CLI commands

ak mcp remove

Remove an MCP server

ak mcp remove

Remove an MCP server

Synopsis

What it does: Removes one MCP server entry from a selected Claude-style MCP config file.

Who it's for: Scripts, CI jobs, and reviewers that need deterministic MCP config edits.

When to use it: Use after previewing existing MCP inventory with ak mcp list.

Examples: ak mcp remove memory ak mcp remove db --source .mcp.json --json

What changes on disk: Writes the selected MCP JSON file. Defaults to project .mcp.json.

Output modes: pretty default on TTY (colors, ASCII markers) plain auto when stdout piped or --no-interactive json --json (single-object envelope, NDJSON-safe)

Exit codes: 0 success 1 runtime error 2 invalid flags 3 user-cancel (SIGINT, prompt-cancel)

ak mcp remove <name> [flags]

Options

  -h, --help             help for remove
      --json             Emit machine-readable JSON (implies --no-interactive)
      --no-interactive   Disable interactive prompts (CI-safe)
  -q, --quiet            Suppress non-error output on stderr
      --source string    MCP config path to edit; defaults to project .mcp.json
  -V, --verbose          Extra diagnostic output on stderr (loses to --quiet)
  -y, --yes              Assume yes for all prompts

Options inherited from parent commands

      --claude-home string   Claude home override; defaults to AGENTKIT_CLAUDE_HOME or ~/.claude
      --cwd string           Project directory override; defaults to current working directory

SEE ALSO

  • ak mcp - Inspect local MCP server configuration

On this page