MCP/Twitter MCP
Twitter MCP logo

Twitter MCP

Verified Golden (1000+ GitHub stars)

Integrates with X (Twitter) API v2 to post tweets, search discussions, reply to messages, and analyze social engagement trends.

seo•Social Media Automation & Growth
GitHub1.8k
License:MIT
COMMUNITY

About this Server

Twitter MCP connects AI assistants directly with X (Twitter) using the X API v2. It enables LLMs to publish tweets and multi-post threads, search public discussions and hashtags, analyze tweet performance metrics, track viral trends, map follower networks, and execute deep research on public social conversations with enhanced research capabilities.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

API Credential Isolation: Store API_KEY, API_SECRET_KEY, ACCESS_TOKEN, and ACCESS_TOKEN_SECRET securely in environment variables; never commit credentials to public version control.
Rate Limit Protection: Built-in request pacing respects X API v2 rate limits and backoff headers to prevent account restrictions or automated suspension.
User Consent Verification: Interactive confirmations should be required before publishing public tweets or automated replies to live audience feeds.
Data Privacy Safeguards: Retrieved tweet payloads, user IDs, and direct messages are processed in-memory without persistent external logging.

When to Use (and When Not To)

Best For
  • •Social media managers automating content calendars, scheduled threads, and multi-post campaigns on X
  • •Developers building automated notification bots, support reply assistants, and social listening workflows
  • •Researchers and analysts tracking public sentiment, brand mentions, and viral developer discussions
  • •Content creators monitoring engagement metrics, quote retweets, and follower network graphs
Not For / Limitations
  • •Mass spamming, unsolicited automated mentions, or aggressive mass-following behaviors violating X Developer Policies
  • •Large-scale continuous firehose streaming of millions of real-time posts (use X Enterprise Streaming API)
  • •Private direct message bulk messaging or non-public community group operations

Install & Setup

terminal command
$claude mcp add -e API_KEY=your_api_key_here -e API_SECRET_KEY=your_api_secret_key_here -e ACCESS_TOKEN=your_access_token_here -e ACCESS_TOKEN_SECRET=your_access_token_secret_here twitter-mcp -- npx -y @enescinar/twitter-mcp

Exposed Tools & Endpoints

8 tools

Functions your AI agent can invoke via this Model Context Protocol server

post_tweet

Publish a new status update or tweet to X (Twitter) with text, media attachments, and optional reply parameters.

reply_tweet

Reply directly to an existing tweet thread on X with targeted commentary.

search_tweets

Search recent tweets and historical discussions across X using query keywords, hashtags, and language filters.

get_user_tweets

Retrieve recent posts, replies, and pinned tweets published by a specific user handle.

analyze_thread_performance

Analyze engagement metrics including impressions, retweets, likes, and reply counts for a tweet or thread.

track_viral_content

Monitor trending hashtags, viral topics, and sentiment velocity across social conversations.

map_social_network

Inspect follower connections, mentions, and mutual relationship graphs for user accounts.

research_tweets_extended

Deep academic and social trend research querying public conversations without requiring Enterprise API tiers.