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 搜索结果提供灵活的显示选项。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables 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.107425MIT
- AlicenseNot gradedqualityDmaintenanceA 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.252ISC
- 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
Related MCP Connectors
X (formerly Twitter) posts, profiles, and search for AI agents. Free key, self-minted, no signup.
X (Twitter) profiles, tweets and single-tweet lookup by handle or URL. No login. Pay per result.
Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xGval/twitter-X-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server