UNPKG

rhombus-node-mcp

Version:
20 lines (19 loc) 646 B
import { fileURLToPath } from "node:url"; import path from "path"; import { getFilePathsInDirectory } from "../util.js"; async function getResources() { const currentDir = path.dirname(fileURLToPath(import.meta.url)); const filePaths = getFilePathsInDirectory(currentDir); const resources = []; for (const filePath of filePaths) { const imported = (await import(filePath)); if (imported.createResource !== undefined) { resources.push({ name: filePath, create: imported.createResource, }); } } return resources; } export default getResources;