metamcp-filesystem-server-downloads
Version:
MCP filesystem server with automatic download link generation - configurable paths
10 lines (9 loc) • 505 B
TypeScript
/**
* Checks if an absolute path is within any of the allowed directories.
*
* @param absolutePath - The absolute path to check (will be normalized)
* @param allowedDirectories - Array of absolute allowed directory paths (will be normalized)
* @returns true if the path is within an allowed directory, false otherwise
* @throws Error if given relative paths after normalization
*/
export declare function isPathWithinAllowedDirectories(absolutePath: string, allowedDirectories: string[]): boolean;