---
title: "Twitter MCP Server: X Posts for Claude, Cursor | Scrape.ly"
description: "A Twitter MCP setup for Claude, Cursor and ChatGPT: public X posts and engagement, no developer app or API keys. Setup, real runs, tool calls and costs."
url: https://scrape.ly/blog/twitter-mcp
markdown: https://scrape.ly/blog/twitter-mcp.md
---

[AI agents](https://scrape.ly/blog/category/ai-agents.md)

# 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.

[Scrape.ly Team The team behind Scrape.ly](https://scrape.ly/blog/author/scrapely-team.md)

- Published

  Oct 26, 2026

- 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](https://scrape.ly/media/twitter-mcp.png?w=1080)

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](https://github.com/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](https://techcrunch.com/2026/06/30/x-now-offers-an-mcp-server-to-make-its-platform-easier-for-ai-tools-to-use/) as letting AI tools "communicate with the X API using a user's own account permissions". [X's MCP docs](https://docs.x.com/tools/mcp) 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](https://docs.x.com/x-api/getting-started/pricing): $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](https://scrape.ly/mcp.md) 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](https://scrape.ly/docs/mcp.md) 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:

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

## What the Tweet Scraper can read

X data in the [Scrape.ly Store](https://scrape.ly/store.md) comes from one Actor, the [Tweet Scraper](https://scrape.ly/store/echofield/tweet-scraper.md), 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](https://scrape.ly/api/twitter-x-api.md) 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](https://scrape.ly/blog/twitter-sentiment-analysis.md).

## 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.

## Is it legal to scrape X with an AI agent?

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](https://scrape.ly/blog/scrape-twitter.md) 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](https://scrape.ly/blog/instagram-mcp.md), [LinkedIn MCP](https://scrape.ly/blog/linkedin-mcp.md) and our roundup of the [best MCP servers for web scraping](https://scrape.ly/blog/best-mcp-servers-for-web-scraping.md).

Scrape.ly Store Give your agent public X posts Public posts from X profiles, post URLs and searches, with no X developer app: text, timestamps and engagement counts. $0.38 per 1,000 posts, and it works in Claude, Cursor, ChatGPT and every other MCP client.

[Try it free](https://scrape.ly/store/echofield/tweet-scraper.md) [Browse the Store](https://scrape.ly/store.md)

## 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.

About the author

[Scrape.ly Team](https://scrape.ly/blog/author/scrapely-team.md) 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.

- [Website](https://scrape.ly/index.md)

Keep reading

## More in AI agents

- [![Pixel-art robot with an orange >\_ on its terminal head carries a cable from a monitor showing the red YouTube logo above a video thumbnail and its title into a server rack labelled MCP](https://scrape.ly/media/youtube-mcp.png?w=750)](https://scrape.ly/blog/youtube-mcp.md)
  ### [YouTube MCP: Video, Channel and Comment Data for Claude, ChatGPT and Cursor](https://scrape.ly/blog/youtube-mcp.md)
  [A YouTube MCP server lets your AI agent read public videos, channels, captions and comments right in the chat. Connect Scrape.ly's hosted server to Claude, ChatGPT or Cursor without a YouTube Data API key or quota, and see the exact tool calls, real output and costs.](https://scrape.ly/blog/youtube-mcp.md)
- [![Pixel-art robot with an orange >\_ on its terminal head carries a cable from a cork job board topped with the blue Indeed logo and pinned with job cards into a server rack labelled MCP](https://scrape.ly/media/indeed-mcp.png?w=750)](https://scrape.ly/blog/indeed-mcp.md)
  ### [Indeed MCP: Job Listings for Your AI Agent, in Any MCP Client](https://scrape.ly/blog/indeed-mcp.md)
  [Indeed's own MCP server works only as a Claude connector and asks for your Indeed login. Scrape.ly's hosted MCP server gives Claude, ChatGPT, Cursor or any MCP client public Indeed jobs with pay, employer ratings and full descriptions. Setup, tool calls, a real run and costs.](https://scrape.ly/blog/indeed-mcp.md)
- [![Pixel-art robot with an orange >\_ on its terminal head feeds a Markdown file with an orange # heading into the slot of a dark box labelled LLM, next to a web page and a small stack of Markdown files](https://scrape.ly/media/website-to-markdown-for-llms.png?w=750)](https://scrape.ly/blog/website-to-markdown-for-llms.md)
  ### [RAG Web Scraping: How to Turn Any Website Into Markdown for LLMs](https://scrape.ly/blog/website-to-markdown-for-llms.md)
  [RAG web scraping turns a website into clean Markdown your model can retrieve from. A real 10-page crawl of the FastAPI docs shows why the HTML cleaner decides whether your code examples survive, plus tested chunking code, token counts and the cost per 1,000 pages.](https://scrape.ly/blog/website-to-markdown-for-llms.md)

## 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.

[Get Started Free](https://my.scrape.ly/register) [Chat with Support](mailto:hello@scrape.ly?subject=Question%20about%20Scrape.ly\&body=Hi%2C%20I%20have%20a%20question%20about%20Scrape.ly.)

No credit card. No setup calls.
