Skip to main content
Glama
oauth-store.ts795 B
import { redis } from './redis.js'; const NS = (process.env.REDIS_NAMESPACE || 'mcp:oauth') + ':codes'; const key = (code: string) => `${NS}:${code}`; export type PendingCode = { client_id: string; redirect_uri: string; code_challenge: string; login: string; apiKey: string; shopId: string; scope: string; exp: number; // epoch seconds }; export async function saveCode(code: string, data: PendingCode, ttlSec = 300) { await redis.set(key(code), JSON.stringify(data), 'EX', ttlSec); } export async function loadCode(code: string): Promise<PendingCode | undefined> { const raw = await redis.get(key(code)); return raw ? JSON.parse(raw) as PendingCode : undefined; } export async function deleteCode(code: string) { await redis.del(key(code)); }

Latest Blog Posts

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/paracetamol951/caisse-enregistreuse-mcp-server'

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