MCP Twitter Server
inorilzy/mcp-twitter-server
Automação X/Twitter local com cookies — sem API paga, sem credenciais na nuvem
Ver no GitHubServidor Model Context Protocol para automação completa do Twitter/X, usando cliente web baseado em cookies via xkit-py. Permite agentes leitura, busca, publicação, engagement e operações de grafo social sem depender da API paga oficial.
Instalação
npx convez-ai inorilzy/mcp-twitter-server1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Agentes que buscam e analisam posts em tempo real
- Automação de publicação, resposta e engajamento em X/Twitter
- Monitoramento de tendências, hashtags e perfis de usuários
- Gerenciamento de DMs, listas e notificações programaticamente
Veredito

Solução robusta para integração X/Twitter em agentes Claude sem depender da API comercial. Requer exportação de cookies do navegador e assume responsabilidade do usuário sobre limites de taxa e mudanças na plataforma.
README
A tradução para o português deste README ainda está na fila.
MCP Twitter Server
A Model Context Protocol server for Twitter/X automation, search, timelines, social graph operations, lists, notifications, direct messages, analytics, and media downloads.
The server uses xkit-py, a maintained cookie-based Twitter/X web client that does not require the paid official API.
What it is for
- Let MCP-compatible agents search, read, and operate Twitter/X through local credentials.
- Keep Twitter/X cookies on the user's machine instead of sending them to a hosted service.
- Expose a broad tool surface while delegating low-level Twitter/X web API maintenance to
xkit-py.
It is not a password-login bot, hosted API proxy, or guarantee against Twitter/X rate limits and response changes.
Installation
{
"mcpServers": {
"twitter": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/inorilzy/mcp-twitter-server",
"mcp-twitter-server"
],
"env": {
"TWITTER_COOKIES_PATH": "/absolute/path/to/x-cookies.json"
}
}
}
}
Optional:
{
"USER_AGENT": "Mozilla/5.0 ...",
"TWITTER_COOKIES_JSON": "{\"cookies\":[...]}"
}
The server does not perform password login. Log in to x.com in a browser,
export cookies, and provide them through TWITTER_COOKIES_PATH or
TWITTER_COOKIES_JSON. The cookies must include auth_token and ct0.
By default, the server reads:
~/.mcp-twitter-server/cookies.json
Configuration
| Name | Required | Description |
|---|---|---|
TWITTER_COOKIES_PATH | Recommended | Absolute path to exported Twitter/X cookies JSON. |
TWITTER_COOKIES_JSON | Optional | Inline exported cookie JSON. Useful for temporary local runs. |
USER_AGENT | Optional | Browser-like user agent override. |
Cookies must include auth_token and ct0.
Tools
Read
search_twitter- search posts by query, sorted by Top or Latestget_user_tweets- fetch posts from a user timelineget_user_mentions- find posts mentioning a userget_timeline- read the For You timelineget_latest_timeline- read the Following timelineget_tweet_replies- fetch replies for a postget_full_thread- reconstruct a thread around a postget_conversation_tree- render nested repliesget_similar_tweets- fetch similar postsget_user_highlights- read user highlightsget_bookmarks- read bookmarked posts
Write
post_tweet- publish a post, optionally with media, reply target, or mentionsdelete_tweet- delete a postcreate_poll_tweet- publish a pollvote_on_poll- vote on a polldownload_tweet_media- download images or videos from a post
Engagement
like_tweet/unlike_tweetretweet/unretweetbookmark_tweet/delete_bookmark
Social Graph
follow_user/unfollow_userblock_user/unblock_usermute_user/unmute_userget_user_profileget_user_followersget_user_followingget_user_verified_followerssearch_usersbulk_user_lookupget_retweetersget_favoriters
Discovery
get_trendstrack_hashtaganalyze_user_engagement
Lists
create_listget_my_listsget_list_tweetsget_list_membersadd_user_to_listremove_user_from_list
Notifications
get_notifications
Direct Messages
send_dmdelete_dmget_dm_historyadd_dm_reactionremove_dm_reaction
Streaming
stream_tweet_engagement
Local Development
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .
mcp-twitter-server
Required cookie configuration:
$env:TWITTER_COOKIES_PATH='C:\path\to\x-cookies.json'
Alternatively:
$env:TWITTER_COOKIES_JSON='<exported-cookie-json>'
Security Notes
- Cookies are equivalent to account credentials. Store them outside the repository.
- Do not paste cookie JSON into public issues, logs, or screenshots.
- Prefer
TWITTER_COOKIES_PATHover inline JSON for long-running setups. - Write tools can publish, delete, like, follow, block, and send DMs. Give agent access only when you intend to allow those actions.
Troubleshooting
The server starts but tools fail authentication
Re-export cookies after logging in to x.com. Make sure the exported cookies include both auth_token and ct0.
Search or timeline tools suddenly fail
Twitter/X frequently changes private web API shapes and rate limits. Update this server and xkit-py, then retry with a fresh cookie export.
My MCP client cannot find the command
Check that uvx is installed and available in the same environment used by the MCP client. For local development, install with pip install -e . and use mcp-twitter-server.
Notes
Twitter/X frequently changes private web API response shapes. This server keeps
MCP-facing behavior defensive and delegates low-level protocol maintenance to
xkit-py.