Skip to main content
Glama

Dynamic Excel MCP Server

by nam090320251
local-storage.tsโ€ข1.35 kB
import fs from 'fs/promises'; import path from 'path'; import { logger } from '../utils/logger.js'; export class LocalStorage { private storagePath: string; constructor() { this.storagePath = process.env.DEV_STORAGE_PATH || './temp-files'; this.ensureDirectory(); } private async ensureDirectory() { try { await fs.mkdir(this.storagePath, { recursive: true }); } catch (error) { logger.error('Failed to create storage directory:', error); } } async upload(buffer: Buffer, fileName: string): Promise<string> { const filePath = path.join(this.storagePath, `${Date.now()}_${fileName}`); try { await fs.writeFile(filePath, buffer); logger.info(`File saved locally: ${filePath}`); return filePath; } catch (error) { logger.error('Local file save failed:', error); throw new Error(`Failed to save file locally: ${error}`); } } async getFileUrl(filePath: string): Promise<string> { // In development, return file path // In production with a web server, return HTTP URL return `file://${path.resolve(filePath)}`; } async delete(filePath: string): Promise<void> { try { await fs.unlink(filePath); logger.info(`File deleted: ${filePath}`); } catch (error) { logger.error('File deletion failed:', error); } } }

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/nam090320251/dynamic-excel-mcp-server'

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