Skip to main content
Glama

Weblate MCP Server

by mmntm
auth.ts809 B
export type AuthToken = string | undefined; export interface Auth { /** * Which part of the request do we use to send the auth? * * @default 'header' */ in?: 'header' | 'query' | 'cookie'; /** * Header or query parameter name. * * @default 'Authorization' */ name?: string; scheme?: 'basic' | 'bearer'; type: 'apiKey' | 'http'; } export const getAuthToken = async ( auth: Auth, callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken, ): Promise<string | undefined> => { const token = typeof callback === 'function' ? await callback(auth) : callback; if (!token) { return; } if (auth.scheme === 'bearer') { return `Bearer ${token}`; } if (auth.scheme === 'basic') { return `Basic ${btoa(token)}`; } return token; };

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/mmntm/weblate-mcp'

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