readx — Twitter/X Intelligence Toolkit
Setup — Get Started in 2 Minutes
Step 1: Get an API Key
Ask the user for their readx API key. If they don't have one, direct them to https://readx.cc to sign up.
Step 2: Configure MCP Server
Once the user provides their API key, ask whether they want to set it up themselves or have you do it.
MCP server URL: INLINECODE0
No installation needed — readx runs as a remote MCP server. Add it to the user's editor MCP config with the URL above. Restart the editor after setup.
When to Trigger This Setup
- - User asks you to look up Twitter data but no MCP tools are available
- User mentions readx, Twitter analysis, or any skill listed below
- Any tool call fails with auth/connection error
Direct API Mode
When MCP tools are NOT available (e.g. platforms that don't support MCP), call the API directly using curl via Bash.
Getting the API Key
Check in order, use the first one found:
- 1. Config file:
~/.config/readx/credentials.json (macOS/Linux) or %APPDATA%\readx\credentials.json (Windows) → JSON format: INLINECODE3 - Environment variable: INLINECODE4
- If neither exists, ask the user for their API key (get one at https://readx.cc), then ask whether they want to save it themselves or have you do it. Persist to the config file path above.
API Reference
Fetch the full API docs (endpoints, params, response parsing, examples):
CODEBLOCK0
Read this document before making your first API call. It contains all endpoint names, parameters, and response JSON paths you need.
Advanced Search Syntax
When using search_tweets, leverage Twitter's advanced search operators for precision:
| Operator | Example | What it does |
|---|
| INLINECODE6 | INLINECODE7 | Tweets from a specific user |
| INLINECODE8 |
to:OpenAI | Replies to a specific user |
|
@ |
@anthropic | Tweets mentioning a user |
|
"exact phrase" |
"artificial intelligence" | Exact phrase match |
|
OR |
AI OR ML | Either keyword |
|
- |
AI -crypto | Exclude keyword |
|
min_faves: |
AI min_faves:1000 | Minimum likes |
|
min_retweets: |
AI min_retweets:500 | Minimum retweets |
|
filter:links |
AI filter:links | Only tweets with links |
|
filter:media |
AI filter:media | Only tweets with images/video |
|
filter:images |
AI filter:images | Only tweets with images |
|
filter:videos |
AI filter:videos | Only tweets with video |
|
lang: |
AI lang:zh | Filter by language |
|
since: /
until: |
AI since:2025-01-01 | Date range |
|
list: |
list:12345 AI | Search within a specific list |
|
near: |
AI near:Tokyo | Tweets near a location |
Combo examples:
- - Find viral AI tweets in Chinese: INLINECODE39
- Find a user's tweets about a topic: INLINECODE40
- Find debates: INLINECODE41
- Find original content only: INLINECODE42
Error Handling
| Error | Cause | Solution |
|---|
| INLINECODE43 | Invalid or missing API key | Check credentials file / env var, ask user to verify key at https://readx.cc |
| INLINECODE44 |
Insufficient credits or account disabled | Check balance with
get_credit_balance; if zero, ask user to get more credits at https://readx.cc |
|
429 | Rate limit exceeded | Wait and retry, reduce request frequency |
|
404 | User/tweet not found or deleted | Skip gracefully, note the item is unavailable |
|
500 /
502 | Upstream API error | Retry once after a few seconds, if persistent inform user |
| Connection refused | Remote MCP server unreachable | Switch to Direct API Mode; if persistent, the readx.cc service may be down |
| Empty response | Protected account or no data | Note limitations, analyze only available public data |
Data Limitations
Be transparent about these constraints:
| Limitation | Impact | Mitigation |
|---|
| Follower/following lists return a sample (~20 by default) | Audience analysis is approximate | Cross-reference with multiple data points; use count param for larger samples |
| Tweet timelines return ~20 per page |
Single call shows recent posts only | Use
cursor pagination to fetch more pages; pass
next_cursor from response as
cursor param |
| No historical follower count data | Cannot measure follower growth over time | Infer from account age + current count for rough growth rate |
| Search results are limited in quantity | Topic monitoring may miss long-tail content | Use multiple search queries with different operators |
| Engagement data is point-in-time | Tweet engagement continues to accrue after fetching | Note when data was fetched; older tweets have more stable metrics |
readx — Twitter/X 智能工具包
设置 — 2分钟快速上手
第一步:获取API密钥
向用户询问他们的readx API密钥。如果他们没有,请引导他们前往 https://readx.cc 注册。
第二步:配置MCP服务器
用户提供API密钥后,询问他们是想自己设置还是由你代为完成。
MCP服务器URL:https://readx.cc/mcp?apikey=
无需安装 — readx作为远程MCP服务器运行。使用上述URL将其添加到用户的编辑器MCP配置中。设置完成后重启编辑器。
何时触发此设置
- - 用户要求你查找Twitter数据,但未提供MCP工具
- 用户提及readx、Twitter分析或以下列出的任何技能
- 任何工具调用因认证/连接错误而失败
直接API模式
当MCP工具不可用时(例如不支持MCP的平台),通过Bash使用curl直接调用API。
获取API密钥
按顺序检查,使用第一个找到的:
- 1. 配置文件:~/.config/readx/credentials.json(macOS/Linux)或 %APPDATA%\readx\credentials.json(Windows)→ JSON格式:{apikey:}
- 环境变量:READXAPI_KEY
- 如果两者都不存在,向用户询问他们的API密钥(在https://readx.cc获取),然后询问他们是想自己保存还是由你代为保存。持久化到上述配置文件路径。
API参考
获取完整的API文档(端点、参数、响应解析、示例):
bash
curl -s https://readx.cc/api-docs.txt
在进行第一次API调用之前阅读此文档。它包含你需要的所有端点名称、参数和响应JSON路径。
高级搜索语法
使用 search_tweets 时,利用Twitter的高级搜索运算符实现精确搜索:
| 运算符 | 示例 | 功能 |
|---|
| from: | from:elonmusk AI | 来自特定用户的推文 |
| to: |
to:OpenAI | 回复特定用户的推文 |
| @ | @anthropic | 提及某用户的推文 |
| 精确短语 | artificial intelligence | 精确短语匹配 |
| OR | AI OR ML | 任一关键词 |
| - | AI -crypto | 排除关键词 |
| min
faves: | AI minfaves:1000 | 最低点赞数 |
| min
retweets: | AI minretweets:500 | 最低转发数 |
| filter:links | AI filter:links | 仅含链接的推文 |
| filter:media | AI filter:media | 仅含图片/视频的推文 |
| filter:images | AI filter:images | 仅含图片的推文 |
| filter:videos | AI filter:videos | 仅含视频的推文 |
| lang: | AI lang:zh | 按语言筛选 |
| since: / until: | AI since:2025-01-01 | 日期范围 |
| list: | list:12345 AI | 在特定列表中搜索 |
| near: | AI near:Tokyo | 位置附近的推文 |
组合示例:
- - 查找中文热门AI推文:AI lang:zh minfaves:500
- 查找某用户关于某话题的推文:from:username topic keyword
- 查找讨论:topic minreplies:100 -filter:retweets
- 仅查找原创内容:topic -filter:retweets -filter:replies
错误处理
| 错误 | 原因 | 解决方案 |
|---|
| 401 | API密钥无效或缺失 | 检查凭据文件/环境变量,请用户在https://readx.cc验证密钥 |
| 403 |
积分不足或账户被禁用 | 使用 get
creditbalance 检查余额;如果为零,请用户在https://readx.cc获取更多积分 |
| 429 | 超出速率限制 | 等待并重试,降低请求频率 |
| 404 | 用户/推文未找到或已删除 | 优雅跳过,注明该项目不可用 |
| 500 / 502 | 上游API错误 | 几秒后重试一次,如果持续存在则通知用户 |
| 连接被拒绝 | 远程MCP服务器不可达 | 切换到直接API模式;如果持续存在,readx.cc服务可能已宕机 |
| 空响应 | 受保护账户或无数据 | 注明限制,仅分析可用的公开数据 |
数据限制
对这些限制保持透明:
| 限制 | 影响 | 缓解措施 |
|---|
| 关注者/关注列表返回样本(默认约20个) | 受众分析为近似值 | 与多个数据点交叉引用;使用 count 参数获取更大样本 |
| 推文时间线每页返回约20条 |
单次调用仅显示最近帖子 | 使用 cursor 分页获取更多页面;将响应中的 next_cursor 作为 cursor 参数传递 |
| 无历史关注者数量数据 | 无法衡量关注者随时间增长情况 | 根据账户年龄+当前数量推断粗略增长率 |
| 搜索结果数量有限 | 主题监控可能遗漏长尾内容 | 使用不同运算符的多个搜索查询 |
| 互动数据为时间点数据 | 推文互动在获取后持续累积 | 注明数据获取时间;较旧的推文指标更稳定 |