Use X/Twitter data in Claude, ChatGPT & Cursor (MCP)
RelayX runs a Model Context Protocol server. Once it is connected, your AI assistant can call RelayX directly (look up profiles, read tweets, run searches) and answer with live X/Twitter data. You write no glue code. For the overview, see the MCP page.
Endpoint: https://api.relayxapi.com/mcp (streamable HTTP)
Connect
Section titled “Connect”There are two ways to authenticate:
- OAuth (Claude, ChatGPT, and optionally Claude Code or Cursor): the client opens a RelayX sign-in page, and you pick which of your API keys it may spend. The key itself never reaches the client.
- API-key header (Claude Code, Cursor): send
Authorization: Bearer YOUR_KEY.
Claude Code
Section titled “Claude Code”claude mcp add --transport http relayx https://api.relayxapi.com/mcpRun /mcp in Claude Code to sign in and choose a key. To use a key directly instead, add
--header "Authorization: Bearer YOUR_KEY" to the command.
Cursor
Section titled “Cursor”Add this to ~/.cursor/mcp.json, or use the one-click install on the MCP page:
{ "mcpServers": { "relayx": { "url": "https://api.relayxapi.com/mcp" } }}To use a key instead of OAuth, add "headers": { "Authorization": "Bearer YOUR_KEY" }.
Claude (claude.ai / Claude Desktop)
Section titled “Claude (claude.ai / Claude Desktop)”- Go to Settings → Connectors → Add custom connector.
- Paste the endpoint URL.
- Claude registers itself and opens the RelayX sign-in page. If you are already signed in to the dashboard, you go straight to the key picker.
ChatGPT
Section titled “ChatGPT”- Enable developer mode.
- Add a connector with the endpoint URL and OAuth authentication.
- Start a new chat. Tools show up only in chats started after the connector was added.
Deep research uses the search and fetch tools.
The server exposes 29 read-only tools. They map one-to-one to the REST reference:
| Area | Tools |
|---|---|
| Users | user_info, user_about, user_batch_info_by_ids, user_search, user_last_tweets, user_tweet_timeline, user_mentions, user_followers, user_followers_ids, user_followings, user_verified_followers, user_check_follow_relationship |
| Tweets | tweets, tweet_advanced_search, tweet_replies, tweet_replies_v2, tweet_quotes, tweet_retweeters, tweet_thread_context |
| Lists & communities | list_tweets_timeline, list_members, list_followers, community_info, community_tweets |
| Other | spaces_detail, trends, account_credits (free) |
| ChatGPT connector | search, fetch |
Paged tools return has_next_page and next_cursor. The assistant passes next_cursor back as
cursor to get the next page.
Example prompts
Section titled “Example prompts”- “What has @nasa posted this week? Summarise the main topics.”
- “Find tweets from the last 7 days mentioning
mcp serverwith at least 100 likes.” - “Does @alice follow @bob?”
- “Who are the most-followed accounts that retweeted this tweet: https://x.com/…”
- “How many RelayX credits do I have left?”
The search syntax cheatsheet applies to tweet_advanced_search as well.
Billing
Section titled “Billing”Each tool call spends credits from your account at the same per-item rates as the REST API. See
Credits in practice and the pricing page.
account_credits is free. Failed calls are not charged.
Tip: ask the assistant to “only fetch the first page” when you don’t need everything. The assistant decides how far to page, and every page costs credits.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Fix |
|---|---|
| Tools don’t appear in ChatGPT | Start a new chat after adding the connector |
401 in Claude Code / Cursor |
Re-run /mcp to sign in again, or check the Authorization header |
402 / “not enough credits” |
Top up in the dashboard |