Skip to main content
Glama

LumbreTravel MCP Server

by lumile
auth.service.ts1.37 kB
import fetch from 'node-fetch' import { API_CONFIG } from '../config/index.js' import { type AuthResponse } from '../types/index.js' import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js' export class AuthService { async getAccessToken (): Promise<string> { try { const auth = Buffer.from( `${API_CONFIG.auth.clientId}:${API_CONFIG.auth.clientSecret}` ).toString('base64') const formData = new URLSearchParams({ grant_type: 'password', username: API_CONFIG.auth.username, password: API_CONFIG.auth.password, scope: 'public' }) const response = await fetch(`${API_CONFIG.baseUrl}/oauth/token`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', Authorization: `Basic ${auth}` }, body: formData }) if (!response.ok) { throw new McpError( ErrorCode.InternalError, `LumbreTravel Auth error: ${response.statusText}` ) } const data = await response.json() as AuthResponse return data.access_token } catch (error) { if (error instanceof McpError) { throw error } throw new McpError( ErrorCode.InternalError, `LumbreTravel Auth error: ${(error as Error).message}` ) } } }

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/lumile/lumbretravel-mcp'

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