Skip to content

Twitter (X) MCP: Give Your AI Agent Public Posts Without an X Developer App

A Twitter MCP server lets Claude, Cursor or ChatGPT read public X posts and their engagement counts as tool calls. Connect Scrape.ly's hosted server in a minute, with no X developer app or API keys, and see the exact tool calls, real output from @NASA and @SpaceX, and what it cost.

Published
Reading time
10 min read
Pixel-art robot with an orange >_ on its terminal head carries a cable from a feed of posts headed by the white X logo into a server rack labelled MCP
In this article
  1. Official X MCP or a scraping server: two kinds of Twitter MCP
  2. How to connect the Scrape.ly MCP server
  3. What the Tweet Scraper can read
  4. The four tool calls behind every request
  5. A real run: what @NASA and @SpaceX posted this week
  6. Prompts that work well
  7. What your agent can and can't get from X
  8. Spending control for agents that run on their own
  9. Is it legal to scrape X with an AI agent?
  10. FAQ
  11. Is there an MCP for Twitter?
  12. Is the X MCP server free?
  13. Can I get the Twitter API for free?
  14. Can my AI agent post tweets through this server?
  15. What is the Twitter MCP server URL?
  16. Does it work with Claude and ChatGPT?

A Twitter MCP server is a Model Context Protocol server that lets an AI agent such as Claude, Cursor or ChatGPT read X (Twitter) data through tool calls: a profile's latest posts, a single post with its replies, keyword searches, and the like, repost, reply and bookmark counts on each one. The quickest Twitter MCP setup for research is Scrape.ly's hosted server, because the agent runs a ready-made Tweet Scraper in the cloud against public, logged-out pages: no X developer app to register, no API keys to paste, and no per-read API bill.

This guide explains how the two kinds of X servers differ, connects the Scrape.ly server to each client, walks through the exact tool calls, and shows two real runs from 26 October 2026. Ten posts from @NASA's timeline took 6.9 seconds and cost $0.0038; five from @SpaceX took 5.2 seconds for $0.0019. It also lists what the agent can't get from X this way, so your prompts don't ask for it.

Official X MCP or a scraping server: two kinds of Twitter MCP

Google's page one for "twitter mcp" on 26 October 2026 is mostly servers that call the X API with your credentials. The top result, EnesCinr/twitter-mcp, gives Claude two tools, post_tweet and search_tweets. Step one of its quick start is "Create a Twitter Developer account and get your API keys", and its config takes four of them. The hosted connectors ranked next to it are built for posting from and managing your own account.

The big change this year came from X itself. On 30 June 2026 it launched a hosted MCP server at api.x.com/mcp, which TechCrunch described as letting AI tools "communicate with the X API using a user's own account permissions". X's MCP docs spell out the setup: "X's OAuth requires your own developer app. There is no dynamic client registration." You either paste an app-only Bearer token or run the local xurl bridge with your app's client ID and secret. Each tool call is then an X API call at pay-per-use rates: $0.005 per post read and $0.010 per user read, with pay-per-usage plans capped at 3 million post reads per billing cycle.

X's server makes sense when the agent works on your own account. For research on public accounts you don't own, a scraping server is the shorter and cheaper path.

Scrape.ly MCP server X's hosted X MCP Open-source API-key servers
X developer app Not needed Required: "your own developer app" Required: four API keys
Setup One URL, sign in with OAuth App-only Bearer token, or the local xurl bridge with client ID and secret A local npx server with keys in its config
Reading 1,000 posts $0.38, platform usage included $5.00 at $0.005 per post read X API rates, billed to your app
Your X account Never used Its permissions on user-context calls Its tokens in your config
Output Structured rows, paged, exportable as JSON or CSV X API responses X API responses

How to connect the Scrape.ly MCP server

The Scrape.ly MCP server lives at https://mcp.scrape.ly. It speaks MCP's streamable HTTP transport and accepts OAuth or a Scrape.ly API token. If you don't have an account yet, the free plan comes with $5 of usage each month and asks for no card.

Claude Code. Register the server, then type /mcp in a session and pick scrapely to approve access in your browser:

shell
claude mcp add --transport http scrapely https://mcp.scrape.ly

Claude Desktop. Open Customize → Connectors, add a custom connector with the URL https://mcp.scrape.ly, and sign in when Claude asks.

Cursor. Put the server in ~/.cursor/mcp.json for every project, or .cursor/mcp.json for one:

json
{
  "mcpServers": {
    "scrapely": {
      "url": "https://mcp.scrape.ly",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}

Drop the headers block and Cursor signs you in with OAuth instead. Tokens live under Settings → API & Integrations in the dashboard.

ChatGPT, VS Code, Windsurf and other clients. Anything that supports remote MCP servers over streamable HTTP takes the same URL with OAuth or a Bearer header. The MCP docs show VS Code's .vscode/mcp.json and a local stdio server for clients that can't reach a remote one.

To hand the agent only the X tool, name the Actor in the URL. It then appears as a tool of its own:

Text
https://mcp.scrape.ly?actors=echofield/tweet-scraper

What the Tweet Scraper can read

X data in the Scrape.ly Store comes from one Actor, the Tweet Scraper, maintained by Scrape.ly. It takes five kinds of input, and the agent can mix them in a single call:

Input What it does Example value
twitterHandles Walks a profile's public timeline, page by page, until maxItems ["NASA"]
startUrls Profile, post, list, search, media or highlights URLs; a post URL returns the post plus the replies on its public page ["https://x.com/SpaceX/status/2114444137067844004"]
searchTerms Keyword or advanced-search queries, sorted Top or Latest ["from:NASA artemis"]
conversationIds Reads that thread's focal post page ["2114444137067844004"]
start, end and filters Date window, minimum likes, reposts or replies, and image, video, quote or verified-only filters on a from:handle timeline "minimumFavorites": 1000

Each post is one row: text and full text, a UTC timestamp, language, like, repost, reply, quote and bookmark counts (real zeros included), a view count when X's response carries one, media with alt text, links, mentions, hashtags, reply and quote details, and the author with follower and following counts and verification type. The price is $0.38 per 1,000 posts ($0.00038 each), platform usage included, and only saved posts are charged. For a REST endpoint instead of a chat, the Twitter (X) API page runs the same Actor from Python, JavaScript and cURL.

The four tool calls behind every request

The agent doesn't need X-specific tools. Every request goes through the same four calls on the Scrape.ly server:

  1. search-actors with "twitter" returns the Tweet Scraper first, with its price and input fields.
  2. fetch-actor-details fetches the input schema and README, so the agent knows that twitterHandles takes plain handles and maxItems sets the size.
  3. call-actor starts the run and waits up to 45 seconds. It returns the status and the dataset ID, never the rows.
  4. get-actor-output reads the rows in pages of about 50 KB, keeping only the fields the agent names, with nextOffset for the next page.

Because the posts come back in a separate, paged call, the agent can read five fields from 500 posts instead of pouring every media URL into its context window.

A real run: what @NASA and @SpaceX posted this week

The prompt: "Use scrapely to get the latest posts from @NASA and @SpaceX and tell me which of each account's own posts got the most engagement."

The agent sent this call-actor request, with a cap on the charge:

json
{
  "actor": "echofield/tweet-scraper",
  "input": { "twitterHandles": ["NASA", "SpaceX"], "maxItems": 10, "sort": "Latest" },
  "waitSecs": 45,
  "callOptions": { "maxTotalChargeUsd": 0.05 }
}

The run finished in 6.9 seconds with the status "Saved 10 posts." The agent then asked get-actor-output for createdAt,author.userName,author.followers,isRetweet,likeCount,retweetCount,replyCount,bookmarkCount,text. The rows showed two things worth knowing before you compare accounts:

  • All ten posts came from @NASA. maxItems caps the whole run, not each handle, and the first handle filled it.
  • Reposts arrive with their originals. Four of the ten rows were reposts, and for each one the Actor also saved the original post as its own row, under that account's name. Only two rows were posts NASA wrote itself.

So the agent filtered on isRetweet and author.userName, then ran @SpaceX on its own with "maxItems": 5. That second run took 5.2 seconds and returned five posts, all by SpaceX. Together, the seven original posts:

Account Posted (UTC) Post, first line Likes Reposts Replies Bookmarks
@SpaceX Oct 25, 19:49 Full duration 33-engine static fire for the Super Heavy booster preparing for Flight 15 17,249 2,143 699 967
@SpaceX Oct 22, 22:40 Watch Falcon 9 launch 27 @Starlink satellites to orbit from California 10,475 1,398 583 640
@SpaceX Oct 23, 23:51 Deployment of 27 @Starlink satellites confirmed 10,402 543 287 95
@SpaceX Oct 24, 00:14 Falcon 9 launches 27 @Starlink satellites from California 9,627 1,017 462 195
@SpaceX Oct 23, 22:37 Watch Falcon 9 launch 27 @Starlink satellites to orbit from California 5,883 756 420 273
@NASA Oct 23, 23:37 We are not slowing down. 7,610 998 362 353
@NASA Oct 25, 22:30 Have you put up your Halloween decor? The night sky will add the finishing touch. 5,378 950 249 287

The agent's answer: SpaceX's five posts averaged 10,727 likes and NASA's two averaged 6,494, although NASA has 2.2 times the followers (92,311,322 against 41,937,846). The Super Heavy static-fire video led with 17,249 likes, about 0.04% of SpaceX's followers; NASA's Artemis update led its pair with 7,610, about 0.008% of NASA's. Neither response carried view counts, which matches the Actor's README: profile timeline pages often leave them out.

The cost: 15 posts × $0.00038 = $0.0057 at list price, platform usage included. Our account was billed $0.00456 after its plan's Store discount. Reading the same 15 posts through X's API at $0.005 per post read would be $0.075, about 13 times as much.

Prompts that work well

Say which Actor to use, how many posts you want, and a spending cap:

  • "Use scrapely to get @NASA's posts since 1 October with at least 1,000 likes and summarize the topics."
  • "Run echofield/tweet-scraper on this post URL and list the replies on its public page by like count."
  • "Search X for 'Starship Flight 15', sort Top, 20 posts, and sort them into positive, neutral and negative."
  • "Compare @SpaceX and @NASA over their last 20 posts each, one handle per run, counting only their own posts."
  • "Keep every run under $0.10."

The agent turns the last line into callOptions.maxTotalChargeUsd, which ends the run cleanly at that amount. The sentiment prompt is the start of a bigger workflow, covered in our guide to Twitter sentiment analysis.

What your agent can and can't get from X

The Tweet Scraper sees what X shows a logged-out visitor. Plan around these edges:

  • Reading, not posting. The Actor never signs in, so posting, DMs, likes and bookmarks are out of scope, and your X account is never part of a run.
  • Latest search trails live X. Keyword search sorted Latest goes through a search index of public x.com posts and runs typically a few hours behind, so posts from the last hour or two may be missing. To see what an account is posting right now, give the handle: that reads the timeline directly.
  • View counts are patchy. viewCount appears only when X's response includes it, and profile timelines often don't, as both of our runs showed.
  • maxItems is per run. When you compare accounts, run one handle per call or raise the cap.
  • Reposts bring their originals. Filter on isRetweet and the author before you average anything.
  • Failed inputs cost nothing. An unavailable account or a closed list is listed in the run's OUTPUT record under failedInputs, with a short reason such as user_unavailable, and isn't charged.
  • Private people are personal data. Brands and agencies posting publicly are one thing; replies and reposted accounts are often individuals. This article names only @NASA and @SpaceX, the two verified accounts in our input.

Spending control for agents that run on their own

  • A cap on every run. maxTotalChargeUsd covers everything the run can cost, and the Tweet Scraper stops cleanly when it hits the cap, keeping what it saved.
  • Scoped keys. Give an unattended agent its own API key under Settings → API & Integrations → API keys, with only actors:run and runs:read and a daily charge limit.
  • A prepaid balance. Runs draw from your balance, so a looping agent can't run up an invoice.
  • No account at all. Agents can also pay per call in USDC with x402, without a Scrape.ly account.

The agent reads public posts that X shows anyone without an account, and Scrape.ly Store Actors collect only publicly available data. X sets its own rules on automated access in its terms, and how they bind you depends on where you are and what you do with the data. Posts by private people are personal data under the GDPR, the CCPA and similar laws, so collect what you need and keep it for as long as you need it. Our guide to scraping Twitter covers X's terms in more detail. This is not legal advice.

The same server reaches other platforms through their own Actors: see Instagram MCP, LinkedIn MCP and our roundup of the best MCP servers for web scraping.

FAQ

Is there an MCP for Twitter?

Yes, of three kinds. X runs its own hosted X MCP at api.x.com/mcp, which uses your X developer app and bills each call at X API rates. Open-source servers such as EnesCinr/twitter-mcp run on your machine with your API keys. The Scrape.ly MCP server runs a scraper on public posts and needs no X credentials at all.

Is the X MCP server free?

Connecting to X's server costs nothing, but every tool call is an X API call: $0.005 per post read and $0.010 per user read at X's pay-per-use rates. The Scrape.ly server is free to connect too, and posts cost $0.38 per 1,000 with platform usage included.

Can I get the Twitter API for free?

X's API is pay-per-use. Its pricing page offers $20 in API credits once you save a payment card and make your first credit purchase, plus a match of your first auto-recharge up to $50. For read-only research on public posts, the $5 that Scrape.ly's free plan includes each month covers about 13,000 posts, with no X account.

Can my AI agent post tweets through this server?

No. The Tweet Scraper reads public posts and never signs in to X. Posting from your account is a job for X's own API and a developer app you control.

What is the Twitter MCP server URL?

For Scrape.ly it's https://mcp.scrape.ly, the same for every client. Add ?actors=echofield/tweet-scraper to give the agent only the X tool.

Does it work with Claude and ChatGPT?

Yes. Claude Code, Claude Desktop, ChatGPT, Cursor, VS Code and Windsurf all connect to https://mcp.scrape.ly over streamable HTTP, with OAuth or a Bearer token.

  • twitter mcp
  • x mcp
  • mcp
  • ai agents
  • claude
  • cursor
  • twitter

About the author

The team behind Scrape.ly

Scrape.ly is the web data platform from TeraShift GmbH in Switzerland, powered by Evomi: ready-made scrapers in the Scrape.ly Store, a cloud runtime, an API with JavaScript and Python SDKs, proxies, a hosted anti-bot browser and an MCP server for AI agents.

//Keep reading\\

The internet is full of data.
Start owning yours.

Scrape.ly gives you the infrastructure, the tooling, and the team to extract, process, and operationalize web data at any scale. Setup takes minutes.

No credit card. No setup calls.