Skip to main content
Glama

Twitter MCP Server

twitterClient.ts869 B
import { TwitterApi } from 'twitter-api-v2'; import { TwitterClient } from './client/twitter.js'; export { TwitterClient } from './client/twitter.js'; export function createTwitterClient(): TwitterClient | null { const appKey = process.env.X_API_KEY; const appSecret = process.env.X_API_SECRET; const accessToken = process.env.X_ACCESS_TOKEN; const accessSecret = process.env.X_ACCESS_TOKEN_SECRET; // Check if all required credentials are provided if (!appKey || !appSecret || !accessToken || !accessSecret) { return null; } try { const client = new TwitterClient({ appKey, appSecret, accessToken, accessSecret, }); return client; } catch (error) { console.error('Failed to initialize Twitter client:', error); return null; } }

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