The Social Media MCP Server is a Model Context Protocol server that connects to multiple social media platforms. It allows you to create and publish content across Twitter/X, Mastodon, and LinkedIn through simple natural language instructions, with built-in research capabilities and AI-powered content generation.
Before installing the server, ensure you have:
git clone https://github.com/yourusername/social-media-mcp.git
cd social-media-mcp
npm install
.env
file with your API keys:# Twitter API Credentials
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET=your_api_secret
TWITTER_BEARER_TOKEN=your_bearer_token
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_SECRET=your_access_secret
TWITTER_OAUTH_CLIENT=your_oauth_client
TWITTER_CLIENT_SECRET=your_client_secret
# Mastodon API Credentials
MASTODON_CLIENT_SECRET=your_client_secret
MASTODON_CLIENT_KEY=your_client_key
MASTODON_ACCESS_TOKEN=your_access_token
# LinkedIn API Credentials
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
LINKEDIN_ACCESS_TOKEN=your_access_token
# AI API Keys
ANTHROPIC_API_KEY=your_anthropic_key
OPENAI_API_KEY=your_openai_key
BRAVE_API_KEY=your_brave_key
# Application Settings
LOG_LEVEL=info
CACHE_ENABLED=true
RATE_LIMIT_ENABLED=true
npm run build
npm start
To use this MCP server with Claude or another MCP-compatible assistant, add it to your MCP settings:
{
"mcpServers": {
"social-media-mcp": {
"command": "node",
"args": ["path/to/social-media-mcp/build/index.js"],
"env": {
"TWITTER_API_KEY": "your_api_key",
"TWITTER_API_SECRET": "your_api_secret",
"TWITTER_BEARER_TOKEN": "your_bearer_token",
"TWITTER_ACCESS_TOKEN": "your_access_token",
"TWITTER_ACCESS_SECRET": "your_access_secret",
"TWITTER_OAUTH_CLIENT": "your_oauth_client",
"TWITTER_CLIENT_SECRET": "your_client_secret",
"MASTODON_CLIENT_SECRET": "your_client_secret",
"MASTODON_CLIENT_KEY": "your_client_key",
"MASTODON_ACCESS_TOKEN": "your_access_token",
"LINKEDIN_CLIENT_ID": "your_client_id",
"LINKEDIN_CLIENT_SECRET": "your_client_secret",
"LINKEDIN_ACCESS_TOKEN": "your_access_token",
"ANTHROPIC_API_KEY": "your_anthropic_key",
"OPENAI_API_KEY": "your_openai_key",
"BRAVE_API_KEY": "your_brave_key"
},
"disabled": false,
"autoApprove": []
}
}
}
The create_post
tool lets you create and post content to social media platforms using natural language instructions:
{
"instruction": "Post about the latest AI developments in healthcare",
"platforms": ["twitter", "mastodon", "linkedin"],
"postImmediately": false
}
This tool will:
Use the research_topic
tool to gather information before creating posts:
{
"topic": "artificial intelligence ethics",
"includeHashtags": true,
"includeFacts": true,
"includeTrends": true,
"includeNews": true
}
This will return relevant information about your topic, including popular hashtags, key facts, trending discussions, and recent news.
The get_trending_topics
tool helps you stay current with what's popular on social media:
{
"platform": "twitter",
"category": "technology",
"count": 5
}
This returns the top trending topics from your specified platform and category, which you can use to inform your content strategy.
The Social Media MCP Server offers:
When creating posts, the server intelligently formats content for each platform, ensuring optimal presentation whether you're posting to Twitter's character-limited environment or LinkedIn's professional audience.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "social-media-mcp" '{"command":"node","args":["path/to/social-media-mcp/build/index.js"],"env":{"TWITTER_API_KEY":"your_api_key","TWITTER_API_SECRET":"your_api_secret","TWITTER_BEARER_TOKEN":"your_bearer_token","TWITTER_ACCESS_TOKEN":"your_access_token","TWITTER_ACCESS_SECRET":"your_access_secret","TWITTER_OAUTH_CLIENT":"your_oauth_client","TWITTER_CLIENT_SECRET":"your_client_secret","MASTODON_CLIENT_SECRET":"your_client_secret","MASTODON_CLIENT_KEY":"your_client_key","MASTODON_ACCESS_TOKEN":"your_access_token","LINKEDIN_CLIENT_ID":"your_client_id","LINKEDIN_CLIENT_SECRET":"your_client_secret","LINKEDIN_ACCESS_TOKEN":"your_access_token","ANTHROPIC_API_KEY":"your_anthropic_key","OPENAI_API_KEY":"your_openai_key","BRAVE_API_KEY":"your_brave_key"},"disabled":false,"autoApprove":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"social-media-mcp": {
"command": "node",
"args": [
"path/to/social-media-mcp/build/index.js"
],
"env": {
"TWITTER_API_KEY": "your_api_key",
"TWITTER_API_SECRET": "your_api_secret",
"TWITTER_BEARER_TOKEN": "your_bearer_token",
"TWITTER_ACCESS_TOKEN": "your_access_token",
"TWITTER_ACCESS_SECRET": "your_access_secret",
"TWITTER_OAUTH_CLIENT": "your_oauth_client",
"TWITTER_CLIENT_SECRET": "your_client_secret",
"MASTODON_CLIENT_SECRET": "your_client_secret",
"MASTODON_CLIENT_KEY": "your_client_key",
"MASTODON_ACCESS_TOKEN": "your_access_token",
"LINKEDIN_CLIENT_ID": "your_client_id",
"LINKEDIN_CLIENT_SECRET": "your_client_secret",
"LINKEDIN_ACCESS_TOKEN": "your_access_token",
"ANTHROPIC_API_KEY": "your_anthropic_key",
"OPENAI_API_KEY": "your_openai_key",
"BRAVE_API_KEY": "your_brave_key"
},
"disabled": false,
"autoApprove": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"social-media-mcp": {
"command": "node",
"args": [
"path/to/social-media-mcp/build/index.js"
],
"env": {
"TWITTER_API_KEY": "your_api_key",
"TWITTER_API_SECRET": "your_api_secret",
"TWITTER_BEARER_TOKEN": "your_bearer_token",
"TWITTER_ACCESS_TOKEN": "your_access_token",
"TWITTER_ACCESS_SECRET": "your_access_secret",
"TWITTER_OAUTH_CLIENT": "your_oauth_client",
"TWITTER_CLIENT_SECRET": "your_client_secret",
"MASTODON_CLIENT_SECRET": "your_client_secret",
"MASTODON_CLIENT_KEY": "your_client_key",
"MASTODON_ACCESS_TOKEN": "your_access_token",
"LINKEDIN_CLIENT_ID": "your_client_id",
"LINKEDIN_CLIENT_SECRET": "your_client_secret",
"LINKEDIN_ACCESS_TOKEN": "your_access_token",
"ANTHROPIC_API_KEY": "your_anthropic_key",
"OPENAI_API_KEY": "your_openai_key",
"BRAVE_API_KEY": "your_brave_key"
},
"disabled": false,
"autoApprove": []
}
}
}
3. Restart Claude Desktop for the changes to take effect