twitter-scraper-mcp

This repository provides an MCP server for interacting with Twitter, allowing users to retrieve tweets by ID and post new tweets using the agent-twitter-client library and FastMCP framework.

0
0

Twitter MCP Server

This repository provides an MCP (Model Context Protocol) server designed to facilitate interaction with Twitter, leveraging the agent-twitter-client library.

Features

  • getTweet: Retrieves a specific tweet using its unique ID.
  • sendTweet: Enables posting new tweets directly to Twitter.

Prerequisites

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

Installation

  1. Clone the repository.
  2. Install dependencies using npm install or yarn install.
  3. Configure Twitter credentials within a .env file, including username, password, and optional 2FA secret. API keys and tokens can be used as a fallback authentication method.

Usage

Running the Server

Utilize FastMCP CLI tools to run the server:

npx fastmcp dev # Development mode
npx fastmcp inspect # Visual inspection

Using the Tools

The server exposes two primary functions: getTweet which accepts a tweetId string, and sendTweet which accepts a text string for the tweet content.

Development

Built using FastMCP and agent-twitter-client. Use npx tsc to compile the TypeScript code.

License

MIT

Repository

TA
takiAA

takiAA/twitter-scraper-mcp

Created

March 6, 2025

Updated

March 6, 2025

Language

JavaScript

Category

Communication