swcrazyfan
MCP Serverswcrazyfanpublic

mcp x

无需官方 API 密钥即可与 X(原 Twitter)平台交互的强大工具。

Repository Info

0
Stars
1
Forks
0
Watchers
0
Issues
HTML
Language
-
License

About This Server

无需官方 API 密钥即可与 X(原 Twitter)平台交互的强大工具。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

MCP-X Server

A powerful FastMCP server for interacting with the X (formerly Twitter) API without requiring official API keys.

Overview

MCP-X Server provides a set of tools for interacting with X platform, allowing you to post tweets, search for content, interact with users, and more. This server leverages the unofficial X API and custom authentication methods to access the platform's features.

Features

  • No official API keys required
  • Comprehensive set of tools for X interaction
  • Built on FastMCP architecture for seamless integration
  • Structured, maintainable codebase

Directory Structure

mcp-x-server/
├── auth/
│   └── x_authenticator.py    # X platform authentication
├── service/
│   └── x_service.py          # Core X service functionality
├── tools/
│   └── x_tools.py            # FastMCP tools definition
├── utils/
│   └── client_patcher.py     # Utility for patching the X client
└── main.py                   # Server entry point

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/mcp-x.git
    cd mcp-x/mcp-x-server
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Set up your X authentication: When first running the server, you'll need to authenticate by logging into your X account. The server will save your authentication data for future sessions.

Configuration

You can configure the data directory for storing authentication information by setting the X_DATA_DIR environment variable:

export X_DATA_DIR=/path/to/data/directory

If not set, the default path will be used.

Available Tools

Tweet Management

  • post_tweet: Post a tweet to your timeline
  • delete_tweet: Delete a tweet from your timeline
  • create_tweet_with_poll: Create a tweet with a poll
  • get_scheduled_tweets: View all scheduled tweets
  • create_scheduled_tweet: Schedule a tweet for later

Tweet Interaction

  • search_tweets: Search for tweets matching a query
  • get_tweet_by_id: Retrieve a specific tweet
  • favorite_tweet: Like a tweet
  • unfavorite_tweet: Unlike a tweet
  • retweet: Retweet a tweet
  • delete_retweet: Remove a retweet
  • get_retweeters: Get users who retweeted a tweet

User Management

  • get_user_by_screen_name: Find user by screen name
  • get_user_by_id: Find user by ID
  • get_user_tweets: Get tweets from a user
  • get_user_media: Get media tweets from a user
  • get_user_likes: Get tweets liked by a user

User Interaction

  • follow_user: Follow a user
  • unfollow_user: Unfollow a user
  • get_user_followers: View a user's followers
  • get_user_following: View accounts a user follows

Direct Messages

  • send_dm: Send a direct message
  • get_dm_history: View conversation history
  • delete_dm: Delete a direct message
  • get_trends: Get trending topics in various categories

Usage Examples

Here are some examples of how to use the tools:

Posting a Tweet

post_tweet "Just tried the new MCP-X Server - it's amazing! #MCP #FastMCP"

Searching for Tweets

search_tweets "artificial intelligence" mode=Latest count=15

Getting User Information

get_user_by_screen_name "elonmusk"

Following a User

follow_user "11348282"

Sending a Direct Message

send_dm "783214" text="Hello! I'm using the MCP-X Server to send this message."
get_trends category=news

Security and Rate Limiting

To maintain account security and avoid detection:

  1. Avoid sending too many requests in a short time
  2. Reuse login information by saving authentication data
  3. Be mindful of X's rate limits (detailed in the code)
  4. Don't use the server for spamming or abusive purposes

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This project is not affiliated with X or Twitter, Inc. Use at your own risk.

Quick Start

1

Clone the repository

git clone https://github.com/swcrazyfan/mcp-x
2

Install dependencies

cd mcp-x
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerswcrazyfan
Repomcp-x
LanguageHTML
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation