UNPKG

mcp-think-tank

Version:

Structured thinking and knowledge management tool for Model Context Protocol

38 lines (37 loc) 1.22 kB
/** * Set up FastMCP resources and templates * * @param server FastMCP server instance */ export function setupResources(server) { try { // Add basic resources server.addResource({ uri: 'status://health', name: "Health Check", mimeType: "text/plain", load: async () => ({ text: "ok" }) }); // Add resource templates - using 'any' to bypass type checking issues with FastMCP const template = { uriTemplate: 'task://{id}', name: "Task", mimeType: "application/json", load: async (args) => { return { json: { id: args.id, status: "example", description: "Example task resource" } }; } }; server.addResourceTemplate(template); console.error("[INFO] [resources] Resources and templates set up successfully"); } catch (error) { console.error(`[ERROR] [resources] Error setting up resources: ${error instanceof Error ? error.message : String(error)}`); throw error; } }