twitterapi-io-mcp

alexandrebouchez/twitterapi-io-mcp

3.3

If you are the rightful owner of twitterapi-io-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The TwitterAPI.io MCP Server provides access to Twitter data through the twitterapi.io API, enabling LLMs to perform various operations such as searching tweets, analyzing trends, and retrieving user information.

Tools
4
Resources
0
Prompts
0

TwitterAPI.io MCP Server

A Model Context Protocol (MCP) server that provides access to Twitter data through the twitterapi.io API. This server allows LLMs to search tweets, get user information, analyze trends, and more.

Features

  • Tweet Search: Advanced search with filtering options
  • User Analytics: Get user profiles, followers, and following lists
  • Tweet Analysis: Access replies, quotes, and retweets
  • Trend Monitoring: Get trending topics by location
  • User Discovery: Search for users by keywords

Quick Start

📚 for step-by-step setup instructions.

Option 1: Remote Setup (NPX) - Recommended

{
  "mcpServers": {
    "twitterapi-io": {
      "command": "npx",
      "args": ["twitterapi-io-mcp", "--api-key=your_api_key_here"]
    }
  }
}

Option 2: Local Setup

git clone https://github.com/alexandrebouchez/twitterapi-io-mcp.git
cd twitterapi-io-mcp
npm install
npm run build
{
  "mcpServers": {
    "twitterapi-io": {
      "command": "node",
      "args": ["/path/to/twitterapi-io-mcp/dist/index.js", "--api-key=your_api_key_here"]
    }
  }
}

📋 Prerequisites:

  • Node.js 18+
  • API key from twitterapi.io
  • Claude Desktop or MCP-compatible client

Available Tools

Tweet Operations

  • search_tweets: Search for tweets with advanced filtering
  • get_tweet_by_id: Get detailed tweet information
  • get_tweet_replies: Get replies to a specific tweet
  • get_tweet_quotes: Get quote tweets
  • get_tweet_retweets: Get users who retweeted

User Operations

  • get_user_info: Get detailed user profile
  • get_user_tweets: Get user's recent tweets
  • get_user_followers: Get user's followers
  • get_user_following: Get users being followed
  • search_users: Search for users by keyword

Trend Operations

  • get_trends: Get trending topics (optionally by location)

Examples

Search Recent Tweets

// Search for tweets about AI
search_tweets({
  query: "artificial intelligence",
  queryType: "Latest"
})

Get User Information

// Get profile information for a user
get_user_info({
  userName: "elonmusk"
})

Get Tweet Replies

// Get replies to a specific tweet
get_tweet_replies({
  tweetId: "1234567890123456789"
})

API Costs

TwitterAPI.io uses usage-based pricing:

  • $0.15/1k tweets
  • $0.18/1k user profiles
  • $0.15/1k followers
  • Minimum charge: $0.00015 per request

Development

Setup

git clone https://github.com/alexandrebouchez/twitterapi-io-mcp.git
cd twitterapi-io-mcp
npm install

Build

npm run build

Development Mode

npm run dev

Testing

# Install MCP Inspector for debugging
npx @modelcontextprotocol/inspector dist/index.js

Error Handling

The server includes comprehensive error handling for:

  • Authentication failures
  • Rate limiting
  • Network errors
  • Invalid parameters
  • API errors

Security

  • API keys are validated before use
  • All inputs are validated using Zod schemas
  • Network timeouts prevent hanging requests
  • Error messages don't leak sensitive information

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support