Get the FREE Ultimate OpenClaw Setup Guide →

twitter-X

X Tools for Claude MCP: A lightweight toolkit enabling Claude to search Twitter with natural language and display results based on user intent. Get raw tweet data or AI analysis—your choice. Supports advanced Twitter search operators with filters for users, dates, and engagement metrics. Seamlessly integrates with Claude Desktop via MCP.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio 0xgval-twitter-x-mcp-server node YOUR_ABSOLUTE_PATH_TO/main.js \
  --env RAPIDAPI_KEY="your_rapidapi_key"

How to use

This MCP server exposes a Twitter search tool that integrates with Claude to perform natural language queries and return results from Twitter via the RapidAPI The Old Bird API. You can instruct Claude to search for tweets using plain language, or you can use direct search syntax. The tool supports filtering by keywords, users, dates, engagement metrics, and more, with options for latest or top results and configurable limits. When used, Claude will relay the request to the main.js handler, which delegates the search to tools/twitter.js and formats the results for display in a clean, markdown-friendly manner. The knowledge base files (claude-rules.md and knowledge/TwitterSearchSyntaxGuide.txt) help Claude render results and guide users on how to structure queries for best results.

How to install

Prerequisites:

  • Node.js v16 or newer
  • Claude for Desktop
  • A RapidAPI key with access to The Old Bird API (Twitter154) endpoint

Installation steps:

  1. Clone this repository: git clone https://github.com/0xGval/twitter-X-mcp-server cd twitter-X-mcp-tools

  2. Install dependencies: npm install

  3. Create your MCP configuration:

    • Copy mcp.json.example to mcp.json in your Claude Desktop directory
    • Edit mcp.json to include your RapidAPI key and correct absolute file paths

    Example mcp.json: { "mcpServers": { "x-tools": { "command": "node", "args": ["YOUR_ABSOLUTE_PATH_TO/main.js"], "env": { "RAPIDAPI_KEY": "your_rapidapi_key" } } } }

  4. Configure Claude for Desktop:

    • Windows: Place mcp.json in %APPDATA%\Claude\
    • macOS: Place mcp.json in ~/Library/Application Support/Claude/
    • Copy claude-rules.md and knowledge/TwitterSearchSyntaxGuide.txt to Claude knowledge base
    • Restart Claude Desktop for changes to take effect

Additional notes

Tips and notes:

  • Ensure your RAPIDAPI_KEY is kept secure and not shared publicly.
  • Use absolute paths in the mcp.json file to avoid path resolution issues, especially on Windows.
  • If you encounter no results, verify your RapidAPI subscription status and that the API endpoint is accessible.
  • Keep claude-rules.md up to date to guide Claude on displaying results with flexible output when needed.
  • The tool supports pagination; adjust the limit in queries to fetch more tweets as required.

Related MCP Servers

Sponsor this space

Reach thousands of developers