Skip to main content
Glama

Authenticated Next.js MCP Server

auth.ts797 B
// In-memory token storage (use database in production) const tokens = new Map< string, { clientId: string scopes: string[] expiresAt: number } >() // Token validation function export async function validateToken(token: string): Promise<{ valid: boolean clientId?: string scopes?: string[] }> { const tokenData = tokens.get(token) if (!tokenData || tokenData.expiresAt < Date.now()) { if (tokenData) tokens.delete(token) // Clean up expired token return { valid: false } } return { valid: true, clientId: tokenData.clientId, scopes: tokenData.scopes, } } // Store token export function storeToken( token: string, clientId: string, scopes: string[], expiresAt: number ): void { tokens.set(token, { clientId, scopes, expiresAt }) }

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/vedaterenoglu/ve-nextjs-mcp-server'

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