Skip to main content
Glama

OSP Marketing Tools MCP Server

by x51xxx
contentReader.ts975 B
import { readFile } from 'fs/promises'; import { join, dirname } from 'path'; import { fileURLToPath } from 'url'; export class ContentReader { private readonly resourcesDir: string; private cache: Map<string, string> = new Map(); constructor(resourcesDir?: string) { const __dirname = dirname(fileURLToPath(import.meta.url)); this.resourcesDir = resourcesDir || join(__dirname, '..', '..', 'prompts'); } async readMarkdownFile(filename: string): Promise<string> { // Check cache if (this.cache.has(filename)) { return this.cache.get(filename)!; } try { const filePath = join(this.resourcesDir, filename); const content = await readFile(filePath, 'utf-8'); // Store in cache this.cache.set(filename, content); return content; } catch (error) { console.error(`Error reading file ${filename}:`, error); throw new Error(`Required file '${filename}' not found`); } } }

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/x51xxx/osp-marketing-tools-mcp'

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