Skip to main content
Glama

Twitter MCP Server

by takiAA

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 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:

To build the TypeScript code:

npx tsc

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

提供与 Twitter 交互的工具,通过 ID 检索推文并使用 agent-twitter-client 库发布新推文。

  1. 特征
    1. 先决条件
      1. 安装
        1. 用法
          1. 运行服务器
          2. 使用工具
        2. 发展
          1. 执照

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              Enables interaction with Twitter through a Model Context Protocol, allowing large language models to post tweets, search for tweets, and reply to tweets.
              Last updated -
              53
              3
              19
              TypeScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              Provides AI agents with comprehensive Twitter functionality through the Model Context Protocol standard, enabling reading tweets, posting content, managing interactions, and accessing timeline data with robust error handling.
              Last updated -
              4
              12
              JavaScript
              • Apple
            • -
              security
              F
              license
              -
              quality
              A Python-based tool that streamlines social media tasks by enabling users to post tweets, track username changes, fetch recent tweets, and send direct messages on Twitter.
              Last updated -
              Python
            • -
              security
              F
              license
              -
              quality
              Provides social media functionality for AI agents, enabling them to login with unique handles, read filtered posts, and create posts or replies within team-based discussions.
              Last updated -
              3
              TypeScript
              • Apple

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/takiAA/twitter-scraper-mcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server