Twitter MCP Server logo

Twitter MCP Server

by crazyrabbitLTC

The Twitter MCP Server is a Model Context Protocol server implementation designed for integrating with the Twitter API. It provides a set of tools for performing various Twitter operations such as posting tweets, searching, managing users, and analyzing data.

View on GitHub

Last updated: N/A

What is Twitter MCP Server?

This server is a Node.js application that acts as a Model Context Protocol (MCP) server, providing a simplified interface for interacting with the Twitter API. It allows developers to perform common Twitter tasks through a set of predefined tools.

How to use Twitter MCP Server?

To use this server, clone the repository, install the dependencies using npm install, configure your Twitter API credentials in the .env file, build the project with npm run build, and start the server using npm start. Then, you can send requests to the server's endpoints using the specified JSON formats for each tool.

Key features of Twitter MCP Server

  • Tweet posting and management (post, reply, delete)

  • User information retrieval and timeline access

  • Engagement actions (like, retweet)

  • List management (create, add/remove users, get members)

  • Search functionality for tweets

Use cases of Twitter MCP Server

  • Automated tweet posting for marketing campaigns

  • Social media monitoring and analytics

  • Building custom Twitter applications

  • Integrating Twitter data into other applications

  • Managing Twitter lists for targeted content delivery

FAQ from Twitter MCP Server

What is the purpose of this server?

It simplifies interaction with the Twitter API by providing a set of tools accessible through a Model Context Protocol.

What are the required environment variables?

You need to provide your Twitter API key, API secret, access token, and access token secret in the .env file.

How do I post a tweet with media?

Use the postTweetWithMedia tool and provide the tweet text, media path, media type, and optional alt text in the JSON payload.

What error handling is implemented?

The server returns standardized error responses for missing parameters, API errors, and not found errors.

What is the format of successful responses?

Successful responses are returned in a JSON format with a content array containing the operation result message.