Social Media MCP Server

// 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); });