MCP ExplorerExplorer

Takiaa Twitter Scraper Mcp

@MCP-Mirroron 20 days ago
1 MIT
FreeCommunity
AI Systems
Mirror of https://github.com/takiAA/twitter-scraper-mcp

Overview

What is Takiaa Twitter Scraper Mcp

takiAA_twitter-scraper-mcp is an MCP server that provides tools for interacting with Twitter using the agent-twitter-client library.

Use cases

Use cases include automating tweet retrieval for sentiment analysis, posting updates automatically, and integrating Twitter data into other applications.

How to use

To use takiAA_twitter-scraper-mcp, clone the repository, install the dependencies using npm or yarn, and set up your Twitter credentials in a .env file. You can run the server using FastMCP CLI tools for development and testing.

Key features

Key features include retrieving tweets by their ID with the getTweet function and posting new tweets using the sendTweet function.

Where to use

takiAA_twitter-scraper-mcp can be used in social media management, data analysis, and any application that requires interaction with Twitter.

Content

Twitter MCP Server

An MCP (Model Context Protocol) server that provides tools for interacting with Twitter using the agent-twitter-client library.

Features

  • getTweet: Retrieve a tweet by its ID
  • sendTweet: Post a new tweet to Twitter

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • Twitter account credentials

Installation

  1. Clone this repository
  2. Install dependencies:
npm install
# or
yarn install
  1. Create a .env file in the root directory with your Twitter credentials:
TWITTER_USERNAME=your_twitter_username
TWITTER_PASSWORD=your_twitter_password
[email protected] (optional)
TWITTER_2FA_SECRET=your_2fa_secret (optional)

# Optional API credentials (used as fallback)
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET_KEY=your_api_secret_key
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret

Usage

Running the Server

You can run the server using the FastMCP CLI tools:

# For development and testing in the terminal
npx fastmcp dev

# For visual inspection with the MCP Inspector
npx fastmcp inspect

Using the Tools

getTweet

Retrieves a tweet by its ID.

Parameters:

  • tweetId (string): The ID of the tweet to retrieve

Example:

getTweet({"tweetId": "1734609533274853865"})

sendTweet

Posts a new tweet to Twitter.

Parameters:

  • text (string): The text content of the tweet to send

Example:

sendTweet({"text": "Hello World from MCP!"})

Development

This server is built using:

To build the TypeScript code:

npx tsc

License

MIT

Tools

No tools

Comments