Skip to main content
Glama
oauth.ts997 B
import axios from 'axios'; import { config } from '../../config/env'; export interface TokenResponse { access_token: string; refresh_token?: string; expires_in?: number; scope?: string; token_type?: string; } export const GitHubOAuth = { buildAuthorizationUrl(userId: string): string { const params = new URLSearchParams({ client_id: config.github.clientId, redirect_uri: config.github.redirectUri, state: userId, scope: 'repo' }); return `${config.github.authorizeUrl}?${params.toString()}`; }, async exchangeCodeForToken(code: string): Promise<TokenResponse> { const response = await axios.post<TokenResponse>( config.github.tokenUrl, { client_id: config.github.clientId, client_secret: config.github.clientSecret, code, redirect_uri: config.github.redirectUri }, { headers: { Accept: 'application/json' } } ); return response.data; } };

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/CrBatista/mcp-cli-github-integration'

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