Skip to main content
Glama

SFCC Development MCP Server

by taurgis
path-resolver.ts1.46 kB
/** * Path Resolver Helper * * Provides utilities for resolving file and directory paths based on the current working directory. * This abstraction allows for easier path management and testing. */ import path from 'path'; import { fileURLToPath } from 'url'; export class PathResolver { /** * Get the current working directory (project root) */ static getCurrentWorkingDir(): string { // Get the directory of the current module file const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); // Return the parent directory (project root) return path.resolve(__dirname, '..'); } /** * Get a path relative to the current working directory */ static getRelativePath(...pathSegments: string[]): string { const currentDir = this.getCurrentWorkingDir(); return path.join(currentDir, ...pathSegments); } /** * Get the docs directory path relative to the current working directory */ static getDocsPath(): string { return this.getRelativePath('docs'); } /** * Get the best practices docs directory path relative to the current working directory */ static getBestPracticesPath(): string { return this.getRelativePath('docs', 'best-practices'); } /** * Get the SFRA docs directory path relative to the current working directory */ static getSFRADocsPath(): string { return this.getRelativePath('docs', 'sfra'); } }

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/taurgis/sfcc-dev-mcp'

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