# twitter-scraper-mcp

> MCP Server

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.

## Overview

- **Category:** Communication
- **Language:** JavaScript
- **Stars:** 7
- **Forks:** 0
- **Owner:** takiAA
- **GitHub:** https://github.com/takiAA/twitter-scraper-mcp
- **Created:** 2025-03-06T10:40:52+00:00
- **Updated:** 2025-03-06T15:30:13+00:00
- **Source:** https://model-context-protocol.com/servers/twitter-mcp-server-interact-with-twitter

## Setup

## Setup

1. Clone this repository.
2. Install dependencies:

```bash
npm install
# or
yarn install
```

3. Create a `.env` file in the root directory with your Twitter credentials:

```
TWITTER_USERNAME=your_twitter_username
TWITTER_PASSWORD=your_twitter_password
TWITTER_EMAIL=your_email@example.com (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
```

## Tools

## Available Tools

1. getTweet (Retrieve a tweet by its ID)
2. sendTweet (Post a new tweet to Twitter)
