Skip to main content
Glama

Memory Bank MCP Server

by nicavcrm
storage.ts2.05 kB
// src/storage.ts import { mkdirSync, readFileSync, writeFileSync } from "fs"; import { join } from "path"; const MEMORY_BANK_DIR = ".memory_bank"; export class MemoryBankStorage { constructor() { mkdirSync(MEMORY_BANK_DIR, { recursive: true }); } getFilePath(filename: string): string { return join(MEMORY_BANK_DIR, filename); } readFile(filename: string): string { try { return readFileSync(this.getFilePath(filename), "utf-8"); } catch { return ""; } } writeFile(filename: string, content: string): void { writeFileSync(this.getFilePath(filename), content); } // Mode-specific file handlers getTasks() { return this.readFile("tasks.md"); } setTasks(content: string) { this.writeFile("tasks.md", content); } getActiveContext() { return this.readFile("activeContext.md"); } setActiveContext(content: string) { this.writeFile("activeContext.md", content); } getProgress() { return this.readFile("progress.md"); } setProgress(content: string) { this.writeFile("progress.md", content); } getCreativeContent(filename: string) { return this.readFile(`creative-${filename}.md`); } setCreativeContent(filename: string, content: string) { this.writeFile(`creative-${filename}.md`, content); } getImplementationPlan() { return this.readFile("implementation-plan.md"); } setImplementationPlan(content: string) { this.writeFile("implementation-plan.md", content); } getReflection() { return this.readFile("reflection.md"); } setReflection(content: string) { this.writeFile("reflection.md", content); } // Ensure docs/archive directory exists and write archive writeArchive(content: string) { try { mkdirSync(this.getFilePath("docs/archive"), { recursive: true }); this.writeFile("docs/archive/project-archive.md", content); } catch (error) { // Fallback to root level if directory creation fails this.writeFile("project-archive.md", content); } } }

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/nicavcrm/memory-bank-mcp'

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