Skip to content
For AI agentsX (Twitter) X (Twitter)

X (Twitter) MCP server and posting API for AI agents

Give Claude, Cursor, Codex or your own code one MCP server and REST API that publish to X (Twitter), and to every other network SleekPost supports. Connect an X account plus your own X developer app once in the dashboard; your agent never sees your X (Twitter) credentials.

Why not call the X (Twitter) API directly?

Doing it yourself with the X (Twitter) API

  • Create an X developer app and choose an API access level that allows posting.
  • Implement OAuth 2.0 with PKCE and refresh user tokens before they expire.
  • Upload images and video through the media endpoints (video in chunks) before creating the post.

With SleekPost

  • You still create the X app (bring your own keys), but only to paste its Client ID and Client Secret into the dashboard once. SleekPost runs the OAuth flow, token refresh and media uploads.
  • Give your agent an API key. Revoke it anytime.
  • One create_post call publishes, schedules or drafts, on X (Twitter) and any other network.
  • X (Twitter)'s limits are checked before anything goes live, and errors say exactly what to fix.

Set up in a few minutes

1. Connect X (Twitter)

Create an app in the X Developer Portal and copy its Client ID and Client Secret.

Connect accounts →

2. Create an API key

Generate a key in the dashboard. It is shown once.

Create a key →

3. Add the MCP server

Paste the snippet for your agent below, or call the REST API.

Full reference →
Run in your terminal
claude mcp add --transport http sleekpost https://sleekpost.com/mcp --header "Authorization: Bearer YOUR_SLEEKPOST_API_KEY"

Example: post to X (Twitter)

You ask your agent

“Post our launch announcement to X and Bluesky now, with the screenshot.”

The agent calls list_accounts to find the account id, then makes one create_post call.

create_post
{
  "tool": "create_post",
  "arguments": {
    "text": "v2.0 is live 🎉 Dark mode, faster search and offline drafts. Try it today.",
    "account_ids": [
      "ACCOUNT_ID",
      "BLUESKY_ACCOUNT_ID"
    ],
    "media_urls": [
      "https://example.com/v2.png"
    ],
    "publish_now": true
  }
}

X (Twitter) rules your agent doesn't have to memorize

SleekPost validates every post against X (Twitter)'s limits before publishing, so an agent gets an actionable answer instead of a half-failed post.
Text limit280 characters (post text), more with X Premium
MediaOptional (text-only posts work)
Images per postUp to 4
Video1 per post
Connect withAn X account plus your own X developer app

If your agent sends a 290-character post, the post still publishes, and the response carries a warning the agent can act on:

response excerpt
{
  "warnings": [
    "X (Twitter): text has 290 characters. Posts over 280 characters only work if the connected account has a paid subscription (X Premium)."
  ]
}

MCP tools

list_accounts

List connected social accounts and their ids.

create_post

Publish now, schedule, or draft a post to one or more accounts, with optional images/videos.

upload_media

Import an image or video from a public URL and get a media id.

list_posts

List scheduled, published, failed or draft posts.

get_post

Get a post's per-account status, errors and live URLs.

delete_post

Delete a draft or cancel a scheduled post.

Machine-readable docs: /llms.txt · /llms-full.txt · OpenAPI · MCP endpoint https://sleekpost.com/mcp

Other networks, same MCP server

Frequently asked questions

Do I need my own X (Twitter) developer app?

Yes, for X only. SleekPost posts to X through a developer app you create (bring your own keys): paste its Client ID and Client Secret in the dashboard once. Your agent still only needs a SleekPost API key.

Which AI tools can use the MCP server?

Claude Code, Cursor, VS Code, Codex, Gemini CLI and Claude Desktop, and any other client that supports remote MCP servers over HTTP. Anything that can send HTTP requests can use the REST API instead.

Can my agent schedule X (Twitter) posts for later?

Yes. Pass scheduled_at as an ISO 8601 time to schedule, publish_now: true to post immediately, or draft: true to save a draft for a person to review.

How does the agent attach images or video?

Pass public URLs in media_urls. SleekPost downloads, converts and hosts the files, then publishes them with the post.

What does API and MCP access cost?

API and MCP access are included in every plan. Plans start at $9/month ($5.40/month billed yearly) with unlimited posts and a 7-day free trial.

Give your agent X (Twitter).

API and MCP access are included in every plan. Plans start at $9/month ($5.40/month billed yearly) with unlimited posts and a 7-day free trial.