X Thread Poster
Overview
Use Chrome DevTools MCP to compose and publish X threads from the user's active browser profile. Treat posting as a live external action: publish only when the user explicitly asks to post; otherwise stop after drafting or previewing.
Workflow
- Load Chrome DevTools MCP tools if they are not already available.
- Prepare the complete thread text before touching the composer.
- Open
https://x.com/compose/post or https://x.com/home.
- Use
wait_for and take_snapshot to confirm the logged-in composer is visible.
- Enter each post with real browser input events, not DOM-only filling.
- Add another post for each thread item.
- Click the final publish button only after all posts are present and under limits.
- Confirm publication from the timeline or returned status links.
Preconditions
- Use the user's existing Chrome/X session.
- If X shows login, 2FA, CAPTCHA, account lock, or a security confirmation, stop and ask the user to complete it.
- If the user asks for a draft, schedule, analysis, or review instead of posting, do not publish.
- If the generated thread is not clearly authorized for live posting, show the draft and ask for confirmation before clicking the publish button.
Thread Preparation
- Keep every post comfortably below X's limit, preferably under 260 characters for non-Premium accounts.
- Put required source links in the first post unless the user specifies otherwise.
- For quoted/source X links, expect X to convert the raw URL into a quote card and sometimes hide the URL text after
原文:.
- Match the requested voice: slang, idioms, personal style, directness, language, and formality.
- Avoid unverified claims, impersonation, harassment, or medical/legal/financial certainty unless the user provided vetted text.
- Numbering is optional. For a punchier X style, unnumbered short posts often read better.
Chrome DevTools Pattern
Prefer this interaction pattern:
new_page({ url: "https://x.com/compose/post" })
wait_for({ text: ["有什么新鲜事", "What is happening?!", "发帖", "Post", "登录", "Sign in"] })
take_snapshot()
click(textbox uid)
type_text(first post)
take_snapshot()
click("添加帖子" or "Add post")
type_text(next post)
repeat
click("全部发帖" or "Post all")
wait_for(success/timeline text)
take_snapshot()
Use localized labels from the snapshot. Common Chinese labels include:
帖子文本: composer textbox
发帖: single-post publish button
全部发帖: thread publish button
添加帖子: add another post
添加另一个帖子: placeholder for the next post
关闭: close composer
草稿: drafts
Input Reliability
X's composer uses Draft.js/contenteditable behavior. fill() can make text appear in the box while React does not enable the publish button.
Use click() plus type_text() for text entry. Use take_snapshot() after each post to verify both the text and the button state. If a post was inserted with fill() and the publish button stays disabled, discard that composer by closing it, reopen a fresh composer, and re-enter with type_text().
If typing long non-ASCII text fails or drops characters, split type_text() calls into shorter chunks at paragraph boundaries.
Publication Confirmation
After publishing:
- Wait for navigation back to home/timeline or a success indicator.
- Take a fresh snapshot.
- Extract the first status link from the newly posted thread, usually from the timestamp link in the first new article.
- Report the public thread URL to the user.
Failure Handling
- If the page is not logged in, ask the user to log in.
- If publish fails with a policy/rate/length warning, read the visible error and revise only the affected post.
- If the add-post control is missing, verify the current composer is focused and the current post has valid text.
- If the final button is disabled, check for over-limit text, empty posts, or the Draft.js
fill() issue.
- Never retry publishing blindly if the UI state is unclear; refresh the snapshot and confirm whether the thread already posted.
1---2name: x-thread-poster3description: Post multi-part X/Twitter threads through Chrome DevTools MCP using the user's logged-in browser session. Use when Codex is asked to open x.com, compose, publish, or automate a thread/multiple posts, especially when a source link must be included or the post style must be adapted from provided content.4---5
6# X Thread Poster
7
8## Overview
9
10Use Chrome DevTools MCP to compose and publish X threads from the user's active browser profile. Treat posting as a live external action: publish only when the user explicitly asks to post; otherwise stop after drafting or previewing.
11
12## Workflow
13
141. Load Chrome DevTools MCP tools if they are not already available.
152. Prepare the complete thread text before touching the composer.
163. Open `https://x.com/compose/post` or `https://x.com/home`.
174. Use `wait_for` and `take_snapshot` to confirm the logged-in composer is visible.
185. Enter each post with real browser input events, not DOM-only filling.
196. Add another post for each thread item.
207. Click the final publish button only after all posts are present and under limits.
218. Confirm publication from the timeline or returned status links.
22
23## Preconditions
24
25- Use the user's existing Chrome/X session.
26- If X shows login, 2FA, CAPTCHA, account lock, or a security confirmation, stop and ask the user to complete it.
27- If the user asks for a draft, schedule, analysis, or review instead of posting, do not publish.
28- If the generated thread is not clearly authorized for live posting, show the draft and ask for confirmation before clicking the publish button.
29
30## Thread Preparation
31
32- Keep every post comfortably below X's limit, preferably under 260 characters for non-Premium accounts.
33- Put required source links in the first post unless the user specifies otherwise.
34- For quoted/source X links, expect X to convert the raw URL into a quote card and sometimes hide the URL text after `原文:`.
35- Match the requested voice: slang, idioms, personal style, directness, language, and formality.
36- Avoid unverified claims, impersonation, harassment, or medical/legal/financial certainty unless the user provided vetted text.
37- Numbering is optional. For a punchier X style, unnumbered short posts often read better.
38
39## Chrome DevTools Pattern
40
41Prefer this interaction pattern:
42
43```text
44new_page({ url: "https://x.com/compose/post" })
45wait_for({ text: ["有什么新鲜事", "What is happening?!", "发帖", "Post", "登录", "Sign in"] })
46take_snapshot()
47click(textbox uid)
48type_text(first post)
49take_snapshot()
50click("添加帖子" or "Add post")
51type_text(next post)
52repeat
53click("全部发帖" or "Post all")
54wait_for(success/timeline text)
55take_snapshot()
56```
57
58Use localized labels from the snapshot. Common Chinese labels include:
59
60- `帖子文本`: composer textbox
61- `发帖`: single-post publish button
62- `全部发帖`: thread publish button
63- `添加帖子`: add another post
64- `添加另一个帖子`: placeholder for the next post
65- `关闭`: close composer
66- `草稿`: drafts
67
68## Input Reliability
69
70X's composer uses Draft.js/contenteditable behavior. `fill()` can make text appear in the box while React does not enable the publish button.
71
72Use `click()` plus `type_text()` for text entry. Use `take_snapshot()` after each post to verify both the text and the button state. If a post was inserted with `fill()` and the publish button stays disabled, discard that composer by closing it, reopen a fresh composer, and re-enter with `type_text()`.
73
74If typing long non-ASCII text fails or drops characters, split `type_text()` calls into shorter chunks at paragraph boundaries.
75
76## Publication Confirmation
77
78After publishing:
79
80- Wait for navigation back to home/timeline or a success indicator.
81- Take a fresh snapshot.
82- Extract the first status link from the newly posted thread, usually from the timestamp link in the first new article.
83- Report the public thread URL to the user.
84
85## Failure Handling
86
87- If the page is not logged in, ask the user to log in.
88- If publish fails with a policy/rate/length warning, read the visible error and revise only the affected post.
89- If the add-post control is missing, verify the current composer is focused and the current post has valid text.
90- If the final button is disabled, check for over-limit text, empty posts, or the Draft.js `fill()` issue.
91- Never retry publishing blindly if the UI state is unclear; refresh the snapshot and confirm whether the thread already posted.