Twitter/X MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Twitter/X MCP Server
An MCP (Model Context Protocol) server that lets AI assistants interact with your Twitter/X account. No API key required - uses browser cookie authentication via twikit.
Read the blog post: I built an MCP server so Claude can use my Twitter account
Why?
Twitter's API free tier has been deprecated. The paid tiers start at $200/month. This MCP server bypasses that by using browser cookies to authenticate, giving you full access to your account through any MCP-compatible client (Claude Code, Claude Desktop, etc).
Related MCP server: agent-twitter-client-mcp
Tools
Tool | Description |
| Get your profile info |
| Get your home timeline |
| Get your recent tweets |
| Post a tweet (with optional reply) |
| Get a tweet with inline images and video keyframes |
| Delete a tweet by ID |
| Search recent tweets |
| Look up any user's profile |
| Get a user's recent tweets |
| Like a tweet |
| Unlike a tweet |
| Retweet a tweet |
| Follow a user |
| Unfollow a user |
| Get trending topics |
| Get your saved/bookmarked tweets |
| Get a bookmark with inline images and video keyframes |
| Bookmark a tweet |
| Remove a bookmark |
Setup
Prerequisites
Python 3.13+
ffmpeg (for video keyframe extraction)
A Twitter/X account
Cookie-Editor browser extension
1. Clone and install
git clone https://github.com/shubhank-saxena/twitter-account-mcp.git
cd twitter-account-mcp
uv sync2. Export your Twitter cookies
Install the Cookie-Editor extension in your browser
Log in to x.com
Click the Cookie-Editor icon
Click Export (copies JSON to clipboard)
Save the exported JSON as
cookies.jsonin the project root
3. Set your username
cp .env.example .envEdit .env and set your Twitter username:
TWITTER_USERNAME=your_username4. Add to your MCP client
Claude Code:
claude mcp add twitter -- uv run --directory /path/to/twitter-account-mcp python main.pyClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"twitter": {
"command": "uv",
"args": ["run", "--directory", "/path/to/twitter-account-mcp", "python", "main.py"]
}
}
}5. Verify
uv run python -c "
import asyncio, main
async def test():
r = await main.get_me()
print(f'Connected as @{r[\"username\"]}')
asyncio.run(test())
"Cookie Expiry
Browser cookies expire periodically. When you start seeing auth errors, re-export your cookies from Cookie-Editor and overwrite cookies.json.
Disclaimer
This project uses an unofficial method to access Twitter. It is not affiliated with or endorsed by Twitter/X. Use at your own risk - your account could potentially be restricted if Twitter detects unusual activity. Keep request rates reasonable.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Publish and schedule tweets and threads on X (Twitter) from your AI assistant.
Read public X (Twitter) data and verify follows, reposts, replies and quotes. 14 read-only tools.
Search X (Twitter) posts and read profiles, followers, trends and X Articles. OAuth sign-in.
X (Twitter) profiles and single tweets without login; full timelines with your own cookies.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceConnects AI assistants to Twitter/X using cookie-based authentication to read timelines, search tweets, and perform actions like posting and liking. It leverages Twitter's internal GraphQL API to provide full functionality without requiring a developer account.19 npm-
- AlicenseBqualityDmaintenanceEnables AI models to interact with Twitter, including posting tweets, searching, following users, and chatting with Grok, using cookie or credential authentication.141MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with X (Twitter) API v2 for posting tweets, searching, liking, retweeting, and more through natural language.MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with Twitter/X using session cookies. Supports posting, searching, managing tweets, viewing trends, and user profiles.-