Mcp Server

io.twitterapiv1.0.0更新于 Oct 6, 2026

Official twitterapi.io hosted MCP: Twitter/X tweets, users, followers, trends. OAuth or API key.

概览

AI 生成的概览

让助手通过 twitterapi.io 读取 Twitter/X 数据:推文搜索、用户资料、关注者、回复、引用、转发者和趋势。

功能
这是 twitterapi.io 提供的托管 MCP 服务器,暴露 12 个只读工具,与供应商的生产接口一一对应。工具涵盖使用 Twitter 运算符的高级推文搜索、用户资料与 about 查询、关注者与关注列表、用户近期推文与提及、按 ID 批量获取推文、回复、引用推文、转发者,以及按地区查询热门趋势。返回列表的工具使用 next_cursor 字段分页,失败请求会以指数退避重试。
适用场景
适合助手需要最新 Twitter/X 数据做研究、监测或报告的场景:搜索某话题的近期帖子、查看账号资料或时间线、拉取关注者或互动列表,或查看某地区的热门趋势。它是只读的,适合分析而非发帖或账号管理。
运行要求
需要 twitterapi.io 的 API 密钥,通过环境变量 TWITTERAPI_IO_API_KEY 提供;服务器会把它放在 X-API-Key 请求头中发给供应商接口。README 展示用 npx 在本地安装(需要 Node.js),而注册信息列出远程端点 mcp.twitterapi.io。需要能访问 twitterapi.io 的网络。
安装前请注意
该 API 密钥属于凭据:每次工具调用都会把它发送给第三方服务 twitterapi.io,应视为可计费的机密,避免分享配置文件。查询内容以及你查看的账号或推文都会发送给该供应商。服务器按设计为只读,不包含发帖、点赞、转发、关注、私信、登录、媒体上传和账号删除。

安装

在 SourceWeft 中

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

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "mcp-server": {
      "type": "http",
      "url": "https://mcp.twitterapi.io/v1/mcp"
    }
  }
}

README

twitterapi.io MCP Server

[npm version] [MIT License] [MCP Spec 2025-11-25]

Official Model Context Protocol server for twitterapi.io — Twitter / X data API for AI agents and applications.

Connect Claude Desktop, Cursor, VS Code Copilot, or any MCP client to twitterapi.io and search tweets, fetch user profiles, get followers, replies, trends, and more — all from natural language.

Features

12 read-only tools mapped 1:1 to twitterapi.io's verified production endpoints:

ToolWhat it does
search_tweetsAdvanced search with Twitter operators (from:, since:, lang:, has:, …)
get_user_infoUser profile basics by screen name
get_user_aboutExtended profile / about page
get_user_followersFollowers with full profile metadata (paginated)
get_user_followingsFollowing list with profile metadata (paginated)
get_user_last_tweetsA user's recent tweets (timeline)
get_user_mentionsTweets that mention a user
get_tweets_by_idsBatch fetch tweets by ID (up to 100)
get_tweet_repliesReplies to a tweet
get_tweet_quotesQuote-tweets of a tweet
get_tweet_retweetersUsers who retweeted a tweet
get_trendsTrending topics by location (WOEID)

Quick Start

1. Get an API key

Sign up at twitterapi.io — free tier available.

2. Configure your MCP client

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "twitterapi-io": {      "command": "npx",      "args": ["-y", "@twitterapi_io/mcp-server"],      "env": {        "TWITTERAPI_IO_API_KEY": "your_key_here"      }    }  }}

Restart Claude Desktop. The 12 tools will be available in any chat — Claude will pick the right one based on your prompt.

Cursor

Open Settings → MCP → Add new MCP Server:

json
{  "mcpServers": {    "twitterapi-io": {      "command": "npx",      "args": ["-y", "@twitterapi_io/mcp-server"],      "env": {        "TWITTERAPI_IO_API_KEY": "your_key_here"      }    }  }}
VS Code (Copilot Chat with MCP)

Add to your MCP servers config — same shape as Claude Desktop / Cursor.

Claude Code
bash
claude mcp add twitterapi-io npx -- -y @twitterapi_io/mcp-server -e TWITTERAPI_IO_API_KEY=your_key_here

3. Use it

In any MCP-enabled chat:

"Find recent tweets from @elonmusk about AI in the last week"

"Get the follower list of @sama and show me the top 20 by follower count"

"What are the current trending topics in Japan?"

Claude (or your client) will automatically pick search_tweets / get_user_followers / get_trends and call them with the right parameters.

Authentication

Authentication is via the TWITTERAPI_IO_API_KEY environment variable, injected by your MCP client. The server never stores or logs the key. Each tool call sends the key in the X-API-Key header to https://api.twitterapi.io.

Pagination

Tools that return lists (followers, replies, search results, etc.) return a next_cursor field. Pass it back as the cursor argument on the next call to page through. Each page is typically ~20 items.

Error handling

  • 429 / 5xx responses are automatically retried with exponential backoff (3 attempts, 1s/2s/4s)
  • Network timeouts: 30s per request
  • 4xx errors (other than 429) surface immediately to the LLM with the original message

Tools — full spec

Each tool's input schema is exposed via MCP's tools/list and follows JSON Schema. Run npx @twitterapi_io/mcp-server with mcp-inspector to browse interactively:

bash
npx @modelcontextprotocol/inspector npx -y @twitterapi_io/mcp-server

What's NOT included

By design, this server exposes read-only endpoints. The following are intentionally excluded to keep the server safe for autonomous agent use:

  • ❌ Posting tweets, likes, retweets, follows, DMs
  • ❌ Account login / 2FA
  • ❌ Profile / banner / avatar editing
  • ❌ Media upload
  • ❌ Account deletion
  • ❌ Realtime stream / webhook setup (does not fit the MCP request/response model)

These features are available in the full twitterapi.io REST API — use it directly if you need write access.

Spec compliance

  • Built on @modelcontextprotocol/sdk v1
  • Targets MCP spec 2025-11-25 (latest)
  • Transport: stdio (Streamable HTTP planned for v0.2+ for remote/hosted use)
  • Tested with: mcp-inspector, Claude Desktop, Cursor, Claude Code

Development

bash
git clone https://github.com/kaitoInfra/twitterapi-io-mcp-server.gitcd twitterapi-io-mcp-servernpm installnpm run buildTWITTERAPI_IO_API_KEY=xxx npm run inspect  # opens mcp-inspector

Links

License

MIT © twitterapi.io

来源:README.md,提交 e2b312b

工具

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

版本历史

1
  1. v1.0.0最新Oct 6, 2026