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
- Clone this repository
- Install dependencies:
npm install
# or
yarn install
- Create a
.envfile 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
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:
- FastMCP - A TypeScript framework for building MCP servers
- agent-twitter-client - A Twitter client library
To build the TypeScript code:
npx tsc
License
MIT
Twitter MCP Server
Project Details
- takiAA/twitter-scraper-mcp
- twitter-mcp-server
- Last Updated: 3/6/2025
Recomended MCP Servers
MCP server for accessing Dutch World War II archives through the Oorlogsbronnen API. Provides structured access to historical...
Context Portal (ConPort): A memory bank MCP server building a project-specific knowledge graph to supercharge AI assistants. Enables...
BGG MCP provides access to the BoardGameGeek API through the Model Context Protocol, enabling retrieval and filtering of...
基于MCP(Model Context Protocol)协议的飞书项目管理工具
A Script to Automate Netflix Household from an Email Mailbox with Docker support.
MCP server implementation for n8n workflow automation
This is an MCP (Model Context Protocol) server for interacting with Google's Chronicle Security Operations API.
A Model Context Protocol (MCP) server that provides tools for fetching and analyzing Reddit content.
A Model Context Protocol server for Google Workspace integration (Gmail and Calendar)
MCP DevTools: A suite of Model Context Protocol servers enabling AI assistants to interact with developer tools and...





