X/Twitter

v1.0.0Communicationstable

Enables creating, managing, and publishing X/Twitter posts, threads, and replies directly through Claude chat. Supports draft management with the ability to create, list, publish, and delete tweet drafts.

fastmcpmcptwittertwitter-apivibecoding
Share:
30
Stars
0
Downloads
0
Weekly
0/5

What is X/Twitter?

X/Twitter is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables creating, managing, and publishing x/twitter posts, threads, and replies directly through claude chat. supports draft management with the ability to create, list, publish, and delete tweet dra...

Enables creating, managing, and publishing X/Twitter posts, threads, and replies directly through Claude chat. Supports draft management with the ability to create, list, publish, and delete tweet drafts.

This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables creating, managing, and publishing X/Twitter posts,

Use Cases

Create and publish X/Twitter posts, threads, and replies from Claude.
Manage tweet drafts with create, list, publish, and delete capabilities.
Automate social media content management and scheduling.
rafaljanicki

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 13, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx x-twitter-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use X/Twitter

X/Twitter MCP Server is a Python-based MCP server that connects AI assistants to the X (formerly Twitter) API, enabling full tweet lifecycle management including posting tweets, creating threads, replying, searching, managing drafts, bookmarking, and retrieving timelines and trends. It supports 20+ tools covering user lookup, poll creation, reactions, and bookmark management, making it ideal for social media managers and developers who want to automate X content workflows directly from their AI assistant.

Prerequisites

  • Python 3.10+ installed with pip
  • A Twitter/X developer account with an approved app at https://developer.twitter.com
  • TWITTER_API_KEY and TWITTER_API_SECRET (from your X app's OAuth 1.0a settings)
  • TWITTER_ACCESS_TOKEN and TWITTER_ACCESS_TOKEN_SECRET (generated for your user account)
  • TWITTER_BEARER_TOKEN (from your X app dashboard for read-only search operations)
1

Install from PyPI

Install the x-twitter-mcp package using pip.

pip install x-twitter-mcp
2

Create an X Developer App and obtain credentials

Go to https://developer.twitter.com/en/portal/dashboard, create a new app, enable OAuth 1.0a with Read and Write permissions, and generate your API key, API secret, access token, and access token secret.

3

Set your X API credentials as environment variables

Export all five credential environment variables. The bearer token is used for search and read operations; the OAuth tokens are required for posting and managing tweets.

export TWITTER_API_KEY=your_api_key
export TWITTER_API_SECRET=your_api_secret
export TWITTER_ACCESS_TOKEN=your_access_token
export TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret
export TWITTER_BEARER_TOKEN=your_bearer_token
4

Add the server to your MCP client config

Register the X Twitter MCP server in your Claude Desktop configuration with all required credential environment variables.

{
  "mcpServers": {
    "x-twitter": {
      "command": "python",
      "args": ["-m", "x_twitter_mcp"],
      "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",
        "TWITTER_BEARER_TOKEN": "your_bearer_token"
      }
    }
  }
}
5

Restart your MCP client and verify

Restart Claude Desktop to load the new configuration. Ask it to get your Twitter profile to confirm authentication is working before attempting to post.

X/Twitter Examples

Client configuration

Claude Desktop configuration for the X/Twitter MCP server with all required OAuth credentials.

{
  "mcpServers": {
    "x-twitter": {
      "command": "python",
      "args": ["-m", "x_twitter_mcp"],
      "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",
        "TWITTER_BEARER_TOKEN": "your_bearer_token",
        "TWITTER_OAUTH2_USER_ACCESS_TOKEN": "optional_oauth2_token"
      }
    }
  }
}

Prompts to try

Example prompts for managing X/Twitter content through the AI assistant.

- "Post a tweet saying 'Hello from Claude! Testing my MCP integration #MCP'"
- "Search Twitter for recent tweets about Model Context Protocol, limit to 10"
- "Get the current trending topics on Twitter"
- "Show my Twitter timeline, latest 20 tweets"
- "Create a draft tweet about AI automation and save it for review before publishing"
- "Get the Twitter profile for @anthropic"

Troubleshooting X/Twitter

401 Unauthorized errors when posting tweets

Posting requires OAuth 1.0a user authentication. Ensure TWITTER_ACCESS_TOKEN and TWITTER_ACCESS_TOKEN_SECRET are generated for your specific user account (not just the app), and that your X app has Read and Write permissions enabled — not just Read.

403 Forbidden when accessing search or timelines

Search and timeline access may require a paid X API tier (Basic or Pro). The free tier has very limited access. Check your app's access level at https://developer.twitter.com and upgrade if needed.

Bookmark tools fail with authentication errors

Bookmark operations require TWITTER_OAUTH2_USER_ACCESS_TOKEN, which is an OAuth 2.0 user token separate from the OAuth 1.0a tokens. Generate this through the OAuth 2.0 PKCE flow in your X developer app.

Frequently Asked Questions about X/Twitter

What is X/Twitter?

X/Twitter is a Model Context Protocol (MCP) server that enables creating, managing, and publishing x/twitter posts, threads, and replies directly through claude chat. supports draft management with the ability to create, list, publish, and delete tweet drafts. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install X/Twitter?

Follow the installation instructions on the X/Twitter GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with X/Twitter?

X/Twitter works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is X/Twitter free to use?

Yes, X/Twitter is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Communication MCP Servers

Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "x-twitter-mcp-server": { "command": "npx", "args": ["-y", "x-twitter-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use X/Twitter?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides