Twitter Integration
STDIOPowerful Twitter integration for AI agents providing comprehensive Twitter functionality through MCP standard.
Powerful Twitter integration for AI agents providing comprehensive Twitter functionality through MCP standard.
A powerful Twitter integration for AI agents that leverages the Model Context Protocol (MCP) standard, providing a comprehensive set of Twitter functionality through a clean and consistent interface.
This server provides access to Twitter's features through MCP tools, allowing seamless integration with AI assistants and other MCP-compatible clients. It's built on top of the agent-twitter-client
library and provides robust error handling, rate limiting, and consistent response formatting.
get_tweets
- Fetch recent tweets from a userget_profile
- Get a user's profile informationsearch_tweets
- Search for tweets by hashtag or keywordlike_tweet
- Like or unlike a tweetretweet
- Retweet or undo retweetpost_tweet
- Post a new tweet with optional mediacreate_thread
- Create a Twitter threadget_timeline
- Get tweets from different timeline typesget_list_tweets
- Get tweets from a Twitter listget_trends
- Get current trending topicsget_user_relationships
- Get followers or following listfollow_user
- Follow or unfollow a usernpm install
npm run build
# Required: Twitter Account Credentials (for user authentication) TWITTER_USERNAME=your_username TWITTER_PASSWORD=your_password TWITTER_EMAIL=your_email # Twitter API Authentication (Optional) TWITTER_API_KEY=your_api_key TWITTER_API_SECRET_KEY=your_api_secret_key TWITTER_ACCESS_TOKEN=your_access_token TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret
On MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Configuration:
{ "mcpServers": { "twitter-mcp-server": { "command": "/path/to/twitter-mcp-server/build/index.js" } } }
For development with auto-rebuild:
npm run watch
Since MCP servers communicate over stdio, you can use the MCP Inspector for debugging:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
The server implements comprehensive error handling:
All tools return responses in a consistent format:
{ content: [{ type: "text", text: string // JSON stringified response or error message }] }
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details