Skip to main content
Glama
Miles0sage
by Miles0sage

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

  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)
-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Miles0sage/twitter-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server