X/Twitter MCP Server
@Barresider
About X/Twitter MCP Server
An MCP Server to interact with X/Twitter besides the official API.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"x-mcp": {
"command": "npx",
"args": [
"-y",
"@barresider/x-mcp"
],
"env": {
"TWITTER_USERNAME": "your_twitter_username",
"TWITTER_PASSWORD": "your_twitter_password"
}
}
}
}Tools
22Login to Twitter/X
Post a tweet to Twitter/X
Post a thread of tweets
Scrape posts from current page
Scrape a user profile
Scrape comments from a post
Search for tweets
Search for viral posts
Scrape posts from timeline
Get trending topics
Like a specific post
Unlike a specific post
Bookmark a specific post
Remove bookmark from a specific post
Retweet/repost a specific post
Remove retweet/repost of a specific post
Quote tweet a post with custom text
Reply to a post with a comment
Like a comment by its direct URL
Unlike a comment by its direct URL
Reply to a comment with a comment
Replace/edit a comment by its direct URL (Note: Twitter/X may not support comment editing)
Overview
What is X/Twitter MCP Server?
X/Twitter MCP Server is a Model Context Protocol (MCP) server that provides unofficial X/Twitter API access through browser automation using Playwright. It enables AI agents and applications to programmatically interact with X/Twitter for content creation, scraping, and social media automation.
How to use X/Twitter MCP Server?
Add the server configuration to your Claude Desktop config file with your X/Twitter credentials as environment variables (TWITTER_USERNAME, TWITTER_PASSWORD). Optionally, provide a PROXY_URL. Restart Claude Desktop to begin using the 25+ MCP tools. For standalone use, run npm run cli login to authenticate.
Key features of X/Twitter MCP Server
- Post tweets, threads, and interact with posts
- Scrape timelines, profiles, and search tweets
- Like, retweet, bookmark, and reply to posts
- Upload images, videos, and GIFs to tweets
- Supports stdio and HTTP/SSE transport
- 25+ MCP tools for X/Twitter automation
Use cases of X/Twitter MCP Server
- Automate posting tweets and threads from AI agents
- Scrape trending topics and hashtags for analysis
- Search for viral content with minimum engagement filters
- Monitor and interact with comments on posts
- Extract comprehensive user profiles and recent posts
FAQ from X/Twitter MCP Server
What are the prerequisites for X/Twitter MCP Server?
Node.js 18+ and valid X/Twitter account credentials are required. Docker is optional for containerized deployment.
How does authentication work?
Credentials are provided via TWITTER_USERNAME and TWITTER_PASSWORD environment variables. Run npm run cli login to store a session in the directory specified by AUTH_DIR (default playwright/.auth).
Does the server support proxies?
Yes, it supports HTTP/HTTPS proxies configured via the PROXY_URL environment variable, with optional authentication, useful for rotating IPs or accessing restricted networks.
What are common troubleshooting steps?
Verify credentials, re-authenticate, check for UI updates, reduce request frequency, and ensure proper environment variables for Docker.
Is this tool official or affiliated with X/Twitter?
No, this is an unofficial tool using browser automation and is not affiliated with X/Twitter. Use responsibly and respect X/Twitter's terms of service.
Frequently asked questions
What are the prerequisites for X/Twitter MCP Server?
Node.js 18+ and valid X/Twitter account credentials are required. Docker is optional for containerized deployment.
How does authentication work?
Credentials are provided via TWITTER_USERNAME and TWITTER_PASSWORD environment variables. Run `npm run cli login` to store a session in the directory specified by AUTH_DIR (default playwright/.auth).
Does the server support proxies?
Yes, it supports HTTP/HTTPS proxies configured via the PROXY_URL environment variable, with optional authentication, useful for rotating IPs or accessing restricted networks.
What are common troubleshooting steps?
Verify credentials, re-authenticate, check for UI updates, reduce request frequency, and ensure proper environment variables for Docker.
Is this tool official or affiliated with X/Twitter?
No, this is an unofficial tool using browser automation and is not affiliated with X/Twitter. Use responsibly and respect X/Twitter's terms of service.
Basic information
More Other MCP servers
Inbox Zero AI MCP
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Blender
ahujasidOpen-source MCP to use Blender with any LLM
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
FastMCP v2 π
jlowinπ The fast, Pythonic way to build MCP servers and clients.
Inbox Zero AI
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Comments