Skip to main content
Glama

PHPocalypse-MCP

by plapinski
cache.ts810 B
import { CliOutput } from "./command.js"; interface NoOutput { error: string; } export type Output = CliOutput | NoOutput; interface ResultsStorage { set(tool: ToolName, output: CliOutput): Promise<void>; get(tool: ToolName): Promise<Output>; } type ToolName = string; interface InMemoryCache { [key: ToolName]: CliOutput } export default class InMemoryResultsStorage implements ResultsStorage { private inMemoryCache: InMemoryCache; constructor() { this.inMemoryCache = {}; } public async set(tool: ToolName, output: CliOutput): Promise<void> { this.inMemoryCache[tool] = output; } public async get(tool: ToolName): Promise<Output> { return this.inMemoryCache[tool] ?? {error: `No cached results found for ${tool}`} as NoOutput; } }

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/plapinski/PHPocalypse-MCP'

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