x (twitter).com
x (twitter).com logo

X (Twitter)

Integrates with the X (Twitter) API to enable posting tweets, retrieving user data, and analyzing trends.

Created byApr 23, 2025

X MCP Server

A Model Context Protocol (MCP) server for X (Twitter) integration that provides tools for reading your timeline and engaging with tweets. Designed for use with Claude desktop.
<a href="https://glama.ai/mcp/servers/5nx3qqiunw"><img width="380" height="200" src="https://glama.ai/mcp/servers/5nx3qqiunw/badge" alt="X Server MCP server" /></a>

Features

  • Get tweets from your home timeline
  • Create new tweets
  • Reply to tweets
  • Built-in rate limit handling for the free API tier
  • TypeScript implementation with full type safety

Prerequisites

  • Node.js (v16 or higher)
  • X (Twitter) Developer Account (Free)
  • Claude desktop app

X API Access

X (Twitter) provides a free tier for basic API access:

Free Tier Features

  • Post Limits:
  • Read Limits:
  • Features:
  • Rate Limits:
Note: For higher volume needs, paid tiers are available:
  • Basic tier ($100/month): 50,000 tweets/month, additional endpoints
  • Pro tier ($5000/month): Higher limits and enterprise features
You can access the free tier at: https://developer.x.com/en/portal/products/free

Installation

  1. Clone the repository:
  1. Install dependencies:
  1. Build the server:

Configuration

You need to set up your X (Twitter) API credentials. Follow these detailed steps:
  1. Go to the Twitter Developer Portal
  1. Access the Free Tier:
  1. Create a new project:
  1. Create a new app within your project:
  1. Configure app settings:
  1. Set app permissions:
  1. Generate API Keys and Tokens:
Important:
  • Keep your keys and tokens secure and never share them publicly
  • You'll need all four values:
  • Remember the free tier limits:

Claude Desktop Configuration

To connect the X MCP server with Claude desktop, you need to configure it in the Claude settings. Follow these steps:
  1. Open File Explorer
  1. Navigate to the Claude config directory:
  1. Create or edit claude_desktop_config.json:
  1. Add the following configuration, replacing the placeholder values with your actual API credentials from the previous section:
  1. Save the file and restart Claude desktop
Note: Make sure to:
  • Replace all four credential values with your actual API keys and tokens
  • Keep the quotes ("") around each value
  • Maintain the exact spacing and formatting shown above
  • Save the file with the .json extension

Available Tools

get_home_timeline

Get the most recent tweets from your home timeline.
Parameters:
  • limit (optional): Number of tweets to retrieve (default: 20, max: 100)
Example:

create_tweet

Create a new tweet.
Parameters:
  • text (required): The text content of the tweet (max 280 characters)
Example:

reply_to_tweet

Reply to a tweet.
Parameters:
  • tweet_id (required): The ID of the tweet to reply to
  • text (required): The text content of the reply (max 280 characters)
Example:

Development

  • npm run build: Build the TypeScript code
  • npm run dev: Run TypeScript in watch mode
  • npm start: Start the MCP server

Rate Limiting

The server includes built-in rate limit handling for X's free tier:
  • Monthly limits:
  • Features:

License

MIT

Contributing

  1. Fork the repository
  1. Create your feature branch (git checkout -b feature/amazing-feature)
  1. Commit your changes (git commit -m 'Add some amazing feature')
  1. Push to the branch (git push origin feature/amazing-feature)
  1. Open a Pull Request

X MCP Server

A Model Context Protocol (MCP) server for X (Twitter) integration that provides tools for reading your timeline and engaging with tweets. Designed for use with Claude desktop.
<a href="https://glama.ai/mcp/servers/5nx3qqiunw"><img width="380" height="200" src="https://glama.ai/mcp/servers/5nx3qqiunw/badge" alt="X Server MCP server" /></a>

Features

  • Get tweets from your home timeline
  • Create new tweets
  • Reply to tweets
  • Built-in rate limit handling for the free API tier
  • TypeScript implementation with full type safety

Prerequisites

  • Node.js (v16 or higher)
  • X (Twitter) Developer Account (Free)
  • Claude desktop app

X API Access

X (Twitter) provides a free tier for basic API access:

Free Tier Features

  • Post Limits:
  • Read Limits:
  • Features:
  • Rate Limits:
Note: For higher volume needs, paid tiers are available:
  • Basic tier ($100/month): 50,000 tweets/month, additional endpoints
  • Pro tier ($5000/month): Higher limits and enterprise features
You can access the free tier at: https://developer.x.com/en/portal/products/free

Installation

  1. Clone the repository:
  1. Install dependencies:
  1. Build the server:

Configuration

You need to set up your X (Twitter) API credentials. Follow these detailed steps:
  1. Go to the Twitter Developer Portal
  1. Access the Free Tier:
  1. Create a new project:
  1. Create a new app within your project:
  1. Configure app settings:
  1. Set app permissions:
  1. Generate API Keys and Tokens:
Important:
  • Keep your keys and tokens secure and never share them publicly
  • You'll need all four values:
  • Remember the free tier limits:

Claude Desktop Configuration

To connect the X MCP server with Claude desktop, you need to configure it in the Claude settings. Follow these steps:
  1. Open File Explorer
  1. Navigate to the Claude config directory:
  1. Create or edit claude_desktop_config.json:
  1. Add the following configuration, replacing the placeholder values with your actual API credentials from the previous section:
  1. Save the file and restart Claude desktop
Note: Make sure to:
  • Replace all four credential values with your actual API keys and tokens
  • Keep the quotes ("") around each value
  • Maintain the exact spacing and formatting shown above
  • Save the file with the .json extension

Available Tools

get_home_timeline

Get the most recent tweets from your home timeline.
Parameters:
  • limit (optional): Number of tweets to retrieve (default: 20, max: 100)
Example:

create_tweet

Create a new tweet.
Parameters:
  • text (required): The text content of the tweet (max 280 characters)
Example:

reply_to_tweet

Reply to a tweet.
Parameters:
  • tweet_id (required): The ID of the tweet to reply to
  • text (required): The text content of the reply (max 280 characters)
Example:

Development

  • npm run build: Build the TypeScript code
  • npm run dev: Run TypeScript in watch mode
  • npm start: Start the MCP server

Rate Limiting

The server includes built-in rate limit handling for X's free tier:
  • Monthly limits:
  • Features:

License

MIT

Contributing

  1. Fork the repository
  1. Create your feature branch (git checkout -b feature/amazing-feature)
  1. Commit your changes (git commit -m 'Add some amazing feature')
  1. Push to the branch (git push origin feature/amazing-feature)
  1. Open a Pull Request