Twitter Client MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Twitter Client MCPGet profile of @elonmusk"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Twitter Client MCP
A Model Context Protocol (MCP) server that provides secure access to Twitter functionality through the agent-twitter-client library.
Features
The Twitter Client MCP provides the following capabilities:
Profile Operations
Get profile information by username
Get the authenticated user's profile
Tweet Operations
Get a specific tweet by ID
Get tweets from a user
Send new tweets
Like tweets
Retweet tweets
Search Operations
Search for tweets
Search for profiles
Relationship Operations
Get followers of a user
Get users that a user is following
Follow a user
Security ⚠️
IMPORTANT: TWITTER CREDENTIAL PROTECTION
This MCP server requires Twitter credentials to operate. To protect these sensitive credentials:
NEVER share your credentials
NEVER run commands that display your credentials
NEVER allow the LLM to execute shell commands directly without your approval
Multiple Layers of Protection
This server implements several layers of security to keep your credentials safe:
1. Credential Isolation
Your credentials are only loaded during initialization
After loading, credentials are immediately removed from environment variables
Credentials are never logged or transmitted to the LLM
2. Memory Protection
Secure memory allocation using sodium-native
Memory locking to prevent swapping to disk
Zero-out memory buffers after use
3. Access Prevention
Secure environment variable handling
Strict validation of required environment variables
Console output sanitization to prevent leaking secrets
Setup
Clone the repository
Install dependencies:
npm installBuild the project:
npm run build
Required Environment Variables
The Twitter Client MCP requires the following environment variables:
TWITTER_USERNAME=your_username
TWITTER_PASSWORD=your_password
TWITTER_EMAIL=your_email@example.comOptionally, you can add Twitter API v2 credentials for advanced functionality:
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET_KEY=your_api_secret
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_access_secretTools
The server exposes the following MCP tools:
Tool Name | Description | Parameters |
| Get a Twitter profile by username |
|
| Get the authenticated user's profile |
|
| Get a specific tweet by ID |
|
| Get tweets from a Twitter user |
|
| Post a new tweet |
|
| Like a tweet |
|
| Retweet a tweet |
|
| Search for tweets |
|
| Search for Twitter profiles |
|
| Get a list of users following a Twitter user |
|
| Get a list of users that a Twitter user is following |
|
| Follow a Twitter user |
|
Usage
Running Locally
# Start the server with environment variables
TWITTER_USERNAME=your_username TWITTER_PASSWORD=your_password TWITTER_EMAIL=your_email@example.com npm startAdding to Cursor
To add this MCP server to Cursor:
In Cursor, go to Settings > MCP Servers
Click "Add Server"
Configure the server with the following settings:
Name:
Twitter Client MCP(or any name you prefer)Type:
commandCommand:
nodeArguments:
/path/to/twitter-client-mcp/dist/index.js(replace with your actual path)Environment Variables:
TWITTER_USERNAME: Your Twitter usernameTWITTER_PASSWORD: Your Twitter passwordTWITTER_EMAIL: Your Twitter emailAny other variables you want to set
Click "Save"
Using NPX (Recommended)
You can also use npx to run the MCP server directly from GitHub:
TWITTER_USERNAME=your_username TWITTER_PASSWORD=your_password TWITTER_EMAIL=your_email@example.com npx -y github:mzkrasner/twitter-client-mcpUsing Environment Variables in Cursor Configuration
For more security and ease of use, configure Cursor via the .cursor/mcp.json file in your home directory:
{
"mcpServers": {
"twitter-client-mcp": {
"command": "npx",
"args": [
"-y",
"github:mzkrasner/twitter-client-mcp"
],
"env": {
"TWITTER_USERNAME": "your_username",
"TWITTER_PASSWORD": "your_password",
"TWITTER_EMAIL": "your_email@example.com"
}
}
}
}Development
Important Note for Development
When developing the MCP server, use console.error() instead of console.log() for all debugging and logging statements. The MCP protocol communicates with the client via stdout, so any console.log() statements will interfere with this communication.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/mzkrasner/twitter-client-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server