Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • Kintone MCP Server
  • X Twitter MCP server
  • MindManager MCP Server
  • GitLab MCP Server
  • Gmail Plugin MCP Server
Back to MCP Servers
X Twitter MCP Server

X Twitter MCP Server

Public
Dishant27/twitter-mcp

Enables comprehensive interaction with X (formerly Twitter) via Model Context Protocol, offering capabilities to post tweets, search content, manage user profiles, follow/unfollow accounts, and organize lists through API integration.

python
0 tools
May 29, 2025
Updated Jun 4, 2025

Supercharge Your AI with X Twitter MCP Server

MCP Server

Unlock the full potential of X Twitter MCP Server through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.

Unified API Access
Complete Tracing
Instant Setup
Get Started Now

Free tier available • No credit card required

Instant Setup
99.9% Uptime
10,000+Monthly Requests

X (Twitter) MCP Server

This MCP server allows Clients to interact with X (formerly Twitter), enabling comprehensive platform operations including posting tweets, searching content, managing accounts, and organizing lists.

Quick Start

  1. Create an X Developer account and get your API keys from X Developer Portal
  2. Set all required API keys in the environment variables
  3. Clone this repository: git clone https://github.com/Dishant27/twitter-mcp.git
  4. Install dependencies: npm install
  5. Run the server:
  • With environment variables:
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 \ npm start
  • Using a .env file:
# Create a .env file with your X API keys echo "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" > .env # Start the server npm start
  1. Use with a MCP client, such as Claude.

Claude Configuration

To use this server with Claude, you'll need to set up the MCP configuration. Here's an example of how the configuration structure should look:

{ "name": "x", "display_name": "X", "description": "X MCP allows Claude to interact with X (formerly Twitter)", "path": "path/to/twitter-mcp/dist/index.js", "startup": { "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" } }, "transport": "stdio" }

Save this configuration in your Claude MCP config directory, typically located at:

  • Windows: %APPDATA%\AnthropicClaude\mcp-servers
  • macOS: ~/Library/Application Support/AnthropicClaude/mcp-servers
  • Linux: ~/.config/AnthropicClaude/mcp-servers

Features

Post Operations

  • Post content (up to 280 characters)
  • Search for posts by query with customizable result count

Account Management

  • Get profile information for any user or the authenticated account
  • Update profile details (name, bio, location, website URL)
  • Follow and unfollow users
  • List followers for any user or the authenticated account
  • List accounts that a user is following

List Management

  • Create new lists (public or private)
  • Get information about specific lists
  • Retrieve all lists owned by the authenticated user

Available MCP Tools

Tool NameDescription
post_tweetPost new content to X
search_tweetsSearch for content on X
get_profileGet profile information for a user or the authenticated account
update_profileUpdate the authenticated user's profile
follow_userFollow a user
unfollow_userUnfollow a user
list_followersList followers of a user or the authenticated account
list_followingList accounts that a user or the authenticated account is following
create_listCreate a new list
get_list_infoGet information about a list
get_user_listsGet all lists owned by the authenticated user

Requirements

  • Node.js 18.x or higher
  • X Developer account with API keys
  • API v1 and v2 access

Environment Variables

VariableDescription
TWITTER_API_KEYYour API key
TWITTER_API_SECRETYour API secret
TWITTER_ACCESS_TOKENYour access token
TWITTER_ACCESS_TOKEN_SECRETYour access token secret

Repository Structure

twitter-mcp/
├── .github/
│   └── workflows/
│       ├── publish.yml
│       └── release.yml
├── code/
│   ├── account_management.py  # Sample Python code for account management
│   ├── post_tweet.py          # Sample Python code for posting content
│   └── retrieve_tweets.py     # Sample Python code for retrieving content
├── src/
│   ├── index.ts        # Main entry point
│   ├── twitter-api.ts  # X API client
│   ├── formatter.ts    # Response formatter
│   └── types.ts        # Type definitions
├── .env.example
├── .gitignore
├── Dockerfile
├── LICENSE
├── package.json
├── README.md
└── tsconfig.json

License

MIT

Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • Kintone MCP Server
    Kintone MCP Server

    Enables seamless integration with kintone via Model Context Protocol, offering comprehensive capabil...

    25 tools
    Added May 30, 2025
  • X Twitter MCP server
    X Twitter MCP server

    Model Context Protocol server enabling AI-driven interaction with Twitter API v2 for fetching, posti...

    23 tools
    Added May 30, 2025
  • MindManager MCP Server
    MindManager MCP Server

    Enables programmatic interaction with MindManager on Windows and macOS via the Model Context Protoco...

    9 tools
    Added May 30, 2025
  • GitLab MCP Server
    GitLab MCP Server

    Enables seamless interaction with GitLab via Model Context Protocol, offering comprehensive reposito...

    41 tools
    Added May 30, 2025
  • Gmail Plugin MCP Server
    Gmail Plugin MCP Server

    Enables seamless Gmail integration via Model Context Protocol, allowing MCP clients to securely send...

    Added May 30, 2025