@buildappolis/sharex-mcp-server
Version:
Model Context Protocol server for seamless ShareX integration with Claude Code - view screenshots and GIFs instantly
35 lines • 1.16 kB
JavaScript
import * as os from "os";
import * as path from "path";
import * as fs from "fs/promises";
export function getShareXConfigPath() {
const platform = os.platform();
if (platform === "win32") {
const documentsPath = path.join(os.homedir(), "Documents", "ShareX");
return documentsPath;
}
throw new Error("ShareX is only supported on Windows");
}
export function getClaudeConfigPath() {
const platform = os.platform();
if (platform === "win32") {
return path.join(os.homedir(), ".claude", "settings.json");
}
else {
return path.join(os.homedir(), ".claude", "settings.json");
}
}
export async function ensureDirectory(dirPath) {
await fs.mkdir(dirPath, { recursive: true });
}
export function convertWindowsPathToWSL(windowsPath) {
// Convert D:\path\to\file to /mnt/d/path/to/file
const normalized = windowsPath.replace(/\\/g, "/");
const match = normalized.match(/^([A-Za-z]):(.*)/);
if (match) {
const drive = match[1].toLowerCase();
const path = match[2];
return `/mnt/${drive}${path}`;
}
return normalized;
}
//# sourceMappingURL=paths.js.map