twikit-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@twikit-mcpsearch tweets about AI"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
twikit-x-mcp
An MCP (Model Context Protocol) server that lets an AI assistant — Claude Desktop, Claude Code, Cursor, or any MCP client — read and act on Twitter / X through a single authenticated session. No official X API key required.
Built on twikit
All the real work — the actual Twitter/X client — is twikit by d60. Full credit and rights to the original library belong to its author. This project is only a thin MCP wrapper around it. ⭐ Please star the original repo.
It exposes twikit's capabilities as clean, model-friendly MCP tools.
⚠️ This repo bundles a lightly patched copy of twikit (under
twikit/, MIT — seelicenses/twikit-LICENSE.txt), because the published twikit is currently broken on X (theCouldn't get KEY_BYTE indiceslogin bug). The patch only fixes login. When upstream ships a fix, the bundled copy can be dropped in favour of the PyPItwikitpackage.
Full reference: Documentation · Setup: INSTALL.md · Changelog: CHANGELOG.md · Versioning & releases: docs/RELEASES.md
Related MCP server: X(Twitter) V2 MCP Server
Features
27 tools covering users, tweets (read + write), timelines, trends and DMs.
No X API key — authenticates as a normal account via cookies or login.
Built-in rate limiting, on by default, to help avoid suspension (configurable).
One-line run with
uvx(no manual install), orpip.
Area | Tools |
Session |
|
Users |
|
Tweets (read) |
|
Tweets (write) |
|
Trends |
|
Direct messages |
|
Paginating tools return { "items": [...], "count": N, "next_cursor": "..." };
pass next_cursor back in to page.
Tool annotations
Per the MCP annotations spec — side effects at a glance. Write tools act on your real account.
Tools | Read-only | Idempotent | Destructive |
| ✓ | ✓ | – |
| – | ✓ | – |
| – | – | – |
| – | ✓ | ✓ |
Install
Install and run with uvx:
uvx twikit-x-mcpNote: the Python import module is
twikit_x_mcp(underscore), per Python convention. The distribution is self-contained — twikit is bundled in, so there are no external Git dependencies to resolve.
Connect your MCP client
Per-client, copy-paste setup for Claude Code, Claude Desktop, Cursor, Windsurf, VS Code and more is in INSTALL.md.
Using a client that isn't documented there? Point its AI at llms-install.md — a machine-readable install spec an agent can follow to wire this server into any MCP client.
Authenticate
X's automated login regularly trips a Cloudflare / "verify you're human"
challenge, so the reliable way to authenticate is to copy two cookies from a
browser where you're already logged in to x.com: auth_token and ct0.
1. Grab the cookies
Log in to https://x.com in your browser.
Open DevTools → Application (Chrome/Edge) or Storage (Firefox) → Cookies →
https://x.com.Copy the Value of
auth_tokenand ofct0.
2. Set them as environment variables
Variable | Required | Notes |
| ✅ | the |
| ✅ | the |
| default | |
| e.g. |
🔐 Treat these like a password — they grant access to your account. Don't commit them anywhere. They rotate when you log out of that browser session, so refresh them if requests start failing.
See INSTALL.md for exactly where these go in each client's config.
Rate limiting
To reduce the risk of rate-limit errors or account suspension, the server throttles tool calls by default (token bucket, 30 calls/minute).
Variable | Default | Notes |
|
| Set to |
|
| Max tool calls per minute |
Call the rate_limit_status tool to see the active configuration.
Run manually
python -m twikit_x_mcp # or: twikit-x-mcpYou normally won't run it by hand — your MCP client launches it. See INSTALL.md for client setup.
Troubleshooting
Symptom | Likely cause / fix |
| The published twikit's login bug — this repo bundles a patched copy under |
Auth errors / |
|
Frequent rate-limit errors | Throttling is on by default (30/min). Check |
A "verify you're human" / Cloudflare challenge | Use the cookie method (above) rather than username/password login. |
Server not found by the client | Verify the |
Responsible use
Automating X may violate its Terms of Service and can get accounts rate-limited or suspended. Use a purpose-made account, keep volume low, and respect twikit's rate-limit notes. Don't use this for spam, harassment, or mass automation.
Contributing
Contributions welcome! This project uses Conventional Commits for commits, PR titles and issue titles — see CONTRIBUTING.md.
Security & conduct: SECURITY.md · Code of Conduct
Credits
twikit by d60 — the underlying X client that does all the heavy lifting (MIT). A patched copy is bundled here under
twikit/; its license is preserved atlicenses/twikit-LICENSE.txt. ⭐ Please star the original repo.This project (
twikit-x-mcp) is MIT-licensed. SeeLICENSE.
Disclaimer
This is an unofficial project. It is not affiliated with, authorized, maintained, sponsored, or endorsed by X Corp. (Twitter).
It authenticates as your own account using session cookies and drives X through twikit — an unofficial client — so a tool can break when X changes its site. Automating X may violate its Terms of Service and can get accounts rate-limited or suspended.
You are responsible for using this software in compliance with X's Terms of Service and applicable law. Use a purpose-made account, keep volume low, and don't use it for spam, harassment, or mass automation. All product names, logos, and brands are property of their respective owners.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityFmaintenanceAn MCP server that provides AI agents with full access to the X (Twitter) API for posting, searching, and managing engagement through natural language. It supports comprehensive tools for tweet management, media uploads, and account analytics across multiple MCP-compatible clients.Last updated1550
- Alicense-qualityDmaintenanceAn MCP server for interacting with the Twitter/X API v2, enabling AI assistants to retrieve tweets, post content, reply, quote, and more programmatically.Last updated1,96713MIT
- Alicense-qualityDmaintenanceAn MCP server that enables AI agents to automate actions on X (Twitter) through a real browser session, including posting, engaging, and reading via over 40 tools. It supports self-hosting and provides a panel for API key management.Last updated166MIT

X API FastMCP Serverofficial
Flicense-qualityFmaintenanceA local MCP server that exposes the X API (formerly Twitter API) as tools, enabling operations like posting, searching, user management, and more via natural language commands.Last updated833
Related MCP Connectors
Hosted MCP for X/Twitter and Reddit. 12 read-only tools, no API keys, free during beta.
Hosted MCP with 91 agent tools: X, domains, SEO, Maps, Trends, Search, YouTube, TikTok, and more.
X (formerly Twitter) posts, profiles, and search for AI agents. Free key, self-minted, no signup.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bintangtimurlangit/twikit-x-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server