rhombus-node-mcp
Version:
MCP server for Rhombus API
20 lines (19 loc) • 646 B
JavaScript
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;