{"record":{"id":"cef4c4eba828acec","repo":"Hmbown/CodeWhale","slug":"no-external-mcp-candidate-named-name-run-mcp","errorCode":null,"errorMessage":"No external MCP candidate named '{name}'. Run /mcp import to list sources with provenance.","messagePattern":"No external MCP candidate named '(.+?)'\\. Run /mcp import to list sources with provenance\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/ui/provider_routes.rs","lineNumber":742,"sourceCode":") -> anyhow::Result<String> {\n    use crate::mcp::external_import::{\n        ImportDecision, apply_approved, discover_external_sources, load_consent_store,\n        merge_approved_into_config, record_decisions, save_consent_store,\n    };\n    use std::collections::HashMap;\n    use std::time::{SystemTime, UNIX_EPOCH};\n\n    let home = crate::config::effective_home_dir().unwrap_or_else(|| PathBuf::from(\".\"));\n    let market_path = codewhale_config::codewhale_home()\n        .ok()\n        .map(|h| h.join(\"mcp-marketplace.json\"));\n    let markets: Vec<PathBuf> = market_path.into_iter().collect();\n    let all = discover_external_sources(&home, workspace, &markets);\n    let candidate = all\n        .iter()\n        .find(|c| c.name.eq_ignore_ascii_case(name))\n        .ok_or_else(|| {\n            anyhow::anyhow!(\n                \"No external MCP candidate named '{name}'. Run /mcp import to list sources with provenance.\"\n            )\n        })?;\n\n    if approve && candidate.hard_blocked {\n        anyhow::bail!(\n            \"Refusing to import '{}': {} (enabled=false is a hard block)\",\n            candidate.name,\n            candidate.block_reason.as_deref().unwrap_or(\"hard blocked\")\n        );\n    }\n\n    let mut decisions = HashMap::new();\n    decisions.insert(\n        candidate.name.clone(),\n        if approve {\n            ImportDecision::Approve\n        } else {","sourceCodeStart":724,"sourceCodeEnd":760,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tui/ui/provider_routes.rs#L724-L760","documentation":"MCP import resolves the requested name (case-insensitive equality) against external MCP sources discovered from the home dir, the workspace, and the marketplace file (~/.codewhale/mcp-marketplace.json via codewhale_home). A miss bails with this message pointing to /mcp import, which lists candidates with provenance. Note this is a discovery miss - a discovered-but-hard-blocked candidate is found and then refused by a separate check.","triggerScenarios":"Importing a name that matches no discovered candidate: typo, the source file or mcp-marketplace.json absent/empty, discovery paths not covering where the source lives, or the entry renamed upstream.","commonSituations":"Name copied from stale docs; marketplace JSON not synced; workspace-level source moved; case differences beyond exact-ignore-case (no fuzzy or prefix matching).","solutions":["Run /mcp import with no argument to list candidates with provenance, then copy the exact name","Add or refresh the source: place it in a discovered location or update mcp-marketplace.json","Check spelling - matching is case-insensitive but exact, not fuzzy"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust - list discovered candidates and exact-match before import\nlet home = crate::config::effective_home_dir().unwrap_or_else(|| PathBuf::from(\".\"));\nlet all = discover_external_sources(&home, workspace, &markets);\nif !all.iter().any(|c| c.name.eq_ignore_ascii_case(name)) {\n    return list_candidates_with_provenance(&all); // show what IS importable instead of erroring blind\n}","typeGuard":null,"tryCatchPattern":"match all.iter().find(|c| c.name.eq_ignore_ascii_case(name)) {\n    Some(candidate) => import_candidate(candidate),\n    None => show_hint(\"run /mcp import to list sources with provenance\"),\n}","preventionTips":["Run /mcp import without arguments first to see exact candidate names","Keep mcp-marketplace.json synced and workspace sources in discovered locations","Remember matching is case-insensitive but exact - no fuzzy or prefix matching"],"tags":["mcp","import","marketplace","discovery","not-found"],"backgroundTag":"mcp-import-candidate-missing","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}