X (Twitter) MCP serverand Python AI tasks
qbash hosts a X (Twitter) MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse.
Developers use qbash Tasks to write cloud-hosted Python functions that pair X (Twitter) with models such as Claude and GPT.
MCP server
Build a X (Twitter) MCP server
Give ChatGPT, Claude and your other AI tools access to X (Twitter) through one server. You pick which X (Twitter) tools it shares, and you can add other connectors, memory folders and Tasks to the same server.
How to set it up
- Connect X (Twitter) on the qbash Connectors page.
- Create an MCP server and add the X (Twitter) tools you want to share.
- Paste the server URL into your client. It connects with OAuth or an access token.
Python AI task
Write a X (Twitter) task in Python
A qbash Task is a hosted Python function that calls X (Twitter) and AI models.
Review recent product mentions
Search for a product name and ask an inline prompt to group questions, complaints, and praise with post links.
report = qbash.integrations.x.search(
query='"YourProduct" -is:retweet lang:en',
max_results=25,
)
posts = report.get("tweets", [])
if posts:
review = qbash.ai.run_prompt(
slug="product-mentions",
variables={"posts": json.dumps(posts)},
)
qbash.output(review)
else:
qbash.output("No recent matching posts were returned.")
Sample search response
{
"tweets": [
{
"id": "123",
"text": "Does YourProduct support scheduled exports?",
"author_username": "customer",
"author_name": "Customer",
"created_at": "2026-09-29T12:00:00Z",
"retweet_count": 0,
"like_count": 2,
"reply_count": 1,
"url": "https://x.com/customer/status/123"
}
],
"result_count": 1
}
What the X (Twitter) connector can do
- Return the authenticated user's profile (requires OAuth user context)
- Publish a new tweet (requires OAuth user context)
- Upload a stored image, GIF or video to X and return a media_id for create_tweet
- Check whether X has finished processing an uploaded media id
- Look up a public user profile by username
- Fetch a single tweet with public engagement metrics
- Fetch a tweet with extended metrics including non_public_metrics and organic_metrics for tweets authored by the authenticated user
- List recent tweets from a user by their numeric user ID
- Search recent posts on X using the X API v2
- Fetch recent @mentions of a user by username
- Get recent tweet volume counts for a search query
- Fetch recent posts from a user's timeline by username
- Get trending topics for a location by WOEID
qbash Tasks: AI applications in Python
A Task is a Python function that calls X (Twitter), your other connectors and models such as Claude, GPT, Gemini and Grok. qbash hosts and runs it.
Run Tasks on a schedule or from your team's tools
- Deterministic where it counts Write the logic in Python and call a model only for the steps that need judgement, so the rest runs the same way every time.
- Version controlled Every save is a revision you can compare and roll back.
- Logged Each run records its inputs, output, errors and what started it.
- Shared credentials Connections belong to your organization, so a Task keeps working when its author is away.
X (Twitter) MCP questions
Does X have an official MCP server?
Yes. X publishes XMCP, an open-source server at github.com/xdevplatform/xmcp that turns X API endpoints into tools. qbash hosts its own X server, which can share one URL with your other connectors and the same calls your Python tasks make.
Who pays for the X API calls?
Your X developer account. Every search and post runs on your app’s credentials, so X applies its billing and rate limits to that app.
Can the assistant post images?
Text posts work over MCP. Media upload is a Python method, so a task uploads the file and passes the media_id to create_tweet.
Guides that use X (Twitter)
Related research connectors
Build a X (Twitter) task
Write it in Python with AI steps, and qbash hosts it with versions and run logs.
Build a X (Twitter) MCP server
Pick the X (Twitter) tools to share and connect ChatGPT, Claude or Grok Bot.