INNER CODE UNIT · TypeScript

resolveConfigPath

lazy-dinosaur/ccxt-mcp · src/index.ts:69

function resolveConfigPath(): string {
  return (
    configPath ||
    path.join(os.homedir(), ".config", "Claude", "claude_desktop_config.json")
  );
}

function readMcpBearerTokenFromConfig(configFilePath: string): string {
  if (!fs.existsSync(configFilePath)) {
    throw new Error(`Config file not found: ${configFilePath}`);
  }

  const raw = fs.readFileSync(configFilePath, "utf-8");
  const parsed = JSON.parse(raw);

  const tokenFromRoot =
    typeof parsed?.mcpBearerToken === "string"
      ? parsed.mcpBearerToken.trim()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…