Skip to main content
Glama

Demo MCP Server

by kylekanouse
index.ts1.29 kB
/** * Resources Index * * This index file automatically loads all resource modules from the directory. * Uses the ModuleLoaderService for dynamic registration. */ import { ModuleLoaderService } from "../services/index.js"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { dirname, join } from "path"; import { fileURLToPath } from "url"; /** * Static method to register all resources in this directory * @param server MCP server instance */ export async function registerAllResources(server: McpServer): Promise<void> { const moduleLoader = new ModuleLoaderService(); const currentDir = dirname(fileURLToPath(import.meta.url)); console.log("Registering all resources..."); try { const modules = await moduleLoader.loadModulesFromDirectory(currentDir); for (const module of modules) { await moduleLoader.registerModule(module, server); } console.log(`✓ Successfully registered ${modules.length} resource modules`); } catch (error) { console.error("✗ Failed to register resources:", error); throw error; } } // Export individual resource modules for selective imports export { systemInfoResources } from "./system-info-resources.js"; export { configResources } from "./config-resources.js";

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/kylekanouse/Test-MCP---DEMO-MCP-Dev-1'

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