X (Twitter) MCP Server

X (Twitter) MCP servers enable AI models to interact with X platforms, providing capabilities for tweet management, account operations, list organization, and content search.

GitHub stars

Overview

The X (Twitter) MCP Server bridges AI models and the X platform by letting language models (LLMs) perform comprehensive X operations directly. It's part of the Model Context Protocol (MCP) system, providing a safe and standard way to connect AI with X platform functionalities.

Created by:

Developed by Dishant27

Key Features

📝

Tweet Management

Post, search, and manage tweets with customizable result filtering

👤

Account Operations

View profiles, update details, and manage follower relationships

📋

List Organization

Create and manage public/private lists for content curation

🔒

Secure Authentication

Uses official X API credentials to avoid account suspension risks

Available Tools

Quick Reference

ToolPurposeCategory
post_tweetPost new content to XWrite
search_tweetsSearch for content on XRead
get_profileGet user profile informationRead
update_profileUpdate authenticated user's profileWrite
follow_userFollow a user on XWrite
unfollow_userUnfollow a user on XWrite
list_followersList user followersRead
list_followingList accounts a user is followingRead
create_listCreate a new X listWrite
get_list_infoGet details about a specific listRead
get_user_listsGet all lists owned by authenticated userRead

Detailed Usage

post_tweet

Post new content (up to 280 characters) to the authenticated X account.

use_mcp_tool({
  server_name: "x-twitter",
  tool_name: "post_tweet",
  arguments: {
    text: "Hello from AI-powered MCP server!"
  }
});
search_tweets

Search for X content using a query with customizable result count.

use_mcp_tool({
  server_name: "x-twitter",
  tool_name: "search_tweets",
  arguments: {
    query: "AI MCP server",
    count: 10
  }
});
get_profile

Get profile information for a specific user or the authenticated account.

use_mcp_tool({
  server_name: "x-twitter",
  tool_name: "get_profile",
  arguments: {
    screen_name: "Dishant27"
  }
});
create_list

Create a new public or private list for content curation.

use_mcp_tool({
  server_name: "x-twitter",
  tool_name: "create_list",
  arguments: {
    name: "AI Tools",
    description: "Curated list of AI tool developers",
    is_private: false
  }
});

Installation

{
  "mcpServers": {
    "x-twitter": {
      "command": "npm",
      "args": [
        "start"
      ],
      "env": {
        "TWITTER_API_KEY": "your_api_key",
        "TWITTER_API_SECRET": "your_api_secret",
        "TWITTER_ACCESS_TOKEN": "your_access_token",
        "TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
      }
    }
  }
}

Sources