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-mcp
Twitter/X MCP Server — No API Key Required
An MCP server that lets Claude (or any MCP-compatible AI agent) interact with Twitter/X using browser cookies. No Twitter API key needed. Free forever.
English
Why twikit-mcp?
twikit-mcp (this project) | Other Twitter MCP servers | |
Auth | Browser cookies | Twitter API Key |
Cost | Free | $200+/month |
Setup | 2 steps, 2 minutes | Apply for developer account, wait for approval |
API | twikit (reverse-engineered) | X API (official, paid) |
Quick Start
1. Create cookies.json
Log in to x.com in your browser
Open DevTools (F12) → Application → Cookies →
https://x.comCopy
ct0andauth_token
mkdir -p ~/.config/twitter-mcp
cat > ~/.config/twitter-mcp/cookies.json << 'EOF'
{"ct0": "YOUR_CT0", "auth_token": "YOUR_AUTH_TOKEN"}
EOF
chmod 600 ~/.config/twitter-mcp/cookies.jsonWhat are these?
ct0is the CSRF token (~160 hex chars),auth_tokenis your session token (40 hex chars). They are found in your browser cookies after logging in to x.com. Cookies expire —auth_tokentypically lasts several months,ct0may be shorter. Re-extract from your browser when expired.
2. Install & register
Choose one of the following methods:
Option A: uvx — zero-install, fetches each call (slow first run, fast after; cache shared with other uv tools). Best for quick try-out.
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- uvx twikit-mcp
# Or run directly
uvx twikit-mcpOption B: uv tool install (recommended for daily use) — pinned isolated venv, instant startup, simple upgrade path.
# Install once. Drops a `twikit-mcp` binary on PATH (~/.local/bin).
uv tool install twikit-mcp
# List your installed uv tools (sanity check)
uv tool list
# Upgrade when a new version ships
uv tool upgrade twikit-mcp
# Or upgrade ALL uv-tool-managed binaries at once:
uv tool upgrade --all
# Uninstall (clean removal of the venv + binary)
uv tool uninstall twikit-mcpThen register with Claude Code (uses the binary on PATH — no uvx prefix):
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcpThe cookies file is the same as for every other option: ~/.config/twitter-mcp/cookies.json (or wherever TWITTER_COOKIES env var points). uv tool install doesn't change where config lives — only where the binary lives.
uvx vs
uv tool installquick rule: use uvx if you'll call it once or twice (e.g. one-off script). Useuv tool installif it's part of your dev workflow (e.g. wired into Claude Code daily) — startup is instant after the one-time install.
Option C: pip
pip install twikit-mcp
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcp
# Or run directly
TWITTER_COOKIES=~/.config/twitter-mcp/cookies.json twikit-mcpOption D: pipx (isolated install — same idea as uv tool install, but with pipx)
pipx install twikit-mcp
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcpUsing with other MCP clients
This is a standard MCP server (stdio transport). It works with any MCP-compatible client — not just Claude Code.
Add to your MCP client config (e.g. mcp.json, settings.json):
{
"mcpServers": {
"twitter": {
"command": "twikit-mcp",
"env": {
"TWITTER_COOKIES": "/home/YOU/.config/twitter-mcp/cookies.json"
}
}
}
}Works with: Claude Code, Claude Desktop, Cursor, Windsurf, opencode, Cline, etc.
That's it. Start talking:
> Search tweets about AI
> What did @elonmusk post recently?
> Send a tweet saying: Hello from Claude!CLI mode (no MCP client needed)
The same twikit-mcp binary doubles as a one-shot CLI. Two modes:
Human-friendly subcommands — pretty-print tweets, profiles, timeline directly:
twikit-mcp tweet 20 # show tweet 20 (Jack's first one)
twikit-mcp tweet https://x.com/u/status/123 # URL works too
twikit-mcp user elonmusk # pretty profile
twikit-mcp tl 10 # last 10 tweets from your home timeline
twikit-mcp search "AI" 5 # 5 top results for "AI"
twikit-mcp trends 20 # top 20 trending topicsOutput is plain text — readable in any terminal, native unicode (no \uXXXX escapes).
Machine-friendly subcommands — raw JSON, key=value args, every one of the 57 MCP tools:
twikit-mcp list # all 57 tool names
twikit-mcp call get_user_info screen_name=elonmusk
twikit-mcp call search_tweets query=AI count=5 product=Top
twikit-mcp call get_user_info screen_name=elonmusk | jq .followers_countMCP server mode — the default when no subcommand is given:
twikit-mcp # stdio JSON-RPC for MCP clients
twikit-mcp serve # explicit, same behaviorAll three modes share the same ~/.config/twitter-mcp/cookies.json — no separate config.
Available Tools
Tool | Description |
| Post a tweet or reply |
| Fetch a tweet by ID or URL |
| Get home timeline |
| Search tweets (Latest/Top) |
| Like a tweet |
| Retweet a tweet |
| Get a user's profile metadata by |
| Get tweets from a specific user |
| List a user's followers (paginated via |
| List who a user follows (paginated via |
| Follow a user by screen name |
| Unfollow a user by screen name |
| Delete a tweet by ID |
| Unlike a tweet by ID |
| Un-retweet a tweet by ID |
| Bookmark a tweet (optional |
| Remove a tweet from bookmarks |
| List bookmarked tweets (paginated via |
| List users who liked a tweet (paginated via |
| List users who retweeted a tweet (paginated via |
| Search for users by query (paginated via |
| Get trending topics by category ( |
| Get title / preview / cover of an X Article embedded in a tweet (no auth) |
| Fetch an X Article's body — |
| Block a user by screen name (rate-limited — avoid bulk) |
| Unblock a user by screen name |
| Mute a user by screen name (rate-limited — avoid bulk) |
| Unmute a user by screen name |
| Fetch notifications — |
| ⚠️ Send a PRIVATE DM to a user — do not bulk-call |
| ⚠️ Send a PRIVATE DM to a group conversation — do not bulk-call |
| ⚠️ Get DM conversation history with a user (private — paginate via |
| ⚠️ Delete a DM by message ID (private) |
| Get a Twitter List by ID |
| Get authenticated user's Lists (paginated via |
| Get tweets from a List (paginated via |
| Get members of a List (paginated via |
| Get subscribers of a List (paginated via |
| Create a new Twitter List ( |
| Edit a List's metadata — at least one of |
| Add a user to a List by |
| Remove a user from a List by |
| Schedule a tweet at a future Unix timestamp ( |
| Get all scheduled tweets for the authenticated user |
| Delete a scheduled tweet by its |
| Create an X poll card (2-4 |
| Vote on a poll — requires |
| Get a Twitter Community by ID |
| Search for Communities by query (paginated via |
| Get tweets from a Community — |
| Get the joined-communities feed (paginated via |
| Get members of a Community (paginated via |
| Get moderators of a Community (paginated via |
| Search tweets within a Community by query (paginated via |
| Join a Community by ID |
| Leave a Community by ID |
| Request to join a Community — optional |
X Articles note: long-form posts at
https://x.com/i/article/<id>live in a different ID namespace than tweets.get_tweetrefuses them with a clear error pointing toget_article.get_article_previewworks without auth via the public syndication endpoint.get_articleruns a two-hop reader flow internally:ArticleRedirectScreenQueryresolves the article rest_id to the underlying tweet rest_id, thenTweetResultByRestIdfetches the tweet's article body. Theformatarg controls how much of the response makes it through to the LLM:
"preview"(~1 KB) —rest_id,title,preview_text,cover_image. Card-display use case.
"plain"(~20 KB, default) — addsplain_text, flatmediaURL list,lifecycle_state. The 80% LLM-reading-an-article case; fits inside Claude Code'sMAX_MCP_OUTPUT_TOKENS.
"full"(~150 KB+) — raw GraphQL payload including the heavycontent_stateblock tree. Only ask for this if you actually need rich-content rendering / archiving / structure analysis.Both queryIds are hardcoded like the 80+ other twikit endpoints; if X rotates them, refresh from the public
bundle.Articles.*.js/bundle.TwitterArticles.*.jschunks onabs.twimg.com(no auth needed for discovery).
Check version
twikit-mcp --version
# or: twikit-mcp -v
# or: python -m twitter_mcp.server --versionHow It Works
You: "Search tweets about AI"
→ Claude Code (understands intent)
→ MCP Protocol (JSON-RPC over stdio)
→ twikit-mcp (this server)
→ twikit (browser-like requests)
→ Twitter GraphQL APIClaude Code automatically manages the server process — it starts when Claude Code launches and stops when it exits. No background services, no manual setup.
Windows
mkdir %APPDATA%\twitter-mcp
# Create cookies.json with your ct0 and auth_token
# uvx
claude mcp add twitter -s user ^
-e "TWITTER_COOKIES=%APPDATA%\twitter-mcp\cookies.json" ^
-- uvx twikit-mcp
# Or with pip
pip install twikit-mcp
claude mcp add twitter -s user ^
-e "TWITTER_COOKIES=%APPDATA%\twitter-mcp\cookies.json" ^
-- twikit-mcpDocumentation
Technical Guide — Architecture, MCP internals, configuration details
Contributing — Testing, CI/CD, how to add new tools
中文
为什么选 twikit-mcp?
twikit-mcp(本项目) | 其他 Twitter MCP | |
认证 | 浏览器 Cookies | Twitter API Key |
费用 | 免费 | $200+/月 |
配置 | 2 步,2 分钟 | 申请开发者账号,等审批 |
API | twikit(逆向工程) | X API(官方,付费) |
快速开始
1. 创建 cookies.json
用浏览器登录 x.com
F12 打开 DevTools → Application → Cookies →
https://x.com复制
ct0和auth_token
mkdir -p ~/.config/twitter-mcp
cat > ~/.config/twitter-mcp/cookies.json << 'EOF'
{"ct0": "你的ct0", "auth_token": "你的auth_token"}
EOF
chmod 600 ~/.config/twitter-mcp/cookies.json这两个值是什么?
ct0是 CSRF token(约160位十六进制),auth_token是会话 token(40位十六进制),都在浏览器 Cookies 中。Cookies 会过期——auth_token通常有效数月,ct0可能更短。过期后从浏览器重新提取即可。
2. 安装 & 注册
选择以下 任一 方式:
方式 A: uvx — 零安装,每次调用拉一份。第一次慢,之后用 cache,跟其他 uv 工具共享。适合临时试用。
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- uvx twikit-mcp
# 或直接运行
uvx twikit-mcp方式 B: uv tool install (日常使用推荐) — 隔离 venv,启动瞬间,升级简单。
# 一次性安装,在 PATH 上注册一个 `twikit-mcp` 二进制(默认路径 ~/.local/bin)
uv tool install twikit-mcp
# 列出当前 uv 管理的工具(确认装上了)
uv tool list
# 有新版本时升级
uv tool upgrade twikit-mcp
# 或一键升级所有 uv 装的工具:
uv tool upgrade --all
# 卸载(连 venv 一起清掉)
uv tool uninstall twikit-mcp然后用 PATH 上的二进制注册到 Claude Code(不要再加 uvx 前缀):
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcpcookies 文件位置不变 — 仍然是 ~/.config/twitter-mcp/cookies.json(或者 TWITTER_COOKIES 环境变量指的地方)。uv tool install 只改变二进制的安装位置,不改 config 路径。
uvx vs
uv tool install的简单选择: 一次性 / 偶尔用 → uvx;天天接到 Claude Code 里用 →uv tool install(启动快很多)。
方式 C: pip
pip install twikit-mcp
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcp
# 或直接运行
TWITTER_COOKIES=~/.config/twitter-mcp/cookies.json twikit-mcp方式 D: pipx(隔离安装,跟 uv tool install 思路一样,但换工具)
pipx install twikit-mcp
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcp在其他 MCP 客户端中使用
这是标准的 MCP server(stdio 传输),不限于 Claude Code,任何支持 MCP 的客户端都能用。
在你的 MCP 客户端配置中添加(如 mcp.json、settings.json):
{
"mcpServers": {
"twitter": {
"command": "twikit-mcp",
"env": {
"TWITTER_COOKIES": "/home/你的用户名/.config/twitter-mcp/cookies.json"
}
}
}
}兼容:Claude Code、Claude Desktop、Cursor、Windsurf、opencode、Cline 等。
搞定。直接说人话:
> 搜一下关于 AI 的推文
> 看看 @elonmusk 最近发了什么
> 发一条推说:Hello from Claude!可用工具
工具 | 功能 | 怎么用 |
| 发推/回复 | "发一条推说..." |
| 获取推文 | "看看这条推文 [链接]" |
| 刷时间线 | "看看我的时间线" |
| 搜索推文 | "搜一下关于 XX 的推文" |
| 点赞 | "点赞这条推" |
| 转推 | "转推这个" |
| 查看用户资料( | "查一下 @xxx 的资料" |
| 看某人的推 | "看看 @xxx 最近发了什么" |
| 拉某人的粉丝列表( | "看看 @xxx 的粉丝" |
| 拉某人关注的人( | "@xxx 都关注谁?" |
| 关注用户 | "关注 @xxx" |
| 取消关注 | "取关 @xxx" |
| 删除推文 | "删除这条推文" |
| 取消点赞 | "取消对这条推的点赞" |
| 取消转推 | "取消转推这条" |
| 收藏推文(可选 | "收藏这条推文" |
| 取消收藏推文 | "取消收藏这条推文" |
| 获取收藏列表( | "看看我的收藏" |
| 获取点赞某推文的用户( | "谁点赞了这条推?" |
| 获取转推某推文的用户( | "谁转推了这条?" |
| 搜索用户( | "搜一下叫 xxx 的用户" |
| 获取热门话题(分类: | "现在有哪些热门话题?" |
| 拿 X Article 的标题/摘要/封面(无需登录) | "这篇文章在讲什么 [链接]" |
| 拿 X Article 的正文, | "把这篇文章读给我听 [链接]" |
| 屏蔽用户(受频率限制,避免批量操作) | "屏蔽 @xxx" |
| 取消屏蔽用户 | "取消屏蔽 @xxx" |
| 静音用户(受频率限制,避免批量操作) | "静音 @xxx" |
| 取消静音用户 | "取消静音 @xxx" |
| 获取通知( | "看看我的通知" |
| ⚠️ 发送私信给用户,勿批量调用 | "私信 @xxx:..." |
| ⚠️ 发送私信到群组,勿批量调用 | "发消息到群组..." |
| ⚠️ 获取与某用户的私信记录(私密,通过 | "看看和 @xxx 的私信记录" |
| ⚠️ 删除某条私信(私密) | "删除这条私信" |
| 通过 ID 获取 Twitter 列表 | "查看列表 xxx" |
| 获取当前用户的所有列表( | "我有哪些列表?" |
| 获取列表中的推文( | "查看列表推文" |
| 获取列表成员( | "列表成员有哪些?" |
| 获取列表订阅者( | "谁订阅了这个列表?" |
| 创建新列表( | "新建列表 xxx" |
| 编辑列表信息( | "重命名列表" |
| 将用户加入列表( | "把 @xxx 加入列表" |
| 将用户从列表移除( | "从列表移除 @xxx" |
| 定时发推( | "明天发推" |
| 获取当前用户的所有定时推文 | "有哪些定时推?" |
| 删除定时推文(需提供 | "取消定时推" |
| 创建投票(2-4 个选项, | "发起投票" |
| 对投票投票(需提供 | "给这个选项投票" |
| 通过 ID 获取 Twitter 社区 | "查看社区 xxx" |
| 搜索社区( | "搜索 Python 社区" |
| 获取社区推文( | "看看社区最新推文" |
| 获取已加入社区的时间线( | "看看社区动态" |
| 获取社区成员( | "社区有哪些成员?" |
| 获取社区版主( | "社区版主是谁?" |
| 在社区内搜索推文( | "在社区里搜 xxx" |
| 加入社区 | "加入这个社区" |
| 退出社区 | "退出这个社区" |
| 申请加入社区(受限社区可选 | "申请加入这个社区" |
X Articles 说明:
https://x.com/i/article/<id>这种长文与普通推文是两个 ID 命名空间。get_tweet遇到 article URL 会直接拒绝并提示用get_article。get_article_preview走公共 syndication 端点,不需要登录。get_article内部是两跳 reader 流程,通过format参数控制返回大小:
"preview"(~1 KB) —rest_id/title/preview_text/cover_image,卡片场景
"plain"(~20 KB,默认) — 上面 +plain_text+ 扁平化mediaURL 列表 +lifecycle_state,LLM 读全文的 80% 场景,刚好放得下 Claude Code 的MAX_MCP_OUTPUT_TOKENS
"full"(~150 KB+) — 原始 GraphQL 响应,含庞大的content_state富文本块树,只在做富文本渲染/归档/结构分析时才需要两个 queryId 都跟其他 80+ 端点一样硬编码 — 如果 X 改了 hash,从公开的
bundle.Articles.*.js/bundle.TwitterArticles.*.jschunk 里 grep 出新值即可,无需登录态。
查看版本
twikit-mcp --version
# 或:twikit-mcp -v
# 或:python -m twitter_mcp.server --version工作原理
你:"搜一下关于 AI 的推文"
→ Claude Code(理解意图)
→ MCP 协议(JSON-RPC,stdio 通信)
→ twikit-mcp(本 server)
→ twikit(模拟浏览器请求)
→ Twitter GraphQL APIClaude Code 自动管理 server 进程——启动时拉起,退出时关闭。不需要手动运行任何东西,不占后台资源。
Windows
mkdir %APPDATA%\twitter-mcp
# 创建 cookies.json,写入 ct0 和 auth_token
# uvx
claude mcp add twitter -s user ^
-e "TWITTER_COOKIES=%APPDATA%\twitter-mcp\cookies.json" ^
-- uvx twikit-mcp
# 或使用 pip
pip install twikit-mcp
claude mcp add twitter -s user ^
-e "TWITTER_COOKIES=%APPDATA%\twitter-mcp\cookies.json" ^
-- twikit-mcp文档
日本語
なぜ twikit-mcp?
twikit-mcp(本プロジェクト) | 他の Twitter MCP | |
認証 | ブラウザ Cookie | Twitter API Key |
料金 | 無料 | $200+/月 |
セットアップ | 2ステップ、2分 | 開発者アカウント申請、承認待ち |
API | twikit(リバースエンジニアリング) | X API(公式、有料) |
クイックスタート
1. cookies.json の作成
ブラウザで x.com にログイン
F12 で DevTools を開く → Application → Cookies →
https://x.comct0とauth_tokenをコピー
mkdir -p ~/.config/twitter-mcp
cat > ~/.config/twitter-mcp/cookies.json << 'EOF'
{"ct0": "あなたのct0", "auth_token": "あなたのauth_token"}
EOF
chmod 600 ~/.config/twitter-mcp/cookies.jsonこれは何?
ct0は CSRF トークン(約160桁の16進数)、auth_tokenはセッショントークン(40桁の16進数)で、ブラウザの Cookie から取得します。Cookie は有効期限があります —auth_tokenは通常数ヶ月、ct0はより短い場合があります。期限切れの際はブラウザから再取得してください。
2. インストール & 登録
以下の いずれか の方法を選んでください:
方法 A: uvx — ゼロインストール、毎回フェッチ。初回のみ遅い、以降はキャッシュで高速。お試し向け。
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- uvx twikit-mcp
# または直接実行
uvx twikit-mcp方法 B: uv tool install(日常利用に推奨)— 専用 venv で隔離インストール、起動が瞬時、アップグレードも簡単。
# 一度だけインストール。PATH (~/.local/bin) に `twikit-mcp` バイナリを配置
uv tool install twikit-mcp
# uv tool 管理下のツール一覧(確認用)
uv tool list
# 新バージョンが出たらアップグレード
uv tool upgrade twikit-mcp
# uv で入れた全ツールを一括アップグレード:
uv tool upgrade --all
# アンインストール(venv ごと削除)
uv tool uninstall twikit-mcpPATH 上のバイナリで Claude Code に登録(uvx プレフィックス不要):
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcpcookies ファイルの場所は他のオプションと同じ — ~/.config/twitter-mcp/cookies.json (もしくは TWITTER_COOKIES 環境変数)。uv tool install が変えるのはバイナリの場所だけで、設定ファイルの場所は変わりません。
uvx と
uv tool installの使い分け: 一回だけ / たまに → uvx;Claude Code に組み込んで毎日使う →uv tool install(起動が圧倒的に速い)。
方法 C: pip
pip install twikit-mcp
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcp
# または直接実行
TWITTER_COOKIES=~/.config/twitter-mcp/cookies.json twikit-mcp方法 D: pipx(隔離インストール — uv tool install と同じ思想、ツール違い)
pipx install twikit-mcp
# Claude Code
claude mcp add twitter -s user \
-e "TWITTER_COOKIES=$HOME/.config/twitter-mcp/cookies.json" \
-- twikit-mcp他の MCP クライアントでの使用
これは標準的な MCP サーバー(stdio トランスポート)です。Claude Code 専用ではなく、MCP 対応のすべてのクライアントで使用できます。
MCP クライアントの設定ファイル(mcp.json、settings.json など)に追加:
{
"mcpServers": {
"twitter": {
"command": "twikit-mcp",
"env": {
"TWITTER_COOKIES": "/home/ユーザー名/.config/twitter-mcp/cookies.json"
}
}
}
}対応クライアント:Claude Code、Claude Desktop、Cursor、Windsurf、opencode、Cline など。
以上です。自然言語で話しかけてください:
> AIに関するツイートを検索して
> @elonmusk の最近の投稿を見せて
> 「Hello from Claude!」とツイートして利用可能なツール
ツール | 機能 | 使い方 |
| ツイート投稿・返信 | 「〜とツイートして」 |
| ツイート取得 | 「このツイートを見て [URL]」 |
| タイムライン取得 | 「タイムラインを見せて」 |
| ツイート検索 | 「〜について検索して」 |
| いいね | 「このツイートにいいねして」 |
| リツイート | 「これをリツイートして」 |
| ユーザープロフィール取得( | 「@xxx のプロフィールを見せて」 |
| ユーザーのツイート取得 | 「@xxx の最近の投稿を見せて」 |
| フォロワー一覧取得( | 「@xxx のフォロワーを見せて」 |
| フォロー中の一覧取得( | 「@xxx は誰をフォローしてる?」 |
| ユーザーをフォロー | 「@xxx をフォロー」 |
| フォロー解除 | 「@xxx をフォロー解除」 |
| ツイート削除 | 「このツイートを削除して」 |
| いいね取り消し | 「このツイートのいいねを取り消して」 |
| リツイート取り消し | 「このリツイートを取り消して」 |
| ブックマーク追加( | 「このツイートをブックマークして」 |
| ブックマーク削除 | 「このブックマークを削除して」 |
| ブックマーク一覧取得( | 「ブックマークを見せて」 |
| ツイートにいいねしたユーザー一覧( | 「このツイートにいいねした人は?」 |
| ツイートをリツイートしたユーザー一覧( | 「誰がリツイートした?」 |
| ユーザー検索( | 「〜というユーザーを検索して」 |
| トレンド取得(カテゴリ: | 「今のトレンドを見せて」 |
| X Article のタイトル/プレビュー/カバー画像取得(認証不要) | 「この記事の概要を教えて [URL]」 |
| X Article の本文取得、 | 「この記事を読んで [URL]」 |
| ユーザーをブロック(レート制限あり — 一括使用禁止) | 「@xxx をブロック」 |
| ユーザーのブロックを解除 | 「@xxx のブロックを解除」 |
| ユーザーをミュート(レート制限あり — 一括使用禁止) | 「@xxx をミュート」 |
| ユーザーのミュートを解除 | 「@xxx のミュートを解除」 |
| 通知取得( | 「通知を見せて」 |
| ⚠️ ユーザーにダイレクトメッセージを送信 — 一括送信禁止 | 「@xxx にDMして:...」 |
| ⚠️ グループにダイレクトメッセージを送信 — 一括送信禁止 | 「グループにメッセージ送信...」 |
| ⚠️ ユーザーとの DM 履歴取得(プライベート、 | 「@xxx との DM 履歴を見せて」 |
| ⚠️ DM を削除(プライベート) | 「この DM を削除して」 |
| ID でリストを取得 | 「リスト xxx を見せて」 |
| 自分のリスト一覧取得( | 「自分のリストは?」 |
| リストのツイート取得( | 「リストのツイートを見せて」 |
| リストのメンバー取得( | 「リストのメンバーは?」 |
| リストの購読者取得( | 「誰がリストを購読している?」 |
| リストを作成( | 「リスト xxx を作成して」 |
| リスト情報を編集( | 「リスト名を変更して」 |
| リストにユーザーを追加( | 「@xxx をリストに追加して」 |
| リストからユーザーを削除( | 「@xxx をリストから削除して」 |
| 予約投稿( | 「明日ツイートして」 |
| 予約中のツイート一覧を取得 | 「予約ツイートは?」 |
| 予約ツイートを削除( | 「予約を取り消して」 |
| 投票を作成(選択肢 2-4 個、 | 「投票を作って」 |
| 投票する( | 「この選択肢に投票して」 |
| ID でコミュニティを取得 | 「コミュニティ xxx を見せて」 |
| クエリでコミュニティを検索( | 「Python コミュニティを探して」 |
| コミュニティのツイートを取得( | 「コミュニティの最新投稿を見せて」 |
| 参加済みコミュニティのタイムラインを取得( | 「コミュニティのフィードを見せて」 |
| コミュニティのメンバー一覧を取得( | 「コミュニティのメンバーは?」 |
| コミュニティのモデレーター一覧を取得( | 「モデレーターは誰?」 |
| コミュニティ内のツイートを検索( | 「このコミュニティで xxx を検索して」 |
| コミュニティに参加 | 「このコミュニティに参加して」 |
| コミュニティを退出 | 「このコミュニティを退出して」 |
| コミュニティへの参加申請(審査制コミュニティは | 「このコミュニティへの参加を申請して」 |
X Articles について:
https://x.com/i/article/<id>の長文記事はツイートとは別の ID 名前空間に属します。get_tweetは article URL を渡されると拒否し、get_articleを案内します。get_article_previewは公開 syndication エンドポイント経由で認証不要。get_articleは内部で 2 ホップ reader フローを走り、format引数で出力サイズを制御:
"preview"(~1 KB) —rest_id/title/preview_text/cover_image、カード表示用途
"plain"(~20 KB、デフォルト) — 上記 +plain_text+ フラットなmediaURL リスト +lifecycle_state、LLM が記事を読む 80% のケース、Claude Code のMAX_MCP_OUTPUT_TOKENSに収まる
"full"(~150 KB+) — 重いcontent_stateブロックツリーを含む生 GraphQL レスポンス、リッチコンテンツのレンダリング・アーカイブ・構造解析が必要な場合のみどちらの queryId も他の 80+ エンドポイント同様ハードコードされており、X がハッシュをローテートした場合は公開されている
bundle.Articles.*.js/bundle.TwitterArticles.*.jsチャンクから新しいハッシュを取得できます(認証不要)。
バージョン確認
twikit-mcp --version
# または: twikit-mcp -v
# または: python -m twitter_mcp.server --version仕組み
あなた:「AIに関するツイートを検索して」
→ Claude Code(意図を理解)
→ MCP プロトコル(JSON-RPC、stdio 通信)
→ twikit-mcp(本サーバー)
→ twikit(ブラウザリクエストをシミュレート)
→ Twitter GraphQL APIClaude Code がサーバープロセスを自動管理します。起動時にプロセスを立ち上げ、終了時に自動停止。手動操作やバックグラウンドサービスは不要です。
Windows
mkdir %APPDATA%\twitter-mcp
# cookies.json を作成し、ct0 と auth_token を記入
# uvx
claude mcp add twitter -s user ^
-e "TWITTER_COOKIES=%APPDATA%\twitter-mcp\cookies.json" ^
-- uvx twikit-mcp
# または pip
pip install twikit-mcp
claude mcp add twitter -s user ^
-e "TWITTER_COOKIES=%APPDATA%\twitter-mcp\cookies.json" ^
-- twikit-mcpドキュメント
技術ドキュメント — アーキテクチャ、MCP の仕組み、設定詳細
コントリビューションガイド — テスト、CI/CD、新しいツールの追加方法
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/tangivis/twitter-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server