Skip to main content
Glama

Social Media MCP Server

by tayler-id
post-to-twitter.js1.51 kB
// Script to post MCP server content to Twitter import fs from 'fs/promises'; import twitterClientModule from './build/src/platforms/twitter/client.js'; // The module exports a default instance const twitterClient = twitterClientModule.default; async function postToTwitter() { try { // Read the content file console.log('Reading MCP post content...'); const contentRaw = await fs.readFile('./mcp-post-content.json', 'utf-8'); const content = JSON.parse(contentRaw); // Post to Twitter (thread) console.log('Posting to Twitter...'); const twitterThread = content.twitter.thread; let previousTweetId = null; for (const tweet of twitterThread) { const tweetContent = { text: tweet, platform: 'twitter', replyToId: previousTweetId }; const result = await twitterClient.postTweet(tweetContent); console.log('Tweet posted', { id: result.postId, success: result.success }); if (result.success) { previousTweetId = result.postId; } } console.log('Twitter thread posted successfully!'); return { success: true, threadLength: twitterThread.length }; } catch (error) { console.error('Error posting to Twitter', error); throw error; } } // Run the script postToTwitter().then(results => { console.log('Results:', JSON.stringify(results, null, 2)); }).catch(error => { console.error('Unhandled error:', error); process.exit(1); });

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/tayler-id/social-media-mcp'

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