sipeed/picoclaw · info
aborted: MCP server %q already exists
Error message
aborted: MCP server %q already exists
What it means
The target MCP server name already exists in cfg.Tools.MCP.Servers, --force was not given, and the overwrite prompt was answered with anything other than y/yes (or stdin hit EOF, which counts as 'no'). This is a deliberate user abort: the config is unchanged and nothing was written.
Source
Thrown at cmd/picoclaw/internal/mcp/add.go:52
}
cfg, err := loadConfig()
if err != nil {
return err
}
if cfg.Tools.MCP.Servers == nil {
cfg.Tools.MCP.Servers = make(map[string]config.MCPServerConfig)
}
if _, exists := cfg.Tools.MCP.Servers[name]; exists && !opts.Force {
var overwrite bool
overwrite, err = confirmOverwrite(cmd.InOrStdin(), cmd.OutOrStdout(), name)
if err != nil {
return fmt.Errorf("failed to confirm overwrite: %w", err)
}
if !overwrite {
return fmt.Errorf("aborted: MCP server %q already exists", name)
}
}
server, err := buildServerConfig(target, targetArgs, opts)
if err != nil {
return err
}
cfg.Tools.MCP.Enabled = true
cfg.Tools.MCP.Servers[name] = server
if err := saveValidatedConfig(cfg); err != nil {
return err
}
fmt.Fprintf(cmd.OutOrStdout(), "✓ MCP server %q saved.\n", name)
return nil
},View on GitHub (pinned to 49183d7e8d)
Solutions
- Re-run with `--force` (`-f`) if you intend to replace the entry
- Pick a different <name> if you want both servers
- Answer y at the prompt to overwrite
- To change one field of the existing server, edit the config instead of re-adding
Defensive patterns
Strategy: validation
Validate before calling
# check existence first so the prompt (and abort) never happens picoclaw mcp list | grep -q "^\s*<name>\b" && echo "exists: pass --force or pick a new name"
Prevention
- Names are unique keys: check `picoclaw mcp list` before add in automation
- Pass --force when the intent is replace
- Treat exit-with-this-message as a no-op, not a failure, in scripts
When it happens
Trigger: `picoclaw mcp add <existing-name> ...` without -f, then answering 'n' or 'no', or feeding EOF (Ctrl-D) at the prompt.
Common situations: Retrying an add that already succeeded; wanting to edit rather than replace; wrong name chosen on purpose to back out.
Related errors
- failed to confirm overwrite: %w
- missing value for %s
- usage: picoclaw mcp add [flags] <name> <command-or-url> [arg
- unsupported transport %q
- --env can only be used with stdio transport
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/0b4e216ca6cb6d3c.
Report an issue: GitHub.