
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
x-twitter-mcp-server
Advanced tools
MCP server for X/Twitter — post tweets, search, follow, and monitor your account with Claude
A Model Context Protocol (MCP) server that enables Claude Desktop (and other MCP clients) to interact with X/Twitter — post tweets, read timelines, search content, manage follows, and monitor your account.
EXTCONTENT markers@username to user IDs once, caches for 4hSENSE — Read from X/Twitter:
| Tool | Description |
|---|---|
x_get_timeline | Home timeline — recent posts from followed accounts |
x_get_notifications | Mentions of the authenticated user |
x_search_tweets | Search by keyword, hashtag, or from:username |
x_get_tweet_thread | Fetch a tweet and its full conversation thread |
x_get_profile | User profile by username |
x_get_followers | Followers list for any account |
x_get_user_tweets | Recent tweets from a specific user |
x_search_users | Search for users by name or keyword |
x_get_media_specs | X/Twitter media format specs (dimensions, size limits, formats) |
ACT — Write to X/Twitter:
| Tool | Description |
|---|---|
x_create_tweet | Post a tweet (text, link card, image, or video) |
x_reply | Reply to a tweet |
x_create_thread | Post a series of connected tweets |
x_quote_tweet | Quote-tweet with commentary |
x_like | Like a tweet |
x_retweet | Retweet |
x_follow | Follow a user by username |
x_unfollow | Unfollow a user by username |
x_delete_tweet | Delete a tweet |
X_APP_KEYX_APP_SECRETX_ACCESS_TOKENX_ACCESS_SECRETFor read-only access, a Bearer Token alone is sufficient.
If you're using Claude Code, install directly via the plugin system:
# Add the Luminary Lane Tools marketplace
/plugin marketplace add luminarylane/x-twitter-mcp-server
# Install the plugin
/plugin install x-twitter@luminary-lane-tools
Or install directly without adding the marketplace:
/plugin install x-twitter@luminarylane/x-twitter-mcp-server
Note: Set your X API credentials as environment variables before using the plugin.
Run directly without installation:
# Test it works
X_BEARER_TOKEN=your-token npx -y x-twitter-mcp-server
Claude Desktop configuration:
{
"mcpServers": {
"x-twitter": {
"command": "npx",
"args": ["-y", "x-twitter-mcp-server"],
"env": {
"X_APP_KEY": "your-consumer-key",
"X_APP_SECRET": "your-consumer-secret",
"X_ACCESS_TOKEN": "your-access-token",
"X_ACCESS_SECRET": "your-access-token-secret"
}
}
}
}
Read-only setup (bearer token only):
{ "env": { "X_BEARER_TOKEN": "your-bearer-token" } }
npm install -g x-twitter-mcp-server
Then configure Claude Desktop:
{
"mcpServers": {
"x-twitter": {
"command": "x-twitter-mcp-server",
"env": {
"X_APP_KEY": "your-consumer-key",
"X_APP_SECRET": "your-consumer-secret",
"X_ACCESS_TOKEN": "your-access-token",
"X_ACCESS_SECRET": "your-access-token-secret"
}
}
}
}
git clone https://github.com/luminarylane/x-twitter-mcp-server.git
cd x-twitter-mcp-server
npm install
npm run build
Then configure Claude Desktop:
{
"mcpServers": {
"x-twitter": {
"command": "node",
"args": ["/path/to/x-twitter-mcp-server/dist/index.js"],
"env": {
"X_APP_KEY": "your-consumer-key",
"X_APP_SECRET": "your-consumer-secret",
"X_ACCESS_TOKEN": "your-access-token",
"X_ACCESS_SECRET": "your-access-token-secret"
}
}
}
}
The server resolves credentials in this priority order:
| Priority | Mode | Env Vars | Access |
|---|---|---|---|
| 1 | OAuth 1.0a | X_APP_KEY + X_APP_SECRET + X_ACCESS_TOKEN + X_ACCESS_SECRET | Full read + write |
| 2 | Bearer Token | X_BEARER_TOKEN | Read-only |
| 3 | Per-call | Pass as tool arguments | Either mode |
Per-call credentials let you manage multiple X accounts from one server instance — pass appKey, appSecret, accessToken, accessSecret (or bearerToken) directly as tool arguments.
Once configured, ask Claude to:
The server enforces X free-tier rate limits client-side before hitting the API:
| Category | Limit | Window |
|---|---|---|
| General reads | 450 requests | 15 min |
| Timeline reads | 900 requests | 15 min |
| Tweet creation | 50 tweets | 24 hours |
| Likes | 1,000 likes | 24 hours |
| Retweet / Follow / Unfollow | 5 actions | 15 min |
When a limit is reached the server returns a structured error with a retryAfterSeconds field and an action hint for the agent.
Error: Missing credentials
Ensure all four OAuth 1.0a variables are set, or at minimum X_BEARER_TOKEN for read-only access.
AUTH_FAILED: Credentials are invalid or expired.
Regenerate your Access Token and Secret in the X Developer Portal and update X_ACCESS_TOKEN / X_ACCESS_SECRET.
PERMISSION_DENIED: Your token may lack write permissions.
Go to X Developer Portal → App Settings → User authentication → Permissions and set it to Read and write, then regenerate your tokens.
DUPLICATE_TWEET: X rejected this as a duplicate.
Change the tweet text to make it unique.
TIER_RESTRICTED: This endpoint is not available on your X API tier.
Some endpoints (e.g., full-archive search) require a Basic or Pro tier. The x_search_tweets tool uses recent search which is available on the free tier.
Rate limited: Wait Xs then retry.
The server handles this automatically for short waits (≤ 60s). For longer windows it returns the retryAfterSeconds so the agent can defer the task.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
# Install dependencies
npm install
# Run in dev mode
npm run dev
# Type check
npx tsc --noEmit
# Run tests
npm test
# Format
npx prettier --write .
MIT License — see LICENSE for details.
FAQs
MCP server for X/Twitter — post tweets, search, follow, and monitor your account with Claude
The npm package x-twitter-mcp-server receives a total of 39 weekly downloads. As such, x-twitter-mcp-server popularity was classified as not popular.
We found that x-twitter-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.