ruvnet/RuView · error · Error

MCP repository access requires a trusted root configured at

Error message

MCP repository access requires a trusted root configured at server startup

What it means

All repository-touching MCP tools in harness/homecore/src/tools.js resolve repositories through resolveRepo, which refuses any call with context.source === 'mcp' unless the server was started with a configured trustedRoot. This fail-closed rule prevents MCP clients from directing the server at arbitrary directories.

Source

Thrown at harness/homecore/src/tools.js:140

  const paths = String(env.PATH || env.Path || '').split(delimiter).filter(Boolean);
  return paths.flatMap((path) => extensions.map((suffix) => join(path, `${command}${suffix}`)));
}

export function executableOnPath(command, env = process.env) {
  return executableCandidates(command, env).some((path) => {
    try {
      return existsSync(path) && statSync(path).isFile();
    } catch {
      return false;
    }
  });
}

function resolveRepo(repo, context = {}) {
  const candidate = repo ? resolve(repo) : (context.trustedRoot || findHomecoreRepo());
  if (!candidate) return null;
  if (context.source === 'mcp' && !context.trustedRoot) {
    throw new Error('MCP repository access requires a trusted root configured at server startup');
  }
  return assertTrustedHomecoreRepo(candidate, {
    trustedRoot: context.source === 'mcp' ? context.trustedRoot : candidate,
  });
}

export async function doctor(args = {}, context = {}) {
  const kernel = await getKernelStatus({ strict: args.strict_wasm === true });
  const nodeMajor = Number(process.versions.node.split('.')[0]);
  const repo = resolveRepo(args.repo, context);
  const repoRequired = typeof args.repo === 'string';
  const checks = {
    nodeSupported: Number.isInteger(nodeMajor) && nodeMajor >= 20,
    kernelLoaded: kernel.mcpValidation === null,
    wasmRequirement: args.strict_wasm === true ? kernel.resolvedBackend === 'wasm' : true,
    repository: repo ? true : !repoRequired,
  };
  return {

View on GitHub (pinned to 4685618388)

Solutions

  1. Start the MCP server from inside the trusted RuView checkout so startup records the trusted root
  2. For ad-hoc repositories use the CLI instead: node harness/homecore/bin/cli.js <cmd> --repo <path>
  3. If embedding the tools, resolve and pass the trusted root at server construction time

Example fix

# before
$ cd ~ && node harness/homecore/bin/cli.js mcp start   # trustedRoot never set

# after
$ cd /path/to/RuView && node harness/homecore/bin/cli.js mcp start
Defensive patterns

Strategy: validation

Validate before calling

// At MCP server startup, before serving any tool call:
import { assertTrustedHomecoreRepo } from './harness/homecore/src/repo-trust.js';
const trustedRoot = assertTrustedHomecoreRepo(process.cwd());
// Attach it to every tool invocation context:
const context = { source: 'mcp', trustedRoot };

Prevention

When it happens

Trigger: Invoking the doctor/verify/guidance MCP tools when 'homecore mcp start' was launched outside a RuView checkout (no trustedRoot detected or set at startup), or embedding the tools in a custom host that never populates context.trustedRoot.

Common situations: Starting the MCP server from the home directory, editors spawning MCP servers with a cwd outside the checkout, custom integrations skipping startup configuration.

Related errors


AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16). Data as JSON: /api/errors/aa4949cd45d84a73. Report an issue: GitHub.