twitter-mcp
v0.1.1
Published
A simple MCP server for posting tweets.
Downloads
102
Maintainers
Readme
Twitter MCP Server
A simple Model Context Protocol (MCP) server for posting tweets via the Twitter/X API.
Features
Currently supports:
- Tweet posting tool
Prerequisites
- Node.js (latest LTS version recommended)
- npm (comes with Node.js)
- Twitter/X Developer Account with API access
Setup
A reference blog https://medium.com/@nathaly12toledo/steps-to-create-a-single-tweet-with-a-free-account-and-the-twitter-api-via-postman-bc3ac8a2fd3e
1. Get Twitter/X API Keys
- Go to Twitter Developer Portal
- Sign in with your Twitter/X account
- Create a new project or select an existing one
- Generate the following keys:
- API Key (Consumer Key)
- API Secret (Consumer Secret)
- Access Token
- Access Token Secret
2. Configure Environment Variables
- Copy the example environment file:
cp .env.example .env - Open the
.envfile and add your Twitter API credentials:API_KEY=your_api_key API_SECRET_KEY=your_api_secret ACCESS_TOKEN=your_access_token ACCESS_TOKEN_SECRET=your_access_token_secret
3. Install Dependencies
npm install4. Build the Project
npm run buildRunning the Server
Standard Mode
npm startInspect Mode
To run the MCP server in inspect mode (allows detailed monitoring and debugging):
npm run inspectAfter running this command, open the URL displayed in your terminal to access the MCP Inspector interface.
Development
- Source code is located in the
srcdirectory - Built JavaScript files are output to the
distdirectory
License
ISC
Contributing
Feel free to submit issues or pull requests if you'd like to contribute to this project.
