Skip to main content
Glama

mcp-chain-of-thought

pathUtils.ts1.18 kB
import fs from "fs/promises"; import path from "path"; import { fileURLToPath } from "url"; // Get project root directory path const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const PROJECT_ROOT = path.resolve(__dirname, "../.."); // Get data directory path const DATA_DIR = process.env.DATA_DIR || path.join(PROJECT_ROOT, "data"); /** * Get rules file path * @returns Complete path to the rules file */ export function getRulesFilePath(): string { return path.join(DATA_DIR, "rules.md"); } /** * Ensure rules file exists * If the file doesn't exist, it will try to copy from root directory or create an empty file */ export async function ensureRulesFileExists(): Promise<void> { const dataRulesPath = getRulesFilePath(); try { // Check if rules file exists in DATA_DIR directory await fs.access(dataRulesPath); } catch (error) { // Rules file doesn't exist in DATA_DIR directory await fs.mkdir(path.dirname(dataRulesPath), { recursive: true }); await fs.writeFile( dataRulesPath, "# Development Guidelines\n\nPlease define project standards in this file.", "utf-8" ); } }

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/liorfranko/mcp-chain-of-thought'

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