TwitterViewer

v0.1.2
io.github.TwitterViewer/twitterviewer Checked 2 days ago Published 11 hours ago

Read public X (Twitter) posts, threads, profiles and replies as Markdown.

MCP server that lets AI agents read public X (Twitter) posts, threads, profiles and replies as Markdown. Three read-only tools, hosted by TwitterViewer at https://twitterviewer.ai/mcp. Independent service, not affiliated with X. Using the tools needs a Plus subscription, on either connection. There are two ways to connect: Nothing to install or update. The first time you connect, your client opens the browser to sign in to your TwitterViewer account (Plus). No API key needed.

Summary extracted from the README.

twitterviewer-mcp

MCP server that lets AI agents read public X (Twitter) posts, threads, profiles and replies as Markdown. Three read-only tools, hosted by TwitterViewer at https://twitterviewer.ai/mcp. Independent service, not affiliated with X.

Using the tools needs a Plus subscription, on either connection. There are two ways to connect:

Use it when Sign-in
Remote server (recommended) Your client supports remote (Streamable HTTP) MCP servers Browser sign-in (OAuth), or an API key
Local stdio (npx -y twitterviewer-mcp) Your client only starts local servers API key

Nothing to install or update. The first time you connect, your client opens the browser to sign in to your TwitterViewer account (Plus). No API key needed.

Claude Code

claude mcp add --transport http twitterviewer https://twitterviewer.ai/mcp

Then run /mcp inside Claude Code to sign in.

Claude Desktop and claude.ai

Open Settings → Connectors → Add custom connector and enter https://twitterviewer.ai/mcp.

Cursor

~/.cursor/mcp.json:

{
  "mcpServers": {
    "twitterviewer": { "url": "https://twitterviewer.ai/mcp" }
  }
}

Codex

codex mcp add twitterviewer --url https://twitterviewer.ai/mcp
codex mcp login twitterviewer

Or add it to ~/.codex/config.toml and run the login command:

[mcp_servers.twitterviewer]
url = "https://twitterviewer.ai/mcp"

VS Code (GitHub Copilot)

~/.copilot/mcp-config.json, or .mcp.json in the workspace root:

{
  "mcpServers": {
    "twitterviewer": {
      "type": "http",
      "url": "https://twitterviewer.ai/mcp",
      "tools": ["*"]
    }
  }
}

Windsurf (Devin Desktop)

~/.config/devin/mcp_config.json:

{
  "mcpServers": {
    "twitterviewer": {
      "url": "https://twitterviewer.ai/mcp",
      "transport": "http"
    }
  }
}

With an API key instead

For servers, CI and clients that cannot open a browser, create a key at https://twitterviewer.ai/account/api and send it as Authorization: Bearer <key>.

claude mcp add --transport http twitterviewer https://twitterviewer.ai/mcp \
  --header "Authorization: Bearer $TWITTERVIEWER_API_KEY"

Cursor:

{
  "mcpServers": {
    "twitterviewer": {
      "url": "https://twitterviewer.ai/mcp",
      "headers": { "Authorization": "Bearer ${env:TWITTERVIEWER_API_KEY}" }
    }
  }
}

Codex:

[mcp_servers.twitterviewer]
url = "https://twitterviewer.ai/mcp"
bearer_token_env_var = "TWITTERVIEWER_API_KEY"

Local stdio server

The twitterviewer-mcp package runs on your machine and forwards every request to the remote server, so the tools are always the same as the hosted ones. It needs Node.js 20 or newer. Tool calls need an API key from https://twitterviewer.ai/account/api (Plus).

Claude Desktop, Cursor and other JSON configs

{
  "mcpServers": {
    "twitterviewer": {
      "command": "npx",
      "args": ["-y", "twitterviewer-mcp"],
      "env": { "TWITTERVIEWER_API_KEY": "tv_live_..." }
    }
  }
}

Claude Code

claude mcp add --env TWITTERVIEWER_API_KEY=tv_live_... --transport stdio twitterviewer -- npx -y twitterviewer-mcp

Codex

[mcp_servers.twitterviewer]
command = "npx"
args = ["-y", "twitterviewer-mcp"]
env = { TWITTERVIEWER_API_KEY = "tv_live_..." }

Docker

docker build -t twitterviewer-mcp .
docker run -i --rm -e TWITTERVIEWER_API_KEY twitterviewer-mcp

Environment variables

Variable Required Description
TWITTERVIEWER_API_KEY for tool calls API key. Without it the server still starts and lists the tools; a tool call explains how to create one. With a key whose account has no Plus plan, requests fail with a message saying Plus is required.
TWITTERVIEWER_BASE_URL no Site that hosts /mcp. Default https://twitterviewer.ai.

Tools

All tools are read-only: they never post, like or follow, and they never ask for your X account.

convert_x_url

Turn an X (Twitter) post, thread, or profile link into clean Markdown (or text / JSON). Costs 1 credit per post returned (quoted posts count too); author profile data is free; errors are free. A repeated call for the same link and options within 10 minutes is free. Profile links return recent posts (default 20, up to 200).

Argument Required Description
url yes X post, thread or profile URL, or an @handle
scope no thread (default): the author's whole thread; post: only this post; conversation: thread plus the first page of replies
format no markdown (default), obsidian (with YAML frontmatter), text, or json
stats no Engagement numbers: all (default), root (first post only), off
max no Profile links only: how many recent posts (default 20)

get_x_replies

Replies to one X post. Costs 1 credit per reply returned; repeating the same call within 10 minutes returns the same result for free.

Argument Required Description
url yes X post URL
max no How many replies (default 20, up to 100)

get_credits

Remaining TwitterViewer credits: plan credits for the current cycle plus any that never expire. Calling it costs no credits. No arguments.

Try it

  • "Read https://x.com/jack/status/20 as Markdown."
  • "Summarize the recent posts from @NASA."
  • "What are people replying to this post?" followed by the link.

Credits

  • 1 credit = 1 post returned. A quoted post counts as one more post.
  • Plus includes the MCP server, the API and the CLI, with 3,000 credits a month.
  • Errors and empty results are free.
  • Repeating a conversion or replies call with the same parameters on the same account within 10 minutes returns the first result and is not charged again. If your balance cut that result short and you have credits again, the repeat counts as a new call.
  • Requests are limited per account: 30 a minute.

Development

bun install
bun run typecheck
bun run test
bun run build

Tool definitions live only on the remote server; this package does not declare any. Integration tests are skipped unless both TWITTERVIEWER_BASE_URL (for example http://localhost:3400) and TWITTERVIEWER_API_KEY are set; they need a Plus account's key and use only calls that cost no credits.

License

MIT