sipeed/picoclaw · error
MCP server %q not found
Error message
MCP server %q not found
What it means
Returned by picoclaw mcp remove <name> when the name is not a key under tools.mcp.servers in the loaded config. The lookup is an exact, case-sensitive map-key match, so any difference in spelling or case fails. Nothing is modified — the config is left untouched.
Source
Thrown at cmd/picoclaw/internal/mcp/remove.go:22
"fmt"
"github.com/spf13/cobra"
)
func newRemoveCommand() *cobra.Command {
return &cobra.Command{
Use: "remove <name>",
Short: "Remove an MCP server from config",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := loadConfig()
if err != nil {
return err
}
name := args[0]
if _, exists := cfg.Tools.MCP.Servers[name]; !exists {
return fmt.Errorf("MCP server %q not found", name)
}
delete(cfg.Tools.MCP.Servers, name)
if len(cfg.Tools.MCP.Servers) == 0 {
cfg.Tools.MCP.Servers = nil
cfg.Tools.MCP.Enabled = false
}
if err := saveValidatedConfig(cfg); err != nil {
return err
}
fmt.Fprintf(cmd.OutOrStdout(), "✓ MCP server %q removed.\n", name)
return nil
},
}
}
View on GitHub (pinned to 49183d7e8d)
Solutions
- List what is actually configured: picoclaw mcp list, and copy the exact key
- Re-run picoclaw mcp remove <exact-name>
- If the list is empty, determine which config file picoclaw loads for this directory and remove the entry there
- As a last resort, edit the config file and delete the key under tools.mcp.servers manually
Example fix
# before $ picoclaw mcp remove Weather MCP server "Weather" not found # after $ picoclaw mcp list NAME TYPE ENABLED weather stdio true $ picoclaw mcp remove weather
Defensive patterns
Strategy: validation
Validate before calling
cfg, err := loadConfig()
if err != nil {
return err
}
if _, ok := cfg.Tools.MCP.Servers[name]; !ok {
names := make([]string, 0, len(cfg.Tools.MCP.Servers))
for k := range cfg.Tools.MCP.Servers {
names = append(names, k)
}
sort.Strings(names)
return fmt.Errorf("MCP server %q not found; configured servers: %v", name, names)
} Type guard
func isMCPServerNotFound(err error) bool {
return err != nil && strings.Contains(err.Error(), "MCP server") && strings.Contains(err.Error(), "not found")
} Try / catch
if err := removeCmd.RunE(cmd, args); err != nil {
if isMCPServerNotFound(err) {
// list configured names and ask the user to pick, instead of failing
}
return err
} Prevention
- Always derive server names from picoclaw mcp list output, not from memory or docs
- Names are case-sensitive map keys — copy them exactly
- In scripts, check existence with picoclaw mcp list before calling remove
When it happens
Trigger: picoclaw mcp remove with a typo'd or wrongly-cased name; removing a server that was already removed; picoclaw resolving a different config file than the one the server was added to (workspace-level vs user config).
Common situations: Scripts written against an old server name; multiple config files (project and global) causing confusion about where the entry lives; names with quotes or spaces pasted incorrectly; CI running with a fresh HOME and an empty config.
Related errors
- MCP server %q not found
- MCP server %q not found
- local command %q is a directory
- local command %q is not executable
- ${label} must be a JSON object.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/58a2c1cf273ff3ba.
Report an issue: GitHub.