XActions — Claude Code MCP server: what it does, how to install
This MCP server lets an AI agent scrape, post, schedule, analyze, and engage on X/Twitter. No API key is required.
claude mcp add --env X_COOKIES=<X_COOKIES> --env X_USERNAME=<X_USERNAME> --env X_PASSWORD=<X_PASSWORD> --transport stdio xactions -- npx -y xactionsWhat XActions does
XActions gives an AI agent access to X/Twitter operations such as profile and post data collection, search, publishing, scheduling, and activity analysis. The project also includes a CLI and browser scripts, while this entry covers its MCP server connection.
The server runs through npx -y xactions. Setup uses environment variables such as X_COOKIES, X_USERNAME, and X_PASSWORD; the Claude Code command can use X_COOKIES and X_PASSWORD alone. An X API key is not required. Login unlocks search, follower data, and direct messages.
XActions lists support for Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, and Zed. Account access depends on the credentials supplied in the MCP configuration, so keep them outside prompts and project files.
What it helps with
- collect data from an X/Twitter profile
- find posts and mentions for a search term
- draft a post for X/Twitter
- schedule a publication
- analyze account activity
Example prompts for the agent
- Collect the main details for the X/Twitter profile
nasa. - Search X/Twitter for posts about “your brand” and group the recurring mentions.
- Draft an X/Twitter post, then schedule it after I approve the text.
How to install XActions
Platform CLI
claude mcp add --env X_COOKIES=<X_COOKIES> --env X_USERNAME=<X_USERNAME> --env X_PASSWORD=<X_PASSWORD> --transport stdio xactions -- npx -y xactionsReplace <…> with your own values
Platform CLI
codex mcp add xactions --env X_COOKIES=<X_COOKIES> --env X_USERNAME=<X_USERNAME> --env X_PASSWORD=<X_PASSWORD> -- npx -y xactionsReplace <…> with your own values
Config file
{
"mcpServers": {
"xactions": {
"command": "npx",
"args": [
"-y",
"xactions"
],
"env": {
"X_COOKIES": "<X_COOKIES>",
"X_USERNAME": "<X_USERNAME>",
"X_PASSWORD": "<X_PASSWORD>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"xactions": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"xactions"
],
"env": {
"X_COOKIES": "<X_COOKIES>",
"X_USERNAME": "<X_USERNAME>",
"X_PASSWORD": "<X_PASSWORD>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e X_COOKIES=<X_COOKIES> -e X_USERNAME=<X_USERNAME> -e X_PASSWORD=<X_PASSWORD> xactions npx -y xactionsReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about XActions
How do I install XActions in Claude Code?
Run claude mcp add xactions -e X_COOKIES=<X_COOKIES> -e X_PASSWORD=<X_PASSWORD> -- npx -y xactions. The MCP server will then be available in Claude Code.
What does XActions do?
It connects an AI agent to X/Twitter tasks such as data collection, search, posting, scheduling, and activity analysis.
Does XActions require an API key?
No X API key is required. The setup uses X_COOKIES, X_USERNAME, and X_PASSWORD for account access, and login unlocks some features.