JuliusBrussee/caveman · error · Error
caveman-mcp lacks current mcp_recovery capability; run…
Error message
caveman-mcp ${compatible.probe.version} lacks current mcp_recovery capability; run `caveman setup --install` What it means
The CLI requires the companion `caveman-mcp` binary to advertise the current `mcp_recovery` capability before it will wire it up. `nativeMcpBinaryRequired()` probes the binary with `probeMcpBinary()`; if the probe reports `current: false`, the installed binary is either too old or a stale cached build that predates the capability. The fix is to reinstall the binary via `caveman setup --install`.
Solutions
- Run `caveman setup --install` to download/install a current caveman-mcp binary
- Remove the stale caveman-mcp binary (check PATH and ~/.caveman/bin) and re-run setup
- Reinstall/upgrade the caveman CLI package so binary and CLI versions match, then re-run setup
- Check `caveman doctor` output to confirm the probe now reports current
Example fix
// before: stale binary left from previous install $ caveman serve # throws: caveman-mcp 0.9.2 lacks current mcp_recovery capability // after $ caveman setup --install # installs current caveman-mcp $ caveman serve # proceeds
Defensive patterns
Strategy: validation
Validate before calling
// Before invoking CLI commands that need the native MCP binary:
const probe = probeMcpBinary();
if (!probe || !probe.probe.current) {
console.warn('caveman-mcp outdated/missing — run: caveman setup --install');
} Try / catch
try {
await runCaveman(args);
} catch (e) {
if (String(e.message).includes('lacks current mcp_recovery capability')) {
await exec('caveman setup --install');
return retry();
}
throw e;
} Prevention
- Always re-run `caveman setup --install` after upgrading the caveman CLI package
- Pin CLI and Go binary versions to matching releases
- Run `caveman doctor` in CI before invoking commands that need native binaries
- Don't keep stale caveman-mcp copies earlier on PATH than the managed install
When it happens
Trigger: Calling any CLI command that resolves the native MCP binary via `nativeMcpBinaryRequired()` when the probe finds a caveman-mcp binary but its reported version/capability set does not include the current mcp_recovery capability (`compatible.probe.current === false`).
Common situations: Upgrading the CLI (npm) without re-running `caveman setup --install`, so an older caveman-mcp from a previous release is still on PATH; a leftover binary in ~/.caveman/bin from an old install; partial upgrades where the probe cache has a stale version.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- caveman-proxy lacks current native_runtime_v1 capability…
- native integration postflight is
- agent-native setup failed
- caveman-proxy not found; run `caveman setup --install`
- already exists with non-canonical content; refusing to…
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/4dab3c35cfcabece.
Report an issue: GitHub.
Appendix: source
Thrown at packages/cli/src/index.ts:6987
try {
unlinkSync(path);
fsyncParentDirectory(path);
} catch (error) {
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
}
}
function parseJsonFileObject(path: string, bytes: Buffer | null): Record<string, unknown> {
if (!bytes || bytes.length === 0) return {};
const parsed = JSON.parse(bytes.toString("utf8"));
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error(`${path} is not a JSON object`);
return parsed as Record<string, unknown>;
}
function nativeMcpBinaryRequired(): string {
const compatible = probeMcpBinary();
if (!compatible) throw new Error("caveman-mcp not found; run `caveman setup --install`");
if (!compatible.probe.current) throw new Error(`caveman-mcp ${compatible.probe.version} lacks current mcp_recovery capability; run \`caveman setup --install\``);
return compatible.binary;
}
function nativeProxyBinaryRequired(gw: string): void {
if (wrapMode(gw) !== "local") return;
const binary = resolveGoBin("caveman-proxy", "CAVEMAN_PROXY_BIN");
if (!binary) throw new Error("caveman-proxy not found; run `caveman setup --install`");
const probe = probeVersionedBinary(binary, "native_runtime_v1");
if (!probe.current) throw new Error(`caveman-proxy ${probe.version} lacks current native_runtime_v1 capability; run \`caveman setup --install\``);
}
function nativeHostProbe(agent: AgentProfile): { binary: string | null; launchable: boolean; version: string | null; error: string | null } {
const binary = which(binOf(agent));
if (!binary) return { binary: null, launchable: false, version: null, error: "binary_not_found" };
try {
const invocation = portableInvocation(binary, ["--version"]);
const out = spawnSync(invocation.command, invocation.args, { encoding: "utf8", timeout: 3000 });
if (out.error) return { binary, launchable: false, version: null, error: boundedHookString(out.error.message, 240) ?? "version_probe_failed" };View on GitHub (pinned to 3ee70a1026)