Skip to main content
Glama
blade47

ShadowGit MCP Server

by blade47
file-utils.ts1.11 kB
/** * File system utility functions */ import * as fs from 'fs'; import * as path from 'path'; import * as os from 'os'; export function getStorageLocation(): string { const platform = process.platform; const homeDir = os.homedir(); switch (platform) { case 'darwin': return path.join(homeDir, '.shadowgit'); case 'win32': return path.join( process.env.LOCALAPPDATA || path.join(homeDir, 'AppData', 'Local'), 'shadowgit' ); default: return path.join( process.env.XDG_DATA_HOME || path.join(homeDir, '.local', 'share'), 'shadowgit' ); } } export function fileExists(filePath: string): boolean { try { return fs.existsSync(filePath); } catch { return false; } } export function readJsonFile<T>(filePath: string, defaultValue: T): T { try { if (!fileExists(filePath)) { return defaultValue; } const content = fs.readFileSync(filePath, 'utf-8'); return JSON.parse(content) as T; } catch (error) { return defaultValue; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/blade47/shadowgit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server