Twitter Client MCP
@mzkrasner
About Twitter Client MCP
A Model Context Protocol (MCP) server for secure Twitter client integration using the ElizaOS agent-twitter-client library
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"twitter-client-mcp": {
"command": "npx",
"args": [
"-y",
"github:mzkrasner/twitter-client-mcp"
],
"env": {
"TWITTER_USERNAME": "your_username",
"TWITTER_PASSWORD": "your_password",
"TWITTER_EMAIL": "[email protected]"
}
}
}
}Tools
12Get 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
Overview
What is Twitter Client MCP?
Twitter Client MCP is a Model Context Protocol (MCP) server that provides secure access to Twitter functionality through the agent-twitter-client library. It is designed for developers and users who want to let LLM-powered applications (via MCP clients like Cursor) read and write Twitter data while keeping credentials safe.
How to use Twitter Client MCP?
Clone the repository, install dependencies with npm install, and build with npm run build. Set the required environment variables (TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_EMAIL) and optionally API v2 credentials. Run locally with npm start or use npx to execute directly from GitHub. Configure as a command-type MCP server in your client (e.g., Cursor) pointing to the built index.js, or define it in a .cursor/mcp.json file.
Key features of Twitter Client MCP
- Get profile information by username or for the authenticated user.
- Retrieve a specific tweet by ID or list tweets from a user.
- Post new tweets, like tweets, and retweet tweets.
- Search for tweets with configurable modes (top, latest, photos, videos).
- Search for Twitter profiles by query.
- View a user’s followers, who they follow, and follow new accounts.
Use cases of Twitter Client MCP
- Automate social media monitoring by fetching recent tweets from specific users.
- Build an AI assistant that can post, like, or retweet tweets on your behalf.
- Search for relevant tweets or profiles during a research or marketing campaign.
- Manage your Twitter relationships (follow/unfollow) programmatically.
- Integrate Twitter data into a custom dashboard or chatbot powered by an LLM.
FAQ from Twitter Client MCP
What credentials does Twitter Client MCP require?
It requires TWITTER_USERNAME, TWITTER_PASSWORD, and TWITTER_EMAIL. Optionally, API v2 credentials (TWITTER_API_KEY, TWITTER_API_SECRET_KEY, TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET) can be added for advanced functionality.
How does the server protect my Twitter credentials?
Credentials are loaded only during initialization and immediately removed from environment variables after loading. They are never logged or transmitted to the LLM. The server uses secure memory allocation with sodium-native, memory locking, and zeroes out buffers after use.
How do I run Twitter Client MPC in Cursor?
In Cursor, go to Settings > MCP Servers, add a server with type command, command node, and arguments pointing to the built dist/index.js. Pass the required environment variables in the configuration. Alternatively, define them in a .cursor/mcp.json file.
Can I run Twitter Client MCP without installing it locally?
Yes, you can run it directly using npx with the command TWITTER_USERNAME=... TWITTER_PASSWORD=... TWITTER_EMAIL=... npx -y github:mzkrasner/twitter-client-mcp.
What transport does Twitter Client MCP use?
The server communicates with the MCP client over standard input/output (stdio), as it is a command-type server. All debugging output must use console.error() to avoid interfering with the protocol.
Frequently asked questions
What credentials does Twitter Client MCP require?
It requires `TWITTER_USERNAME`, `TWITTER_PASSWORD`, and `TWITTER_EMAIL`. Optionally, API v2 credentials (`TWITTER_API_KEY`, `TWITTER_API_SECRET_KEY`, `TWITTER_ACCESS_TOKEN`, `TWITTER_ACCESS_TOKEN_SECRET`) can be added for advanced functionality.
How does the server protect my Twitter credentials?
Credentials are loaded only during initialization and immediately removed from environment variables after loading. They are never logged or transmitted to the LLM. The server uses secure memory allocation with sodium-native, memory locking, and zeroes out buffers after use.
How do I run Twitter Client MPC in Cursor?
In Cursor, go to Settings > MCP Servers, add a server with type `command`, command `node`, and arguments pointing to the built `dist/index.js`. Pass the required environment variables in the configuration. Alternatively, define them in a `.cursor/mcp.json` file.
Can I run Twitter Client MCP without installing it locally?
Yes, you can run it directly using `npx` with the command `TWITTER_USERNAME=... TWITTER_PASSWORD=... TWITTER_EMAIL=... npx -y github:mzkrasner/twitter-client-mcp`.
What transport does Twitter Client MCP use?
The server communicates with the MCP client over standard input/output (stdio), as it is a command-type server. All debugging output must use `console.error()` to avoid interfering with the protocol.
Basic information
More Other MCP servers

Figs, Relationship Expert
Figs O'Sullivan, LMFTCouples therapist Figs O'Sullivan (LMFT, 17 years, endorsed by Sue Johnson, creator of EFT) inside your AI. Ask relationship questions answered from his clinical writing, name the pattern in a fight, get a three-step rep

DeepMark
DeepMark helps teachers deliver rapid, consistent marking with meaningful feedback for every student — in a fraction of the time. What once took a week, now takes one free period.

YOUB
Connect your AI assistant to your own YOUB endurance training account. Read recorded activities with full analysis, planned sessions, race goals, wellness (HRV, sleep, resting HR) and your athletic profile. Create or mov

EverArt
modelcontextprotocolModel Context Protocol Servers
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
Comments