{"record":{"id":"709ffdabbe2bd65d","repo":"sipeed/picoclaw","slug":"mcp-server-q-not-found-709ffd","errorCode":null,"errorMessage":"MCP server %q not found","messagePattern":"MCP server %q not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/picoclaw/internal/mcp/test.go","lineNumber":27,"sourceCode":")\n\nfunc newTestCommand() *cobra.Command {\n\tvar timeout time.Duration\n\n\tcmd := &cobra.Command{\n\t\tUse:   \"test <name>\",\n\t\tShort: \"Test connectivity for a configured MCP server\",\n\t\tArgs:  cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tcfg, err := loadConfig()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tname := args[0]\n\t\t\tserver, exists := cfg.Tools.MCP.Servers[name]\n\t\t\tif !exists {\n\t\t\t\treturn fmt.Errorf(\"MCP server %q not found\", name)\n\t\t\t}\n\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), timeout)\n\t\t\tdefer cancel()\n\n\t\t\tresult, err := serverProbe(ctx, name, server, cfg.WorkspacePath())\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to reach MCP server %q: %w\", name, err)\n\t\t\t}\n\n\t\t\tfmt.Fprintf(cmd.OutOrStdout(), \"✓ MCP server %q reachable (%d tools).\\n\", name, result.ToolCount)\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.Flags().DurationVar(&timeout, \"timeout\", 5*time.Second, \"Connection timeout\")\n\n\treturn cmd","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/mcp/test.go#L9-L45","documentation":"Returned by picoclaw mcp test <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; the command exits before any connectivity check runs.","triggerScenarios":"picoclaw mcp test with a typo'd or wrongly-cased name; testing a server that was never added or was already removed; picoclaw resolving a different config file (workspace vs user) than the one holding the entry.","commonSituations":"Smoke-test scripts referencing stale server names; entries added in a different directory whose workspace config differs; CI environments with a fresh HOME.","solutions":["List configured servers with picoclaw mcp list and copy the exact key","Re-run picoclaw mcp test <exact-name>","If the server is missing, add it first with picoclaw mcp add","Verify which config file picoclaw loads for the current workspace"],"exampleFix":"# before\n$ picoclaw mcp test Github\nMCP server \"Github\" not found\n\n# after\n$ picoclaw mcp list\nNAME      TYPE     ENABLED\ngithub    stdio    true\n$ picoclaw mcp test github","handlingStrategy":"validation","validationCode":"if _, ok := cfg.Tools.MCP.Servers[name]; !ok {\n  available := make([]string, 0, len(cfg.Tools.MCP.Servers))\n  for k := range cfg.Tools.MCP.Servers {\n    available = append(available, k)\n  }\n  return fmt.Errorf(\"MCP server %q not found; available: %v\", name, available)\n}","typeGuard":"func isMCPServerNotFound(err error) bool {\n  return err != nil && strings.Contains(err.Error(), \"MCP server\") && strings.Contains(err.Error(), \"not found\")\n}","tryCatchPattern":"if err := testCmd.Execute(); err != nil {\n  if isMCPServerNotFound(err) {\n    // show `picoclaw mcp list` output next to the error\n  }\n  return err\n}","preventionTips":["Pull server names from picoclaw mcp list, not from memory","In monitoring scripts, verify the name exists before asserting connectivity","Names are case-sensitive — copy exactly"],"tags":["cli","mcp","config","not-found"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}