Skip to main content
Glama

DeepSeek MCP Server

by Sheshiyer
cache.ts1.42 kB
import { CacheEntry } from './types'; export class Cache { private store: Map<string, CacheEntry>; constructor() { this.store = new Map(); } get(key: string): string | null { const entry = this.store.get(key); if (!entry) return null; const now = Date.now(); if (now - entry.timestamp > entry.ttl * 1000) { this.store.delete(key); return null; } return entry.result; } set(key: string, result: string, ttl: number, metadata?: Record<string, any>): void { this.store.set(key, { result, timestamp: Date.now(), ttl, metadata }); } getMetadata(key: string): Record<string, any> | null { const entry = this.store.get(key); return entry?.metadata || null; } has(key: string): boolean { return this.get(key) !== null; } delete(key: string): void { this.store.delete(key); } clear(): void { this.store.clear(); } // Helper method to generate cache keys for tool chains static generateChainKey(steps: { toolName: string; params: any }[]): string { return steps.map(step => `${step.toolName}:${JSON.stringify(step.params)}` ).join('|'); } // Cleanup expired entries cleanup(): void { const now = Date.now(); for (const [key, entry] of this.store.entries()) { if (now - entry.timestamp > entry.ttl * 1000) { this.store.delete(key); } } } }

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/Sheshiyer/deepseek-mcp-with-MoE'

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