Skip to main content
Glama

Twitter MCP Server

oauth2.helper.js984 B
import * as crypto from 'crypto'; export class OAuth2Helper { static getCodeVerifier() { return this.generateRandomString(128); } static getCodeChallengeFromVerifier(verifier) { return this.escapeBase64Url(crypto .createHash('sha256') .update(verifier) .digest('base64')); } static getAuthHeader(clientId, clientSecret) { const key = encodeURIComponent(clientId) + ':' + encodeURIComponent(clientSecret); return Buffer.from(key).toString('base64'); } static generateRandomString(length) { let text = ''; const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~'; for (let i = 0; i < length; i++) { text += possible[Math.floor(Math.random() * possible.length)]; } return text; } static escapeBase64Url(string) { return string.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); } }

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/crazyrabbitLTC/mcp-twitter-server'

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