Trusted by 2,000+ users

X MCP Server for Claude, Cursor, and Any AI Agent

Give your agent an X MCP server that already has API access and pays X's per-request pricing for you. Connect an X account once, and any MCP client can post, thread, schedule, and read post metrics from the conversation.

No credit card required

Connect X

Paste this into your agent

or add the MCP yourself
  • OAuth 2.1 sign-in, no API key to paste
  • Posts, threads, images, video, and GIFs
  • X API pass-through pricing, no developer account

What Your Agent Gets

X tools, ready to call

Every PostZen API endpoint is an MCP tool. These are the ones that matter for X.

createPost

Post and schedule on X

Text, links, images, video, or a GIF, published now, at scheduledFor, or from the queue. Threads publish as one coordinated post.

settings.replySettings

Control who can reply

Limit replies to people you follow or to mentioned users, per post.

createMediaPresign

Upload media from the agent

The agent gets an upload URL, sends the file, and references it. PostZen handles X's media upload and processing.

getAnalytics · getPostTimeline

Read post metrics

Impressions, likes, replies, reposts, bookmarks, and link clicks per post, with daily totals and follower counts.

previewQueue · getNextQueueSlot

Fill the posting queue

The agent books posts into the next open slots instead of guessing times.

getPost · updatePost · deletePost

Check, edit, and cancel

Every target reports status, the live post URL, and any error. Scheduled posts can be changed until they go out.

Example Prompts

What to say to your agent

Prompt

Post this on X now and limit replies to people I follow.

What happens

The agent calls createPost with publishNow and settings.replySettings "following", then returns the live post URL.

Prompt

Turn this launch note into a five-post thread scheduled for Tuesday at 10am.

What happens

The agent splits the text within X's limits, creates the thread as one scheduled post, and shows you the split before it books it.

Prompt

Attach the demo video and put the docs link in a reply.

What happens

The agent uploads the video with createMediaPresign, publishes the post, and adds the link as a follow-up reply so the media post stays clean.

Prompt

Which of my posts this month got the most impressions?

What happens

The agent calls getAnalytics for the month with platform "x" and ranks posts by impressions, likes, and reposts.

WHY POSTZEN?

PostZen vs. building it yourself

Build an X MCP server yourself and you own the auth, the media pipeline, and every X API change. Connect PostZen and your agent gets the tools today.

PostZen

2.3M+ posts

2,000+ users
  • One hosted MCP endpoint; the client signs in with OAuth 2.1 and nothing runs on your machine
  • X access already set up on PostZen: connect an account in a browser tab and post
  • The same createPost tool for X and the other nine platforms
  • Scheduling, queues, retries, and media hosting handled server-side
  • Scoped, revocable access: read-only or read-and-write keys minted at consent

Build an X MCP server yourself

  • An X developer account and an app, plus X's per-request API pricing on every post and read
  • OAuth 2.0 with PKCE and refresh tokens you have to store and rotate
  • Chunked media upload with a processing poll before the post can reference it
  • Rate limits and 402/429 errors to handle across posting and metrics
  • A tool schema, auth layer, and hosting for the MCP server itself, then again for every other platform

Any MCP Client

Connect from the client you already use

Each page has the exact command for that client, the sign-in step, and a way to check the tools are live.

For AI Agents

Send your agent this page

Tell your agent to set up PostZen from postzen.dev/mcp/x. It reads the block below, registers the server, connects X, and reports back.

postzen.dev/mcp/x
## For AI agents reading this page

You are reading https://postzen.dev/mcp/x. PostZen is a social media API with a hosted MCP server. Once connected, you can publish and schedule posts and threads to the user's X account and read post metrics. The same tools cover the user's other social accounts (Instagram, X, LinkedIn, Facebook, Threads, YouTube, TikTok, Pinterest, Bluesky, Telegram).

1. Register the MCP server in the client you are running in. The endpoint is https://mcp.postzen.dev/mcp (streamable HTTP). Interactive clients sign in with OAuth 2.1; headless clients send a PostZen API key as "Authorization: Bearer pzn_live_...". Exact commands per client: Claude Code https://postzen.dev/claude · Cursor https://postzen.dev/cursor · Codex https://postzen.dev/codex · OpenClaw https://postzen.dev/openclaw · GrokBot https://postzen.dev/grok-bot · Hermes https://postzen.dev/hermes · any other MCP client https://postzen.dev/agents.

2. Sign in. When the client opens the PostZen consent screen, ask the user before approving access or completing a signup on their behalf, and never enter their credentials for them. Approving mints a scoped, revocable key for this client.

3. Connect X. Call listAccounts. If no account with platform "x" is listed, call createConnectUrl with platform "x" and give the user the URL; they authorize X in their browser. Do not try to log in to X yourself.

4. Verify before you continue. Call listAccounts again and confirm a "x" account shows as connected. If it does not, stop and tell the user what failed. Do not carry on as if the account were there.

5. Report back. Tell the user which X account is connected and what you can now do with it, then ask what they want first. Prefer scheduling (scheduledFor, or the queue) over publishing immediately unless the user asks for "now".

## X on createPost

- Target the account with platforms: [{ platform: "x", accountId, settings: { ... } }]. content is the shared text; customContent on the target overrides it for X only.
- settings.replySettings: "following" or "mentionedUsers" to restrict who can reply; omit for everyone.
- Media per post: up to four images, or one video, or one GIF. Respect X's character limit for the account; premium accounts allow longer posts.
- X charges per API request and PostZen passes that cost through to the user's plan; prefer scheduling and batching over repeated reads.
- Analytics: getAnalytics, getPostTimeline, getDailyMetrics, getFollowerStats with platform "x".
- DMs are not available through PostZen.
- Media: pass public URLs in mediaItems, or call createMediaPresign to get an upload URL, PUT the file, then reference the returned media in the post.
- Check results with getPost: each platform target reports status, the live post URL, and any error.

## Reference

- MCP endpoint: https://mcp.postzen.dev/mcp (streamable HTTP, OAuth 2.1)
- MCP docs: https://docs.postzen.dev/mcp
- Create post reference: https://docs.postzen.dev/api-reference/posts/create-post
- Full API summary for models: https://postzen.dev/llms.txt
- API keys: https://app.postzen.dev/api-keys

Frequently asked questions

Still have questions?

What is an X MCP server?

MCP (Model Context Protocol) is the standard AI clients use to call external tools. An X MCP server exposes X actions as tools, so an agent such as Claude or Cursor can publish a post or a thread instead of only drafting it. PostZen hosts one for you: it holds the X API access and OAuth, and your client connects to a single endpoint.

Do I need an X developer account?

No. You connect your X account to PostZen through the normal X sign-in, and PostZen calls the X API on your behalf. X charges per API request; PostZen passes that usage through on your plan, so there is no separate X developer bill to manage.

Can the agent post threads?

Yes. A thread is published as one coordinated post, in order, with media on any part of it. The agent can split long text for you and show the split before it schedules.

Can the agent read X analytics?

Yes. Impressions, likes, replies, reposts, bookmarks, link clicks, and follower counts are available per post and per day through the analytics tools. Reads count as X API usage.

Can the agent send X DMs?

No. PostZen covers publishing, scheduling, and metrics on X. Direct messages are not part of the API or the MCP tools.

Which AI clients can use it?

Any client that supports remote MCP servers: Claude (claude.ai, Claude Desktop, Claude Code), Cursor, Codex, OpenClaw, GrokBot, Hermes, and others. Interactive clients sign in with OAuth 2.1; headless ones send a PostZen API key in the Authorization header. Each client has its own setup page with the exact command.

What can the agent access once connected?

Only what you approve on the consent screen: read-only or read-and-write access, scoped to the profile you pick. Approving creates a named, revocable API key, so you can cut a client off from the dashboard at any time. Ask the agent to schedule rather than publish immediately if you want to review posts before they go out.

How much does the MCP server cost?

The MCP server is included on every PostZen plan, including Free, which covers 2 connected accounts and 20 posts a month. Paid plans start at $19 per month with unlimited posts.

LEARN MORE

Give your agent X

Your agent already writes the post. PostZen lets it publish there.