UNPKG

@buildappolis/sharex-mcp-server

Version:

Model Context Protocol server for seamless ShareX integration with Claude Code - view screenshots and GIFs instantly

29 lines 856 B
import * as fs from "fs/promises"; import * as path from "path"; export async function readJsonFile(filePath) { try { const content = await fs.readFile(filePath, "utf-8"); return JSON.parse(content); } catch { return null; } } export async function writeJsonFile(filePath, data) { const dir = path.dirname(filePath); await fs.mkdir(dir, { recursive: true }); await fs.writeFile(filePath, JSON.stringify(data, null, 2)); } export async function updateClaudeConfig(configPath, serverPath) { const config = await readJsonFile(configPath) || {}; if (!config.mcpServers) { config.mcpServers = {}; } config.mcpServers.sharex = { command: "node", args: [serverPath], env: {} }; await writeJsonFile(configPath, config); } //# sourceMappingURL=config.js.map