A Model Context Protocol (MCP) server that enables Claude Desktop to interact with Twitter - post tweets, analyze content, and create well-structured tweets based on prompts.
This MCP server connects Claude Desktop to Twitter via the Twitter API, providing several capabilities:
Clone or download this repository
git clone https://github.com/yourusername/twitter-mcp-server
cd twitter-mcp-server
Install dependencies
npm install
Create a .env
file in the project root with your Twitter API credentials
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET=your_api_secret
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_SECRET=your_access_secret
{
"mcpServers": {
"Twitter Assistant": {
"command": "npm",
"args": [
"--prefix",
"/full/path/to/twitter-mcp-server.js",
"start"
]
}
}
}
/full/path/to/twitter-mcp-server.js
with the actual path to your server filetwitter://user/profile
): Get information about your Twitter profiletwitter://user/tweets
): Retrieve your most recent tweetstwitter://trends
): Fetch current trending topicsPost Tweet: Publish a new tweet with content validation
content
(string, max 280 chars), dryRun
(boolean, optional)Delete Tweet: Remove a tweet by ID
tweetId
(string)Analyze Tweet: Check engagement potential of tweet content
content
(string, max 280 chars)Concise Tweet: Create short, focused tweets
topic
(string), include_hashtags
(boolean), tone
(enum: professional, casual, humorous)Twitter Thread: Generate multi-tweet threads
topic
(string), points
(number, 2-5), include_call_to_action
(boolean)Engagement Tweet: Create tweets designed for high engagement
topic
(string), engagement_type
(enum: question, poll, hot-take, useful-tip)Once configured, you can ask Claude Desktop:
twitter-mcp-server/
├── twitter-mcp-server.js # Main server file
├── .env # Environment variables (API keys)
├── package.json # Project dependencies
└── README.md # This file
npm install
)This server runs with the permissions of your user account. It will ask for confirmation before posting or deleting tweets, but always review actions before approving them.
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
{
"mcpServers": {
"Twitter Assistant": {
"env": {},
"args": [
"--prefix",
"/full/path/to/twitter-mcp-server.js",
"start"
],
"command": "npm"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.