X (Twitter) MCP server for your agent
To give Claude, Cursor, ChatGPT or another MCP client X (Twitter) data, add Apify's hosted MCP server with the Actors ticked below as tools (6 by default); the URL is in every config. Sign in with your Apify account or pass an API token; each call runs the Actor and returns X (Twitter) records to the agent.
One click, signs in with Apify on first use:
Any other client, one command (writes the config for 25+ agents, including Windsurf, Zed, Cline and Goose):
npx add-mcp "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader" --name apify - Catalogue Actors
- 12
- In this bundle
- 6
- Official API
- Public
- Data checked
- 2026-11-12
Config for your client
Claude Code configterminal or .mcp.json
claude mcp add --transport http apify "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader" - Run the command in your project folder. Add --scope user to make it available in every project.
- Start Claude Code, type /mcp, pick the server and sign in to Apify in the browser window.
- No browser sign-in? Add --header "Authorization: Bearer YOUR_APIFY_TOKEN" to the command instead.
Sign-in: OAuth sign-in on first use, or a token header.
Claude Desktop configclaude_desktop_config.json
{
"mcpServers": {
"apify": {
"command": "npx",
"args": [
"-y",
"@apify/actors-mcp-server",
"--tools",
"fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader"
],
"env": {
"APIFY_TOKEN": "YOUR_APIFY_TOKEN"
}
}
}
} - Easiest: open Customize, then Connectors, choose Add custom connector, paste the server URL (the ChatGPT tab shows it on its own) and sign in to Apify.
- Local alternative (needs Node.js): merge this into claude_desktop_config.json (Settings, Developer, Edit config) and replace YOUR_APIFY_TOKEN.
- Restart Claude Desktop and enable the server from the tools menu in a chat.
Sign-in: Connector with OAuth, or a token in the local config.
Cursor config~/.cursor/mcp.json
{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader",
"headers": {
"Authorization": "Bearer ${env:APIFY_TOKEN}"
}
}
}
} - Save as ~/.cursor/mcp.json for every project, or .cursor/mcp.json for one project. Merge with servers you already have.
- Set APIFY_TOKEN in the environment Cursor starts from, or replace ${env:APIFY_TOKEN} with your token.
- Open Cursor Settings, then MCP, and check that the server lists its tools.
Sign-in: Token read from the APIFY_TOKEN environment variable.
VS Code config.vscode/mcp.json
{
"inputs": [
{
"type": "promptString",
"id": "apify-token",
"description": "Apify API token",
"password": true
}
],
"servers": {
"apify": {
"type": "http",
"url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader",
"headers": {
"Authorization": "Bearer ${input:apify-token}"
}
}
}
} - Save as .vscode/mcp.json in your workspace.
- Start the server from the file or the MCP servers view. VS Code asks for the token once and stores it securely.
- Use the tools from Copilot Chat in agent mode.
Sign-in: Token prompted once and stored by VS Code.
ChatGPT configPlugins > Add custom MCP server
https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader - In ChatGPT on the web, open Plugins, select + and choose Add custom MCP server.
- Name it, paste the URL under Connection as the Server URL and choose OAuth for authentication.
- Accept the risk warning (I understand and want to continue), select Create as a plugin, then install the plugin from your plugins, sign in to Apify and use it in a new chat.
Sign-in: OAuth sign-in with your Apify account.
Codex CLI config~/.codex/config.toml
[mcp_servers.apify]
url = "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader"
bearer_token_env_var = "APIFY_TOKEN" - Add the block to ~/.codex/config.toml, or .codex/config.toml in a project.
- Export APIFY_TOKEN in the shell that starts Codex. Or skip the token line and run codex mcp login to sign in.
- Start codex and type /mcp to check that the tools are listed.
Sign-in: Token read from the APIFY_TOKEN environment variable.
Gemini CLI configterminal (writes ~/.gemini/settings.json)
gemini mcp add -t http -s user -H "Authorization: Bearer $APIFY_TOKEN" apify "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader" - Export APIFY_TOKEN first: the shell expands it and Gemini CLI saves the header, token included, in plain text in ~/.gemini/settings.json (keep that file private). In PowerShell write $env:APIFY_TOKEN instead of $APIFY_TOKEN. Drop -s user to save it in the project's .gemini/settings.json.
- Start gemini and type /mcp to check that the server is connected and lists its tools.
- Saved by hand, a remote server uses the httpUrl key for streamable HTTP (url means the older SSE transport).
Sign-in: Token header saved by gemini mcp add.
n8n AI Agent configMCP Client Tool node
https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/x-twitter-keyword-and-hashtag-tweet-search,nimbryxo-studio/x-twitter-profile-and-post-engagement-extractor,vexaloom-labs/x-keyword-search-with-mention-and-reply-operators,vexaloom-labs/x-post-reply-and-profile-lookup-by-link-or-id,nimbryxo-studio/x-trends-lookup-by-country-city-and-woeid,dataspryva/twitter-x-media-downloader - Add an AI Agent node, then attach an MCP Client Tool node to its tool input.
- Paste the URL as the endpoint and choose HTTP Streamable as the transport.
- Choose Bearer auth and create a credential that holds your Apify token.
Sign-in: Bearer auth credential.
Validated, not executed: 7 of 7 checks pass
- Uses Apify's hosted MCP endpoint over HTTPS
- The tools parameter lists exactly the chosen Actors as owner/name
- JSON configs parse and use the client's top-level key and the same URL
- Codex TOML has a [mcp_servers.<name>] table with url and bearer_token_env_var
- CLI commands quote the same URL and use the streamable HTTP transport
- One-click install links decode back to the same URL and carry no token
- Only placeholders, no real token
Official API or an Actor?
X (Twitter) has a public official API
X API v2 uses prepaid pay-per-usage credits. Published standard read rates include $0.005 per Post resource and $0.010 per User resource. Pay-per-use launched on February 6, 2026; legacy Basic and Pro plans migrated to pay-per-use.
Charged per resource returned: $0.005 per Post, $0.010 per User. Owned Reads on qualifying own-account endpoints are $0.001 per resource. A 3 million Post-read monthly cap applies to self-serve pay-per-use.
Spending limits are configurable. Enterprise access is required above the monthly cap.
X content and API use are governed by the X Developer Agreement. Do not bypass logins or access controls; not legal advice.
Which Actor for which job
- Twitter (X) Media Downloader fits downloading media from public post links or usernames without an X login or cookies; its output includes
mediaTypeandmediaUrl. - X Broadcast Viewer History & Replay Link Scraper fits collecting broadcast metadata, viewer timelines, public chat and replay information; its output includes
stateandviewersTotal. - Twitter (X) Screenshot Generator fits capturing public posts and profiles as saved images; its output includes
targetUrlandcaptureMode. - X Article Announcement Post Metadata Collector fits collecting article previews and announcement-post context from an article or post link; its output includes
bodyAvailableandsourceTweetUrl. - X Community Activity & Member Finder fits examining public community rules, posts and available member context; its output includes
communityNameandmemberCount. - X Keyword Search with Mention & Reply Operators fits finding posts with mention or reply constraints and retaining conversation context; its output includes
searchTermandreplyCount. - X Post, Reply & Profile Lookup by Link or ID fits resolving known post links, identifiers or handles; its output includes
textandviewCount. Add it to the MCP tool list before requesting a lookup. - X Trends Lookup by Country, City & WOEID fits comparing ranked trends across supported locations; its output includes
locationandtrend. Add it to the MCP tool list before requesting trends.
Where it stops
These tools cover public X content and do not establish access to protected posts or private messages. Article-announcement metadata does not guarantee article body text, and an empty keyword search writes a run summary to the key-value store rather than a status row. Your own Apify API token is required for token-based configurations; it does not authorize an X account through OAuth. Recipe for Agents has not authenticated with Apify or X for you. Direct use of the official X API requires separate access and prepaid usage credits.
Every X (Twitter) Actor in the catalogue
| Actor | Returns | Fields | Store price | Last update |
|---|---|---|---|---|
| Twitter (X) Media Downloader | Download videos, photos, GIFs, audio and poster images from public Twitter/X posts - no login, no cookies. Works with post links or… Fields include tweetId, tweetUrl, mediaType. | 34 | $0.99 per 1,000 results | 2026-10-29 |
| X Broadcast Viewer History & Replay Link Scraper | One row per X broadcast, viewer-timeline point, public chat message, or status row, with metadata, viewer statistics, HLS replay… Fields include title, state, viewersNow. | 8 | $0.99 per 1,000 results | 2026-10-25 |
| Twitter (X) Screenshot Generator | Screenshot capture records for public X posts and profiles, with image dimensions, format, and download link, plus the saved image files. Fields include targetUrl, profileUrl, captureMode. | 59 | $0.99 per 1,000 results | 2026-11-09 |
| X Article Announcement Post Metadata Collector | Turn an X (Twitter) Article's announcement post or article link into structured metadata: title, preview text, cover image, publish date… Fields include title, articleId, bodyAvailable. | 6 | $0.99 per 1,000 results | 2026-10-18 |
| X Community Activity & Member Finder | Community profile, rules, top/media posts with engagement metrics, and optional creator, moderator, facepile and active-member rows from a… Fields include communityName, name, text. | 21 | $0.99 per 1,000 results | 2026-11-02 |
| X Keyword Search with Mention & Reply Operators | X posts with full text, author profile, engagement counters, media, quoted post and reply context. Empty runs write a RUN_SUMMARY to the… Fields include text, createdAt, language. | 21 | $0.99 per 1,000 results | 2026-11-05 |
| X Post, Reply & Profile Lookup by Link or ID | X posts, replies, and profile rows resolved from the links, IDs, or handles you supplied. Fields include text, createdAt, likeCount. | 9 | $0.99 per 1,000 results | 2026-10-19 |
| X Trends Lookup by Country, City & WOEID | Ranked X trends per location, with trend type, search links, cross-location overlap and catalog metadata, plus location-list rows and… Fields include location, trend, trendType. | 10 | $0.99 per 1,000 results | 2026-11-02 |
| X Video Subtitle & Caption Transcript Converter | Per-video transcript records with timestamped segments, full transcript text, timestamped text, RAG chunks, SRT/VTT subtitle output and… Fields include tweetUrl, tweetId, videoIndex. | 29 | $0.99 per 1,000 results | 2026-11-09 |
| X/Twitter Keyword & Hashtag Tweet Search | Tweets found for your keywords — text, author, engagement metrics, media and the search term that found each row. Fields include text, createdAt, language. | 18 | $0.99 per 1,000 results | 2026-11-09 |
| Twitter (X) Space Scraper | Space metadata, participant rows, transcripts and downloadable replay audio collected from public X Spaces. Fields include title, state, listenersLive. | 8 | $0.99 per 1,000 results | 2026-11-07 |
| X (Twitter) Profile & Post Engagement Extractor | One profile row per account, one post row per collected post (cursor-paged up to maxPostsPerProfile), and status rows for protected… Fields include message, username, name. | 29 | $0.99 per 1,000 results | 2026-10-29 |
Call these Actors from code: the X (Twitter) data API page
Store links: twitter-x-media-downloader, x-broadcast-viewer-history-and-replay-link-scraper, twitter-x-screenshot-generator, x-article-announcement-post-metadata-collector, x-community-activity-and-member-finder, x-keyword-search-with-mention-and-reply-operators, x-post-reply-and-profile-lookup-by-link-or-id, x-trends-lookup-by-country-city-and-woeid, x-video-subtitle-and-caption-transcript-converter, x-twitter-keyword-and-hashtag-tweet-search, twitter-x-space-scraper, x-twitter-profile-and-post-engagement-extractor
X (Twitter) recipes for n8n
X (Twitter) keyword posts to Google Sheets
Log the latest public X posts for your keywords or hashtags in a Google Sheet once each, with author, likes…
X (Twitter)Google Sheets
Troubleshooting
Why does the client say Unauthorized or invalid token?
Every Apify Actor tool needs a signed-in Apify account. Reconnect the server so the OAuth sign-in runs again, or switch to the token variant: an Authorization: Bearer header with an API token from Apify Console, Settings, API and integrations. For a local server the token must be in the server's own env block, not only in your shell.
Source: Apify MCP server README
Why did my agent's tool list change after an update?
Without a tools parameter Apify's server loads its default tool set, which changes between releases. The URLs on this site pin the tools with ?tools=, so the agent always gets the same Actor tool plus fetch-actor-details. Apify's README gives the same advice for production.
Source: Apify MCP server README
What happens when the agent sends input the Actor rejects?
The server answers with the Actor's input schema, so the agent can fix the arguments and call again. The fetch-actor-details tool in every scoped URL lets it read that schema before the first call.
Source: Apify MCP server README
Claude Code shows Needs authentication. Why?
The server is added but not signed in. Type /mcp in an interactive session and authenticate, or run claude mcp login with the server name. Headless runs with claude -p cannot complete OAuth, so sign in once interactively or use the --header token variant.
Source: Claude Code MCP documentation
Claude Code warns that a tool result is too large. What can I change?
Claude Code warns above 10,000 tokens of tool output and caps it at 25,000 by default (MAX_MCP_OUTPUT_TOKENS raises it). Ask the agent for fewer results per call, for example a lower result limit for the Actor.
Source: Claude Code MCP documentation
Cursor does not show the server's tools. What should I check?
Open the Output panel and pick MCP Logs to see the connection error. A deeplink install that does nothing usually means an older Cursor build; update it or paste the JSON into mcp.json by hand.
Source: Cursor MCP documentation
Questions
How do I bring public X posts into Claude?
Install the X MCP configuration in Claude and authenticate access to Apify. Choose X Keyword Search with Mention & Reply Operators for discovery, or add X Post, Reply & Profile Lookup by Link or ID for known links and handles.
Is my Apify token also an X login?
An Apify API token authorizes Apify requests rather than an X OAuth session. Recipe for Agents has not authenticated either account on your behalf.
Can Claude save images and videos from X?
Twitter (X) Media Downloader retrieves available media from public posts using post links or usernames. Twitter (X) Screenshot Generator serves a different job by saving captures of public posts and profiles.
Can I get the full text of an X Article?
X Article Announcement Post Metadata Collector covers article previews and the associated announcement post.
Sources
- Apify MCP server documentation, checked 2026-11-10
- X API v2 documentation, checked 2026-11-09
- X API v2 pricing
- docs.x.com/changelog, checked 2026-11-09
- X (Twitter) terms