Skip to main content
Glama

Shortcut MCP Server

Official
by useshortcut
cache.ts752 B
/** * Simple key/value cache. * * It only supports setting **all** values at once. You cannot add to the cache over time. * It tracks staleness and is hard coded to expire after 5 minutes. */ export class Cache<TId, TValue> { private cache: Map<TId, TValue>; private age: number; constructor() { this.cache = new Map(); this.age = 0; } get(key: TId) { return this.cache.get(key) ?? null; } values() { return Array.from(this.cache.values()); } setMany(values: [TId, TValue][]) { this.cache.clear(); for (const [key, value] of values) { this.cache.set(key, value); } this.age = Date.now(); } clear() { this.cache.clear(); this.age = 0; } get isStale() { return Date.now() - this.age > 1000 * 60 * 5; } }

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/useshortcut/mcp-server-shortcut'

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