Skip to main content
Glama

Discourse MCP

Official
by discourse
cache.ts722 B
type CacheEntry<T> = { value: T; expiresAt: number }; export class TTLCache<K, V> { private map = new Map<K, CacheEntry<V>>(); constructor(private maxEntries = 100) {} get(key: K): V | undefined { const entry = this.map.get(key); if (!entry) return undefined; if (Date.now() > entry.expiresAt) { this.map.delete(key); return undefined; } return entry.value; } set(key: K, value: V, ttlMs: number) { if (this.map.size >= this.maxEntries) { // simple LRU-ish: delete first key const firstKey = this.map.keys().next().value; if (firstKey !== undefined) this.map.delete(firstKey); } this.map.set(key, { value, expiresAt: Date.now() + ttlMs }); } }

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/discourse/discourse-mcp'

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