Twitter/X MCP Server
Enables AI agents to interact with Twitter/X through Playwright browser automation without requiring an official API key. It provides tools for posting content, searching tweets, reading feeds, and managing social interactions like follows and likes.
README
🐦 Twitter/X MCP Server
Free Twitter/X integration for AI agents — no API key needed. Read tweets, post, search, trending — all via Playwright browser automation.
What
Twitter/X MCP Server provides a complete integration layer between AI agents and Twitter/X using Playwright browser automation. Unlike traditional Twitter API approaches that require API keys and face rate limits, this server leverages browser automation to access Twitter functionality without API restrictions. It offers tools for reading tweets, posting content, searching, trending topics, and more — all accessible through the Model Context Protocol (MCP).
Tools
| Tool Name | Description | Authentication Required |
|---|---|---|
| twitter_search | Search for tweets by keyword or hashtag | No |
| twitter_post | Post a new tweet | Yes |
| twitter_read_feed | Read the user's feed | Yes |
| twitter_read_profile | Read a user's profile information | No |
| twitter_read_tweet | Read a specific tweet | No |
| twitter_like_tweet | Like a specific tweet | Yes |
| twitter_retweet | Retweet a specific tweet | Yes |
| twitter_follow_user | Follow a user | Yes |
| twitter_unfollow_user | Unfollow a user | Yes |
| twitter_get_trending | Get trending topics | No |
| twitter_get_user_tweets | Get tweets from a specific user | No |
| twitter_reply_to_tweet | Reply to a specific tweet | Yes |
Quick Start
- Clone the repository:
git clone https://github.com/yourusername/twitter-mcp.git
cd twitter-mcp
- Install dependencies:
pip install -r requirements.txt
- Add to your
~/.mcp.json:
{
"servers": [
{
"name": "twitter-mcp",
"cmd": ["python", "/path/to/your/twitter-mcp/server.py"],
"env": {}
}
]
}
Auth Setup
For write operations (posting, liking, following, etc.), you need to authenticate with Twitter/X using Playwright:
- Run the login command:
playwright open https://twitter.com
- Login with your Twitter/X credentials in the opened browser
- The authentication cookies will be saved for use by the tools
Examples
Search for tweets:
# Search for tweets containing a keyword
tweets = twitter_search(keyword="AI", max_results=10)
Post a tweet:
# Post a new tweet (requires authentication)
result = twitter_post(content="Just tried the new Twitter/X MCP server! Amazing!")
Read your feed:
# Read the authenticated user's feed (requires authentication)
feed_tweets = twitter_read_feed(max_results=20)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.