Solutions · AI agents that post

AI agents that post and reply on X, with your approval

Let Claude or your own agent draft posts, reply to people and answer DMs from its own X account, and approve each write before it goes out. Each action is one call, the same price as a read: $0.065 to $0.10 per 1,000.

For agents that only read X data, see AI agents.

Setup

Two ways to give an agent write access

Both use the X session (cookie) of the agent's account and a proxy.

  • Local MCP server

    The open-source twittrapi-mcp server on your machine, over stdio. Set TWITTRAPI_X_COOKIE and TWITTRAPI_X_PROXY and it adds account tools next to the read tools.
    Setup guide
  • SDKs for your own agent (1.1.0)

    The Python, Node.js and Go SDKs have an account API: post, reply, upload media, drafts and DMs, with your own approval step in between.
    Setup guide
Get the cookie and set up a proxy

Human in the loop

You confirm every write

The MCP server marks every tool that writes as not read-only, and deletions also as destructive. MCP clients such as Claude and Cursor then ask you before each call.

  • Keep the approval prompts on. Read the text before you allow it.
  • The cookie and proxy stay in the server's configuration; the model never sees them.
  • Account tools only run over stdio on your machine. The hosted MCP server stays read-only.
  • Each tool description tells the model to post only text you asked for. Direct messages also need TWITTRAPI_X_CHAT_PASSCODE.

Use your own account or one you're authorised to manage, and follow X's rules on automation.

Tools

What the agent can do

MCP tool names, and the account action each one calls.

The full list is in the twittrapi-mcp README; every endpoint is on Account actions.

Your own agent

The account API in the SDKs

From version 1.1.0, each SDK takes the agent's X session once and exposes the account actions as methods. Let the model propose the text, show it to a person, and only then call the method.

  • Python

    client.account.reply("<tweet_id>", "<approved text>")

    README

  • Node.js

    client.account({ cookie, proxy })

    README

  • Go

    client.Account(twittrapi.XSession{…})

    README

Writes are not retried once the request may have reached the API, so a retry never posts twice. Draft first with create_draft when a person should finish the post on x.com.

FAQ

Questions about agents that post

Can the agent post without asking me?

Not through the MCP server's account tools if you keep your client's approval prompts on: every tool that writes is marked as not read-only, so Claude, Cursor and other clients ask before each call. With the SDKs you build the approval step into your own loop.

Why only the local MCP server?

The account tools need the X session cookie and a proxy, and those stay in your own machine's configuration. The hosted MCP server and HTTP mode only offer the read tools.

Does the model see my cookie?

No. The cookie and proxy are server settings, not tool arguments, so they never reach the model and are never logged or returned in a tool result.

Which account should the agent post from?

Its own: a dedicated X account for the agent, labelled as automated in its profile settings, rather than your personal account. That keeps its posts clearly separate and follows X's rules for automated accounts.

Can a retry post the same reply twice?

The SDKs do not retry a write once the request may have reached the API, so a retry never posts twice. Reads still retry as usual.

Give your agent its own voice on X

Get a key, give the agent its own X account, and approve its first post. New accounts start with $0.50 free credit.