MCP Hub
Back to servers

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.

glama
Updated
Mar 17, 2026

🐦 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.

Python 3.10+ MIT License MCP Compatible Tools

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 NameDescriptionAuthentication Required
twitter_searchSearch for tweets by keyword or hashtagNo
twitter_postPost a new tweetYes
twitter_read_feedRead the user's feedYes
twitter_read_profileRead a user's profile informationNo
twitter_read_tweetRead a specific tweetNo
twitter_like_tweetLike a specific tweetYes
twitter_retweetRetweet a specific tweetYes
twitter_follow_userFollow a userYes
twitter_unfollow_userUnfollow a userYes
twitter_get_trendingGet trending topicsNo
twitter_get_user_tweetsGet tweets from a specific userNo
twitter_reply_to_tweetReply to a specific tweetYes

Quick Start

  1. Clone the repository:
git clone https://github.com/yourusername/twitter-mcp.git
cd twitter-mcp
  1. Install dependencies:
pip install -r requirements.txt
  1. 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:

  1. Run the login command:
playwright open https://twitter.com
  1. Login with your Twitter/X credentials in the opened browser
  2. 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)

Reviews

No reviews yet

Sign in to write a review