X Tools for Claude MCP
Claude MCP 的 X 工具
一个轻量级的开源工具包,使 Claude 能够使用自然语言高效地搜索 Twitter,并根据用户意图显示结果。它专为查看原始数据和进行可选分析而设计。
特征
自然语言搜索:让 Claude 用简单的英语搜索 Twitter
Twitter 搜索:使用自然语言或高级 Twitter 语法搜索推文
专业格式:清晰、markdown 格式的推文显示
灵活的输出:显示原始推文或根据您的要求添加分析
高级过滤:按关键词、用户、日期、参与度指标等查找推文
分页支持:需要时,每次搜索可检索超过默认的 20 条推文
Related MCP server: twitter-mcp
安装
先决条件
Node.js v16+
克劳德桌面版
免费的 RapidAPI 密钥,可访问“The Old Bird API”(Twitter154)端点
RapidAPI 密钥设置
如果您没有 RapidAPI 帐户,请注册一个
订阅 API(有免费套餐可用)
订阅后,从仪表板复制您的 RapidAPI 密钥
设置步骤
克隆此存储库:
git clone https://github.com/0xGval/twitter-X-mcp-server cd twitter-X-mcp-tools安装依赖项:
npm install创建您的配置:
将
mcp.json.example复制到 Claude Desktop 目录中的mcp.json编辑
mcp.json以包含您的 RapidAPI 密钥和正确的文件路径
{ "mcpServers": { "x-tools": { "command": "node", "args": ["YOUR_ABSOLUTE_PATH_TO/main.js"], "env": { "RAPIDAPI_KEY": "your_rapidapi_key" } } } }配置 Claude 桌面版:
在 Windows 上:将
mcp.json文件放在%APPDATA%\Claude\在 macOS 上:将
mcp.json文件放在~/Library/Application Support/Claude/将
claude-rules.md和knowledge/TwitterSearchSyntaxGuide.txt复制到你的 Claude 知识库目录重新启动 Claude Desktop 以使更改生效
可用工具
Twitter 搜索
该工具主要设计用于自然语言。只需让 Claude 在 Twitter 上搜索某个内容,它就会翻译你的请求。
searchTwitter(query: "keyword", section: "latest", limit: 20)使用自然语言或高级语法搜索 Twitter:
query:搜索查询(支持 Twitter 的高级搜索运算符)section:“最新”或“顶级”结果(默认值:“最新”)limit:返回的推文数量(默认值:20)
自然语言示例
简单查询
问克劳德:
Show me recent tweets about artificial intelligence以用户为中心的查询
问克劳德:
Find the latest tweets from Elon Musk that mention SpaceX复杂自然查询
问克劳德:
Search for tweets about climate change with at least 100 likes from the past month分析请求
问克劳德:
What's the sentiment around the new Bitcoin ETF based on recent tweets?直接语法示例
对于那些喜欢直接语法的人来说:
from:elonmusk spacex since:2023-01-01"artificial intelligence" filter:images min_faves:100climate action min_retweets:50 -filter:retweets所需文件
此工具包含几个必须正确设置的重要文件:
main.js :主应用程序文件
tools/twitter.js :Twitter 搜索实现
claude-rules.md :Claude 正确显示搜索结果的说明
knowledge/TwitterSearchSyntaxGuide.txt :Twitter 搜索语法参考指南
确保所有这些文件都放置在 Claude 设置中的正确位置。
搜索语法
该工具支持所有标准 Twitter 搜索运算符,Claude 可以通过您的自然语言应用这些运算符:
用户
from:username- 特定帐户发送的推文to:username- 回复特定帐户@username- 提及该帐户的推文
媒体和链接
filter:media- 包含任何媒体的推文filter:images- 带图片的推文filter:native_video- 带有视频的推文filter:links- 带链接的推文
日期
since:YYYY-MM-DD- 此日期之后的推文until:YYYY-MM-DD- 此日期之前的推文
订婚
min_retweets:n- 至少有 n 次转发的推文min_faves:n- 至少有 n 个赞的推文min_replies:n- 至少有 n 条回复的推文
故障排除
常见问题:
未找到 API 密钥:确保您的 RapidAPI 密钥在
mcp.json中正确设置路径错误:确保您使用完整的绝对路径,并在 Windows 中正确转义(
\\)无结果:请检查您的搜索查询是否有效且没有太多限制
Claude 行为问题:确保您拥有最新版本的
claude-rules.md,其中包含灵活的输出指令缺少文件:验证
claude-rules.md和TwitterSearchSyntaxGuide.txt是否已正确添加到您的 Claude 规则和知识库中
发展
要修改该工具:
编辑
tools/目录中的文件如果需要,更新
formatTwitterResults()函数中的格式重新启动 Claude for Desktop 即可看到更改
执照
该项目已获得 MIT 许可。
致谢
Anthropic 的模型上下文协议 (MCP)
RapidAPI Twitter154 API
Axios
佐德
注意:此工具旨在与 Claude AI 助手配合使用,并根据用户意图为 Twitter 搜索结果提供灵活的显示选项。
Available Tools
1 toolsearchTwitterD
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| section | No | latest | |
| limit | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
- First observed
searchTwitter
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool 'searchTwitter' stands alone with no other tools to confuse it with.
A single tool inherently has perfect naming consistency, as there are no other tool names to compare it against. The name 'searchTwitter' follows a clear verb_noun pattern.
One tool is too few for a server named 'X Tools for Claude MCP', which implies multiple tools. This minimal set feels thin and incomplete for any meaningful domain coverage, indicating a mismatch between the server's implied purpose and its actual tool surface.
The server is severely incomplete with only a single search tool. For a Twitter-related domain, obvious gaps include operations like posting tweets, managing followers, or accessing user profiles, making it impossible for agents to perform basic workflows beyond simple searches.
Maintenance
Related MCP Connectors
X/Twitter search, posts, comments, user profiles, user posts/replies and video transcripts.
Live X/Twitter data: profiles, tweets, search, followers, lists and trends. 29 read-only tools.
X/Twitter reads, search, monitors and posting. Pay-per-call in USDC — no signup, no API keys.
Read public Twitter/X data: tweets, profiles, followers, search. No X developer account.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables seamless interaction with Twitter/X platform through Claude AI, allowing users to post tweets with images, search for tweets, and engage in conversations using natural language commands.1048 npm26MIT
- AlicenseNot gradedqualityCmaintenanceA lightweight Twitter MCP server for Claude Code with 17 tools for reading and writing tweets, including search, user profiles, and media uploads, using a hybrid API approach.14 npm2ISC
- AlicenseNot gradedqualityDmaintenanceProvides AI agents and coding assistants with Twitter data access including tweets, user profiles, followers, and search functionality.MIT
- AlicenseBqualityDmaintenanceEnables users to interact with X/Twitter via Claude, allowing posting tweets, searching, liking, retweeting, and more using OAuth 2.0 PKCE authentication.107MIT