TwitterTools MCP

io.github.steleyv1.2.0更新于 Oct 7, 2026

Fetch public X posts and threads; count and split text with X's real rules. No login, no tracking.

概览

AI 生成的概览

让助手获取公开的 X 帖子和长推文串,并按 X 的真实规则统计或拆分文本。

功能
提供五个工具:get_tweet 按 URL 或 ID 获取公开帖子,返回文本、作者和媒体直链;get_thread 按顺序展开长推文串,并标记不完整结果;count_chars 按 X 的 280 字符上限统计文本,中日韩字符按 2 计、链接按 23 计;split_thread 把长文本拆成带编号且不超限的帖子;parse_tweet_url 把 URL 或 ID 解析为 ID、作者账号、发布时间和规范永久链接。前两个工具调用无状态的远程 API,通过 X 的 syndication 端点解析公开帖子;其余三个完全离线运行。
适用场景
适合助手需要在不登录的情况下读取公开 X 帖子或长推文串,或需要按 X 的真实字符规则起草并拆分帖子的场景。用于社交媒体调研、内容起草或链接解析流程时值得添加。
运行要求
通过 npx 以 stdio 方式在本地运行(npm 包 twittertools-mcp),需要 Node 18 或更高版本。get_tweet 和 get_thread 需要网络访问,默认调用 twittertools.com 的 API;可通过可选环境变量 TWITTERTOOLS_API_BASE 指向自建实例。无需账号或 API 密钥。
安装前请注意
两个获取工具会把请求的帖子 URL 或 ID 发送到所配置的 API 地址,默认是第三方服务;可设置 TWITTERTOOLS_API_BASE 让查询留在自己的基础设施上。该服务器被描述为无状态、无遥测,API 仅保留聚合的匿名计数。媒体不经代理,返回的 CDN 链接由客户端直接获取。

安装

在 SourceWeft 中

  1. 打开 控制台中的 TwitterTools MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

twittertools-mcp

Model Context Protocol server for TwitterTools — brings the toolkit to AI agents (Claude, ChatGPT, Cursor, ZCode, …). No login, no tracking, no API keys. Listed in the official MCP Registry as io.github.steley/twittertools-mcp.

Tools

ToolWhat it does
get_tweetFetch a public post by URL or ID: text, author, media with direct CDN URLs
get_threadUnroll a thread into its posts, in order (partial results are flagged)
count_charsMeasure text against X's real 280-character limit (CJK ×2, links = 23)
split_threadSplit long text into numbered, limit-fitting posts
parse_tweet_urlURL/ID → ID, author handle, posting time, canonical permalink

get_tweet / get_thread call the stateless twittertools.com API, which resolves public posts through X's free syndication endpoint. The other three run entirely offline. Media is not proxied: tweet results carry the direct pbs.twimg.com / video.twimg.com URLs, which any client can fetch on its own.

The package has zero dependencies: the MCP protocol layer is hand-rolled (line-delimited JSON-RPC over stdio), so the entire supply-chain surface is the couple hundred lines in this directory — verifiable against Socket or any scanner.

Install

sh
# Claude Codeclaude mcp add twittertools -- npx -y twittertools-mcp

Or add it to any client that reads an mcpServers config (Claude Desktop's claude_desktop_config.json, Cursor's .cursor/mcp.json, …):

json
{  "mcpServers": {    "twittertools": {      "command": "npx",      "args": ["-y", "twittertools-mcp"]    }  }}

Requires Node 18+.

Tip: npx resolves the latest version from the registry on every launch (instant once cached, a few seconds the very first time). For zero startup delay, npm i -g twittertools-mcp once and set "command": "twittertools-mcp".

Self-hosting

Point TWITTERTOOLS_API_BASE at your own instance of server/downloader_server.py to keep lookups entirely on your infrastructure:

json
{ "command": "npx", "args": ["-y", "twittertools-mcp"], "env": { "TWITTERTOOLS_API_BASE": "https://your-instance.example" } }

Privacy

The server is stateless: nothing is stored, no telemetry, no accounts. It talks only to the configured API base. The API itself is rate-limited per IP and keeps only aggregate, anonymous counters — see twittertools.com/privacy.

Development

sh
npm installcd .. && npx vitest run mcp   # unit + stdio protocol tests (offline, mock API)

MIT — same as the main project.

来源:mcp/README.md,提交 5540d11

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v1.2.0最新Oct 7, 2026