levisnkyyyy-x-twitter-mcp
v0.1.18
Published
Twitter search tool for MCP using Twitter API
Readme
X Twitter MCP Server (Node.js)
A Model Context Protocol (MCP) server that provides tools for interacting with Twitter/X API.
Installation
npx x-twitter-mcpOr install globally:
npm install -g x-twitter-mcpSetup
- Create a Twitter/X Developer account and app at https://developer.twitter.com
- Copy
.env.exampleto.envand fill in your credentials:
cp .env.example .env- Edit
.envwith your Twitter API credentials:TWITTER_API_KEY: Your API KeyTWITTER_API_SECRET: Your API SecretTWITTER_ACCESS_TOKEN: Your Access TokenTWITTER_ACCESS_TOKEN_SECRET: Your Access Token SecretTWITTER_BEARER_TOKEN: Your Bearer Token
Usage
Run the server:
npx x-twitter-mcpThe server provides the following tools:
User Management
get_user_profile- Get detailed profile information for a userget_user_by_screen_name- Fetch a user by their usernameget_user_by_id- Fetch a user by their IDget_user_followers- Get a list of followers for a userget_user_following- Get users that a specific user is following
Tweet Management
post_tweet- Post a new tweet with optional media, reply, and hashtagsdelete_tweet- Delete a tweet by IDget_tweet_details- Get detailed information about a specific tweetcreate_poll_tweet- Create a tweet with a pollfavorite_tweet- Like a tweetunfavorite_tweet- Unlike a tweetbookmark_tweet- Add a tweet to bookmarksdelete_bookmark- Remove a tweet from bookmarks
Timeline & Search
get_timeline- Get tweets from your home timelinesearch_twitter- Search Twitter with a queryget_trends- Get trending topicsget_user_mentions- Get tweets mentioning a specific user
Rate Limiting
The server includes built-in rate limiting to comply with Twitter API limits:
- Tweet actions: 300 per 15 minutes
- DM actions: 1000 per 15 minutes
- Follow actions: 400 per 24 hours
- Like actions: 1000 per 24 hours
License
MIT
