by nirholas
Automates X/Twitter tasks such as profile scraping, follower management, tweet searching, liking, retweeting, posting, and multi‑account actions through a CLI, browser console scripts, Node.js API, and an MCP server for AI agents, all without requiring Twitter API keys or fees.
XActions provides a comprehensive toolkit for X/Twitter automation. It enables users to extract data (profiles, followers, tweets, hashtags, media), perform bulk actions (follow, unfollow, like, retweet, post), monitor account changes, and integrate with AI agents via an MCP server, all using free, open‑source code.
npm install -g xactions for global CLI access or npm install xactions for library use.xactions login, xactions followers <user> --output followers.json, xactions non-followers <user>.scrapeProfile, scrapeFollowers, searchTweets, createBrowser and combine them in custom scripts.npm run mcp) and let AI agents (Claude, GPT) call tools like x_get_profile, x_unfollow, x_post_tweet.Q: Do I need a Twitter developer account?
A: No. XActions uses your session cookie (auth_token) to interact with the web UI.
Q: Is it safe from bans? A: The tool includes random delays (1‑5 seconds), scrolling patterns, and rate‑limit handling. Use responsibly and avoid 24/7 nonstop actions.
Q: Can I run it without installing anything? A: Yes. All automation scripts can be pasted into the browser console on any X page.
Q: How do I authenticate?
A: Run xactions login and paste your auth_token cookie, or manually set the cookie in the loginWithCookie function.
Q: What AI agents can use the MCP server? A: Any agent that supports the Model Context Protocol, such as Claude Desktop or custom GPT‑based bots.
Q: Is there a GUI? A: A no‑code web dashboard is available at https://xactions.app with free and pro tiers.
Q: How do I export data?
A: Use CLI flags --output file.json or --output file.csv, or call exportToJSON/exportToCSV from the Node.js API.
Free, open-source X/Twitter automation. Scrapers, MCP server for AI agents, CLI, browser scripts — all without expensive API fees.
🌐 xactions.app — Don't want to code? Use our website!
| XActions | Twitter API | Other Tools | |
|---|---|---|---|
| Monthly Cost | $0 | 5,000 | $29-99 |
| Setup Time | 30 seconds | Hours | Minutes |
| Open Source | ✅ | - | ❌ |
| No API Key | ✅ | ❌ | ❌ |
| AI Agent Ready | ✅ MCP | ❌ | ❌ |
npm install xactions
npm install -g xactions
xactions --help
Just copy-paste scripts directly into your browser console on x.com!
Browser Console — No install required!
// Go to: x.com/YOUR_USERNAME/following
// Press F12 → Console → Paste this:
(() => {
const sleep = (s) => new Promise(r => setTimeout(r, s * 1000));
const run = async () => {
const buttons = [...document.querySelectorAll('[data-testid$="-unfollow"]')]
.filter(b => !b.closest('[data-testid="UserCell"]')
?.querySelector('[data-testid="userFollowIndicator"]'));
for (const btn of buttons) {
btn.click();
await sleep(1);
document.querySelector('[data-testid="confirmationSheetConfirm"]')?.click();
await sleep(2);
}
window.scrollTo(0, document.body.scrollHeight);
await sleep(2);
if (document.querySelectorAll('[data-testid$="-unfollow"]').length) run();
else console.log('✅ Done! Reload page to continue.');
};
run();
})();
CLI:
xactions login
xactions non-followers YOUR_USERNAME --output non-followers.json
Node.js:
import { createBrowser, createPage, scrapeFollowing } from 'xactions';
const browser = await createBrowser();
const page = await createPage(browser);
const following = await scrapeFollowing(page, 'your_username', { limit: 500 });
const nonFollowers = following.filter(u => !u.followsBack);
console.log(`Found ${nonFollowers.length} non-followers`);
await browser.close();
💡 Don't want to code? Use xactions.app — just login and click!
Browser Console:
// Go to any profile on x.com, then run:
(() => {
const profile = {
name: document.querySelector('[data-testid="UserName"]')?.textContent?.split('@')[0]?.trim(),
username: location.pathname.slice(1),
bio: document.querySelector('[data-testid="UserDescription"]')?.textContent,
followers: document.querySelector('a[href$="/followers"] span')?.textContent,
following: document.querySelector('a[href$="/following"] span')?.textContent,
};
console.log(profile);
copy(JSON.stringify(profile, null, 2)); // Copies to clipboard!
})();
CLI:
xactions profile elonmusk --json
Node.js:
import { createBrowser, createPage, scrapeProfile } from 'xactions';
const browser = await createBrowser();
const page = await createPage(browser);
const profile = await scrapeProfile(page, 'elonmusk');
console.log(profile);
// { name: 'Elon Musk', followers: '200M', bio: '...', ... }
await browser.close();
Browser Console:
// Go to: x.com/search?q=YOUR_KEYWORD&f=live
(() => {
const tweets = [...document.querySelectorAll('article[data-testid="tweet"]')]
.map(article => ({
text: article.querySelector('[data-testid="tweetText"]')?.textContent,
author: article.querySelector('[data-testid="User-Name"] a')?.href?.split('/')[3],
time: article.querySelector('time')?.getAttribute('datetime'),
}));
console.table(tweets);
copy(JSON.stringify(tweets, null, 2));
})();
CLI:
xactions search "AI startup" --limit 100 --output ai-tweets.json
Node.js:
import { createBrowser, createPage, searchTweets } from 'xactions';
const browser = await createBrowser();
const page = await createPage(browser);
const tweets = await searchTweets(page, 'AI startup', { limit: 100 });
console.log(`Found ${tweets.length} tweets`);
await browser.close();
Browser Console:
// Go to: x.com/YOUR_USERNAME/followers
(() => {
const KEY = 'xactions_followers';
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
const scrape = async () => {
const users = new Set();
let retries = 0;
while (retries < 5) {
document.querySelectorAll('[data-testid="UserCell"] a')
.forEach(a => users.add(a.href.split('/')[3]?.toLowerCase()));
window.scrollTo(0, document.body.scrollHeight);
await sleep(1500);
retries++;
}
return [...users].filter(Boolean);
};
scrape().then(current => {
const saved = localStorage.getItem(KEY);
if (saved) {
const old = JSON.parse(saved);
const gone = old.filter(u => !current.includes(u));
console.log('🚨 Unfollowed you:', gone);
}
localStorage.setItem(KEY, JSON.stringify(current));
console.log(`💾 Saved ${current.length} followers`);
});
})();
CLI:
# First run saves snapshot
xactions followers YOUR_USERNAME --output snapshot1.json
# Later, compare
xactions followers YOUR_USERNAME --output snapshot2.json
# Use diff tools to compare
Browser Console:
// Go to: x.com/search?q=YOUR_KEYWORD&f=live
(async () => {
const sleep = (s) => new Promise(r => setTimeout(r, s * 1000));
const liked = new Set();
while (liked.size < 20) { // Like 20 posts
const buttons = [...document.querySelectorAll('[data-testid="like"]')]
.filter(b => !liked.has(b));
for (const btn of buttons.slice(0, 3)) {
btn.click();
liked.add(btn);
console.log(`❤️ Liked ${liked.size} posts`);
await sleep(3 + Math.random() * 2); // Random delay
}
window.scrollTo(0, document.body.scrollHeight);
await sleep(2);
}
console.log('✅ Done!');
})();
⚠️ Go slow! Twitter may rate-limit you. The website version handles this automatically.
| Feature | Console Script | CLI | Node.js | Website |
|---|---|---|---|---|
| SCRAPING | ||||
| Scrape Profile | ✅ | ✅ | ✅ | ✅ |
| Scrape Followers | ✅ | ✅ | ✅ | ✅ |
| Scrape Following | ✅ | ✅ | ✅ | ✅ |
| Scrape Tweets | ✅ | ✅ | ✅ | ✅ |
| Search Tweets | ✅ | ✅ | ✅ | ✅ |
| Scrape Thread | ✅ | ✅ | ✅ | ✅ |
| Scrape Hashtag | ✅ | ✅ | ✅ | ✅ |
| Scrape Media | ✅ | ✅ | ✅ | ✅ |
| Scrape List Members | ✅ | ✅ | ✅ | ✅ |
| Scrape Likes | ✅ | ✅ | ✅ | ✅ |
| UNFOLLOW | ||||
| Unfollow Non-Followers | ✅ | ✅ | ✅ | ✅ |
| Unfollow Everyone | ✅ | ✅ | ✅ | ✅ |
| Smart Unfollow (after X days) | ⚠️ | ✅ | ✅ | ✅ |
| Unfollow with Logging | ✅ | ✅ | ✅ | ✅ |
| FOLLOW | ||||
| Follow User | ✅ | ✅ | ✅ | ✅ |
| Keyword Follow | ⚠️ | ✅ | ✅ | ✅ |
| Follow Engagers | ⚠️ | ✅ | ✅ | ✅ |
| Follow Target's Followers | ⚠️ | ✅ | ✅ | ✅ |
| ENGAGEMENT | ||||
| Like Tweet | ✅ | ✅ | ✅ | ✅ |
| Retweet | ✅ | ✅ | ✅ | ✅ |
| Auto-Liker | ⚠️ | ✅ | ✅ | ✅ |
| Auto-Commenter | ⚠️ | ✅ | ✅ | ✅ |
| Post Tweet | ✅ | ✅ | ✅ | ✅ |
| MONITORING | ||||
| Detect Unfollowers | ✅ | ✅ | ✅ | ✅ |
| New Follower Alerts | ✅ | ✅ | ✅ | ✅ |
| Monitor Any Account | ✅ | ✅ | ✅ | ✅ |
| Continuous Monitoring | ⚠️ | ✅ | ✅ | ✅ |
| ADVANCED | ||||
| Multi-Account | ❌ | ✅ | ✅ | ✅ Pro |
| Link Scraper | ✅ | ✅ | ✅ | ✅ |
| Growth Suite | ❌ | ✅ | ✅ | ✅ Pro |
| Customer Service Bot | ❌ | ✅ | ✅ | ✅ Pro |
| MCP Server (AI Agents) | ❌ | ✅ | ✅ | ❌ |
| Export to CSV/JSON | ✅ | ✅ | ✅ | ✅ |
Legend: ✅ Full Support | ⚠️ Basic/Manual | ❌ Not Available
XActions includes an MCP (Model Context Protocol) server so AI agents like Claude can automate X/Twitter.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"xactions": {
"command": "node",
"args": ["/path/to/xactions/src/mcp/server.js"]
}
}
}
| Tool | Description |
|---|---|
x_login |
Login with session cookie |
x_get_profile |
Get user profile info |
x_get_followers |
Scrape followers |
x_get_following |
Scrape following |
x_get_non_followers |
Find non-followers |
x_get_tweets |
Scrape user's tweets |
x_search_tweets |
Search tweets by query |
x_follow |
Follow a user |
x_unfollow |
Unfollow a user |
x_post_tweet |
Post a tweet |
x_like |
Like a tweet |
x_retweet |
Retweet |
"Use XActions to find everyone I follow who doesn't follow me back"
# Authentication
xactions login # Set up session cookie
xactions logout # Remove saved auth
# Profile
xactions profile <user> # Get profile info
xactions profile elonmusk --json
# Scraping
xactions followers <user> [--limit 100] [--output file.json]
xactions following <user> [--limit 100] [--output file.csv]
xactions tweets <user> [--limit 50] [--replies]
xactions search <query> [--filter latest|top] [--limit 50]
xactions hashtag <tag> [--limit 50]
xactions thread <url>
xactions media <user> [--limit 50]
# Analysis
xactions non-followers <user> [--limit 500]
# Info
xactions info # Show version and links
xactions --help # Full help
import {
createBrowser,
createPage,
loginWithCookie,
scrapeProfile,
scrapeFollowers,
scrapeFollowing,
scrapeTweets,
searchTweets,
exportToJSON,
exportToCSV
} from 'xactions';
// Initialize
const browser = await createBrowser({ headless: true });
const page = await createPage(browser);
// Optional: Login for private data
await loginWithCookie(page, 'your_auth_token_cookie');
// Scrape profile
const profile = await scrapeProfile(page, 'elonmusk');
// Scrape followers with progress
const followers = await scrapeFollowers(page, 'elonmusk', {
limit: 1000,
onProgress: ({ scraped, limit }) => console.log(`${scraped}/${limit}`)
});
// Export data
await exportToJSON(followers, 'followers.json');
await exportToCSV(followers, 'followers.csv');
await browser.close();
// Profile
scrapeProfile(page, username)
// Followers & Following
scrapeFollowers(page, username, { limit, onProgress })
scrapeFollowing(page, username, { limit, onProgress })
// Tweets
scrapeTweets(page, username, { limit, includeReplies, onProgress })
searchTweets(page, query, { limit, filter: 'latest'|'top' })
scrapeThread(page, tweetUrl)
scrapeHashtag(page, hashtag, { limit, filter })
// Media
scrapeMedia(page, username, { limit })
scrapeLikes(page, tweetUrl, { limit })
// Lists
scrapeListMembers(page, listUrl, { limit })
// Export
exportToJSON(data, filename)
exportToCSV(data, filename)
Visit xactions.app for a no-code solution:
Free Tier: 50 actions/month
Pro Tier: Unlimited actions + multi-account
XActions includes built-in delays to avoid rate limits:
auth_token and copy the valuexactions/
├── src/
│ ├── index.js # Main entry point
│ ├── scrapers/ # All scraper functions
│ │ └── index.js # Scraper exports
│ ├── cli/ # Command-line interface
│ │ └── index.js # CLI commands
│ ├── mcp/ # MCP server for AI agents
│ │ └── server.js # MCP implementation
│ └── automation/ # Advanced automation
│ ├── autoLiker.js
│ ├── autoCommenter.js
│ ├── keywordFollow.js
│ └── ...
├── docs/ # Documentation
├── examples/ # Code examples
├── dashboard/ # Web UI
└── api/ # Backend API
Contributions welcome! See CONTRIBUTING.md.
# Clone
git clone https://github.com/nirholas/xactions.git
cd xactions
# Install
npm install
# Run CLI locally
npm run cli -- profile elonmusk
# Run MCP server
npm run mcp
MIT License - see LICENSE
Commercial use allowed. Attribution appreciated but not required.
nich (@nichxbt)
If XActions helped you, give it a star! It helps others find the project.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by lharries
Enables searching, reading, and sending personal WhatsApp messages and media through a Model Context Protocol (MCP) server, storing all data locally in SQLite and exposing controlled tools for LLMs like Claude.
by caol64
Automatically format Markdown articles and publish them to WeChat public accounts, supporting theme selection, image upload, and AI integration.
by korotovsky
Provides a powerful Model Context Protocol interface for Slack workspaces, enabling message retrieval, search, and optional posting via Stdio or SSE transports without requiring bot permissions.
by iFurySt
Provides authenticated access to XiaoHongShu (RedNote) notes, supporting keyword search, note retrieval by URL, and cookie persistence via a Model Context Protocol server.
by chigwell
Provides a full‑featured Telegram integration for MCP‑compatible clients, enabling programmatic access to chats, messages, contacts, profile management, and group administration.
by line
Integrates the LINE Messaging API with a Model Context Protocol server, enabling AI agents to send text, flex, broadcast messages, retrieve user profiles, and manage rich menus on a LINE Official Account.
by ZubeidHendricks
Provides a standardized interface for interacting with YouTube content, enabling video retrieval, transcript access, channel and playlist management, and advanced analytics through the Model Context Protocol.
by InditexTech
Provides Microsoft Teams integration via the Model Context Protocol, enabling reading, creating, replying to messages and mentioning members.
by EnesCinr
Interact with Twitter to post tweets and search tweets programmatically via an MCP server.