Skip to main content
Glama
push-based

Angular Toolkit MCP

by push-based
file-existence.ts1.32 kB
import * as fs from 'node:fs'; import * as path from 'node:path'; import { AngularMcpServerOptions } from './angular-mcp-server-options.schema.js'; export function validateAngularMcpServerFilesExist( config: AngularMcpServerOptions, ) { const root = config.workspaceRoot; if (!fs.existsSync(root)) { throw new Error(`workspaceRoot directory does not exist: ${root}`); } const missingFiles: string[] = []; // Always require uiRoot, optional: storybookDocsRoot, deprecatedCssClassesPath const dsPaths = [ config.ds.storybookDocsRoot ? { label: 'ds.storybookDocsRoot', relPath: config.ds.storybookDocsRoot } : null, config.ds.deprecatedCssClassesPath ? { label: 'ds.deprecatedCssClassesPath', relPath: config.ds.deprecatedCssClassesPath, } : null, { label: 'ds.uiRoot', relPath: config.ds.uiRoot }, ].filter(Boolean) as { label: string; relPath: string }[]; for (const { label, relPath } of dsPaths) { const absPath = path.resolve(root, relPath); if (!fs.existsSync(absPath)) { missingFiles.push(`${label} (resolved to: ${absPath})`); } } if (missingFiles.length > 0) { throw new Error( `The following required files or directories do not exist:\n` + missingFiles.join('\n'), ); } }

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/push-based/angular-toolkit-mcp'

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