X (Twitter) MCP Server: Schedule Threads

Short answer: the TimeToPost MCP server gives an AI agent publish_thread and schedule_post for X, plus get_optimal_times, which returns the hours your own audience engages most. Each tweet is 280 characters, a thread is up to 24 tweets, and a post carries up to 4 images or one video. You connect X once with OAuth; you never paste an X API key.

Connect your agent to X

By the TimeToPost team. Last reviewed 2026-11-07.

Connect X to your agent

  1. Add the TimeToPost MCP server to your client and approve access in the browser.
  2. Ask the agent for connect_account_link with provider "twitter" and approve X in the browser. Scopes: tweet.read, tweet.write, users.read, media.write, dm.write and offline.access.
  3. Run list_integrations. Each X account has its own id; with several accounts, pass accountIds or a collection name so the post goes to the right one.

The server URL is https://api.timetopost.co/mcp (Streamable HTTP, browser sign in). Client setup files: Claude Code, Cursor, Codex, ChatGPT, Gemini, n8n.

X rules the server enforces

RuleX
Text280 characters per tweet; URLs count at full length
ThreadsUp to 24 tweets, each up to 280 characters; posted as replies 1.1 seconds apart; media only on the first tweet
ImagesUp to 4 per post: JPEG, PNG, GIF or WebP, up to 5 MB each
VideoOne MP4 or MOV per post, up to 512 MB, never mixed with images
Token lifeAbout 2 hours by design; refreshed at publish, so an old expiry date is normal
Best timeget_optimal_times with platform "twitter"; under 10 posts with metrics it returns a starting window instead

What your agent can do on X

  • Post or schedule single tweets and threads, with images or one video.
  • Pick the slot from your own engagement data (get_optimal_times), not an industry average.
  • Read impressions, likes, replies, reposts, bookmarks and link clicks for posts under about 30 days old (get_post_metrics).

What it cannot do

  • Reply to someone else's tweet, quote a tweet or post a poll.
  • Choose who can reply: there is no reply setting in the tool inputs.
  • Pick an account inside publish_thread: with several X accounts, use schedule_post with a thread array and accountIds.

A real X run, call by call

Prompt: “Find my best slot on X this week and schedule this 3 tweet thread there.”

1. get_optimal_times

Captured from our workspace on 7 November 2026, three of ten slots shown.

{"platform":"twitter"}

Response:

{"bestTimeSlots":[{"hour":15,"dayName":"Tuesday","score":1.38,"avgLikes":0.61,"avgComments":0.24,"postCount":30.5,"confidence":"high"},{"hour":8,"dayName":"Tuesday","score":1.35,"postCount":30.5,"confidence":"high"},{"hour":15,"dayName":"Thursday","score":1.33,"postCount":26.5,"confidence":"high"}],"dataPoints":243,"message":"Your best posting time is Tuesday at 3:00 PM. Based on 243 posts, we have high confidence in these recommendations."}

2. schedule_post

Three accounts are connected here, so accountIds picks one. The first tweet is content, tweets 2 to N go in thread.

{"platforms":["twitter"],"accountIds":["cmrl0z..."],"content":"We tested 243 of our own posts against the usual best time charts.","thread":["Our peak was Tuesday 15:00, not the morning slot the charts push.","Your account will differ. That is the point of measuring your own."],"scheduledAt":"2026-11-10T15:00:00+01:00"}

3. publish_thread

publish_thread is the shortcut for a single X account; an empty list is refused before any request.

{"segments":[]}

Response:

segments must contain at least one tweet

243 posts put our best X slot at Tuesday 15:00, not the morning

The get_optimal_times output above is our own account set: 243 posts with metrics, top slot Tuesday at 15:00, then Tuesday at 08:00 and Thursday at 15:00. With fewer than 10 posts of history the tool returns a starting window instead (Tuesday to Thursday, 08:00 to 11:00 in your workspace time zone) and switches to your own numbers as data comes in. Our own data moved the top slot from the morning window to mid afternoon, so an agent should call it again each week rather than hard-code a time.

Errors your agent will see on X

These are the exact messages the server returns, so an agent can fix the call instead of guessing.

WhenMessage
A tweet over 280 charactersX (Twitter) post is 312 characters, 32 over the 280 limit. Trim it and try again.
One thread tweet too long (path thread.1)String must contain at most 280 character(s)
Video plus imagesX allows one video or GIF per post and it cannot be combined with images. Remove the extra media and re-publish
Account connected before media upload was allowedX refused the media upload because this connection lacks media permission. Reconnect your X account in TimeToPost, then re-publish
Image over 5 MBimage is 6.2MB; X accepts images up to 5MB
Several X accounts, no targetMultiple connected accounts match the requested platform target (twitter: ...). Pass accountIds, collection, or allAccounts:true.

More

Checked against the TimeToPost server code on 2026-11-07.

Frequently asked questions

Do I need an X API key for the X MCP server?

No. You connect X with OAuth in the browser and TimeToPost holds the token. Your agent talks to the TimeToPost MCP endpoint with its own sign-in, so no X developer account or paid API tier is needed on your side.

How long can a thread be?

24 tweets, each up to 280 characters. Only the first tweet carries media.

Can the agent see how a tweet performed?

Yes, with get_post_metrics: impressions, likes, replies, reposts plus quotes, bookmarks and link clicks. Impressions and link clicks come back only for tweets under about 30 days old.

Is posting to X through MCP against the X rules?

Posting through the official X API with your consent is allowed. Keep to the X automation rules: no duplicate posts across accounts and no automated replies to people who did not ask for them.

Connect your agent to X through TimeToPost: the MCP server and its 76 tools are on every plan, from $12 a month. Your first post is free.

Start free