How to Give Any MCP Agent
a Twitter Tool
Add a Twitter/X posting tool to any MCP agent in minutes. Point your client at OpenTweet's hosted MCP endpoint, get 36 tools, and ask your agent to post or schedule in plain language.
Set up in 2 minutes • Free 7-day trial
Why give your MCP agent a Twitter tool?
An MCP agent is only as capable as the tools it can reach. Out of the box, most agents can read and write files and run commands, but they cannot post to X. OpenTweet's MCP server closes that gap. It hands your agent 36 tools for creating, scheduling, and managing tweets, so posting to X becomes just another action the agent can take.
Because OpenTweet manages the connection to X for you, your agent never touches the X API and you never need an X developer account. You connect your X account once inside OpenTweet, generate a single ot_ key, and the agent posts through that key. No per-call X billing, no OAuth dance in your code.
The setup works with any MCP or REST client. Claude Code, Codex, Cursor, Windsurf, ChatGPT, OpenClaw, Hermes, and anything else that speaks the protocol can all use the same server. Point the client at the hosted endpoint, restart, and your agent can tweet.
Step-by-Step: Add the Twitter Tool
Get an OpenTweet API key
Sign up for OpenTweet (free 7-day trial on all plans) and open the developer page to generate an API key. Every key starts with the ot_ prefix and is scoped to your account, so the agent posts on your behalf. You can revoke or rotate it anytime.
Grab a key at opentweet.io/developer, then verify it works with a quick call to GET /me.
curl https://opentweet.io/api/v1/me \
-H "Authorization: Bearer ot_your_key"Point your MCP client at the hosted endpoint
The fastest path is the hosted MCP server. There is nothing to install. Add the endpoint to your MCP client config with the streamable-http transport and an Authorization Bearer header carrying your ot_ key. This is the recommended setup for most agents.
{
"mcpServers": {
"opentweet": {
"type": "streamable-http",
"url": "https://mcp.opentweet.io/mcp",
"headers": {
"Authorization": "Bearer ot_your_key"
}
}
}
}Or run the MCP server locally
Prefer to run the server yourself? Point your client at the npx command instead. It downloads and starts the same server on your machine, reading your key from the OPENTWEET_API_KEY environment variable. Use this when your client only supports stdio-based local servers.
{
"mcpServers": {
"opentweet": {
"command": "npx",
"args": ["-y", "@opentweet/mcp-server"],
"env": {
"OPENTWEET_API_KEY": "ot_your_key"
}
}
}
}Restart the client and confirm the 36 tools appear
Restart your MCP client so it loads the new server. Your agent should now list 36 OpenTweet tools. If you do not see them, double check the endpoint URL, that the header uses your real ot_ key, and that the client fully reloaded.
The tool set spans posting, scheduling, media, analytics, evergreen, and articles. A few you will use most:
opentweet_create_tweet
opentweet_create_thread
opentweet_schedule_tweet
opentweet_batch_schedule
opentweet_get_analytics
opentweet_add_to_evergreen36 tools, one key
Everything from opentweet_create_tweet to opentweet_publish_article authenticates with the same ot_ key. No per-tool setup.Ask the agent to post or schedule in natural language
That is it. Talk to your agent the way you already do. Ask it to post now, schedule for a specific time, or plan a whole week. The agent maps your request to the right tool, so you never write JSON by hand.
You: post "Shipped the new MCP integration today. Agents can now tweet."
You: schedule a tweet about the launch for 2026-07-10 at 9am
You: draft a 3-tweet thread explaining how the auth flow worksUnder the hood the agent calls the REST API for you. A publish-now request is POST /posts with { "text": "...", "publish_now": true }, and scheduling swaps in scheduled_date (ISO 8601). You never touch it directly.
What the agent can do once the tool is added
Create & Publish
- Post a single tweet now with publish_now
- Write and schedule multi-tweet threads
- Batch schedule up to 50 posts at once
- Upload media, generate images and video
- Save drafts for review before publishing
- Create and publish long-form X articles
Manage & Analyze
- Pull analytics and top posts
- Find and analyze best posting times
- Search inspiration and spot content gaps
- Manage the evergreen recycling queue
- List and switch between X accounts
- Update, repurpose, and delete tweets
Pro tips for MCP agents on X
Start with the hosted endpoint
Unless you have a reason to self-host, use https://mcp.opentweet.io/mcp. There is nothing to install, no process to keep alive, and updates ship on the server. Point your client at the URL, add the Bearer header, and you are done in under two minutes.
Verify the key before wiring the agent
A quick GET /me with your ot_ key confirms the key is valid and tells you which account it maps to. Doing this first saves you from debugging a silent tool that fails because of a typo in the header.
Let the agent batch schedule
Ask your agent to plan and schedule a week of content in one message. It can batch schedule up to 50 posts at once via opentweet_batch_schedule, so a single conversation fills your calendar instead of one tweet at a time.
Prefer the REST API for scripts
MCP is ideal for conversational agents. For cron jobs and CI, hit the REST base at https://opentweet.io/api/v1 directly with the same ot_ key. There is also a CLI: npm install -g @opentweet/cli, then opentweet auth and opentweet tweet.
Common mistakes to avoid
Using api.opentweet.io
The REST base is https://opentweet.io/api/v1. The host api.opentweet.io does not resolve, so requests pointed there fail with a DNS error. Always use the opentweet.io/api/v1 base for REST calls and https://mcp.opentweet.io/mcp for the hosted MCP endpoint.
Not restarting the client
MCP clients load their server list at startup. If you add OpenTweet to the config but the tools do not appear, the client almost certainly needs a full restart. Quit and reopen it, then check the tool list again before assuming the config is wrong.
Combining publish_now and scheduled_date
These two fields are mutually exclusive. Set publish_now to post immediately, or set scheduled_date to schedule, but never both in the same request. Omit both if you only want to save a draft for review.
Forgetting the Bearer prefix
The Authorization header value is Bearer ot_your_key, with the word Bearer and a space before the key. Sending just the raw ot_ key, or using a different scheme, results in an unauthorized response even when the key itself is valid.
Go deeper on the MCP server
Frequently asked questions
Which MCP agents can use the OpenTweet Twitter tool?
Any MCP or REST client works. That includes Claude Code, Codex, Cursor, Windsurf, ChatGPT, OpenClaw, Hermes, and any other agent that speaks the Model Context Protocol. The server is model-agnostic. It exposes tools that any connected agent can call.
Do I have to install anything to add the Twitter tool?
No. The hosted endpoint at https://mcp.opentweet.io/mcp requires nothing to install. You point your MCP client at the URL, add an Authorization Bearer header with your ot_ key, and restart. If you prefer to self-host, you can run npx -y @opentweet/mcp-server locally instead.
How many tools does the OpenTweet MCP server provide?
There are 36 tools. They cover creating tweets and threads, publishing and scheduling, batch scheduling, media upload, image and video generation, analytics, best-time analysis, inspiration search, evergreen queue management, and long-form articles.
Where do I get an API key for the MCP agent?
Generate an API key with the ot_ prefix at https://opentweet.io/developer after signing up. Pass it as a Bearer token in the Authorization header for the hosted endpoint, or set it as the OPENTWEET_API_KEY environment variable when running the server locally. You can verify it works with a GET request to /me.
Can the agent schedule tweets, not just post them?
Yes. Ask the agent to schedule and it calls opentweet_schedule_tweet with an ISO 8601 date. Under the hood the REST equivalent is POST /posts with a scheduled_date field. It can also batch schedule up to 50 posts at once and manage an evergreen queue.
Does this need an X developer account?
No. OpenTweet handles the connection to X, so your agent never touches the X API directly. You connect your X account once inside OpenTweet, then the agent posts through your single ot_ key. No X developer account and no per-call X API billing.
Keep exploring
OpenTweet vs the X API
Post, schedule, and automate X without a developer account or the $200/mo minimum.
Post to X without an API
The clean, account-safe way to post to X from your code or an AI agent.
Twitter MCP Server
Give Claude, Cursor, and OpenClaw the ability to post to X. 36 tools included.
Developer docs
Quickstart, API keys, MCP setup, and the REST reference for posting to X from code or an agent.
XMCP vs OpenTweet
X's official MCP server bills per API call and cannot schedule. Compare it with the flat-fee hosted MCP.
MCP for AI agents
Connect your AI client to X in under two minutes, no X developer account.
Developer API and keys
REST endpoints, one bearer key, and usage tracking. Build on OpenTweet.
OpenTweet for AI agents
The posting layer for autonomous agents and automations that live on X.
Build an AI Twitter persona
Give your AI agent its own X account. Setup, cadence, and the rules that keep it safe.
Give your agent a Twitter tool
Set up in 2 minutes. Free 7-day trial. Hosted endpoint, nothing to install.