npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@el4cteo/x-mcp

v2.0.0

Published

MCP server for X (Twitter): 10 grouped tools, 69 actions for posts, timelines, users, Lists, Spaces, trends, DMs and media, with image viewing and video frames. Native Rust binary.

Readme

Give AI agents X: read and search posts, publish threads, upload media, manage Lists, send DMs, and actually see images and video frames.

Written in Rust. Compared with the previous Node.js version, on the same machine (median of 15 cold starts to a tools/list reply):

| | Node.js 1.x | Rust 2.x | | --- | ---: | ---: | | Start-up to tools/list | 451 ms | 9 ms | | Peak memory | 81.7 MB | 7.0 MB | | Install size | 112 MB node_modules | 4 MB binary |

Behaviour is checked against the original: 123 recorded cases replay byte-for-byte, including every request sent to X.

Install

{
  "mcpServers": {
    "x": {
      "command": "npx",
      "args": ["-y", "@el4cteo/x-mcp"],
      "env": { "X_BEARER_TOKEN": "..." }
    }
  }
}

Works in Claude Desktop, Claude Code, Cursor, Codex and any MCP client. Other ways to get the binary:

npm i -g @el4cteo/x-mcp        # prebuilt binary, no Node runtime needed at run time
cargo install x-twitter-mcp    # build from source; installs `x-mcp`

Or download an archive from Releases (Windows, macOS, Linux; x64 and arm64) and point command at x-mcp.

Sign in

  • Public reads: set X_BEARER_TOKEN.
  • Posting, DMs, bookmarks: run x-mcp auth --client-id YOUR_OAUTH2_CLIENT_ID and approve in the browser.

Set the X app callback to http://127.0.0.1:8787/callback. Tokens go to ~/.config/x-mcp/credentials.json (mode 0600) and refresh automatically; rotated refresh tokens are saved. OAuth 1.0a keys (X_API_KEY, X_API_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET) work too.

Tools

Each tool takes an action plus that action's parameters:

{ "action": "search", "query": "mcp -is:retweet", "max_results": 20 }

| Tool | Actions | | --- | --- | | x_posts | create, create_thread, delete, get, get_many, search, count, thread, likers, reposters, quotes, hide_reply | | x_timelines | home, user, mentions, liked, bookmarks | | x_users | me, get, get_many, search, followers, following, follow, unfollow, mute, unmute, block, unblock, muted, blocked | | x_engagement | like, unlike, repost, unrepost, bookmark, unbookmark | | x_lists | create, update, delete, get, owned, memberships, pinned, add_member, remove_member, posts, members, followers, follow, unfollow | | x_spaces | search, get, get_many, posts | | x_trends | by_location, personalized | | x_dms | send, send_to_conversation, events, conversation, with_user, delete | | x_media | upload, status, view | | x_meta | auth_status, rate_limits, usage |

Also: resources (x://me, x://users/{username}, x://posts/{id}, x://lists/{id}, x://rate-limits, x://usage) and prompts (draft_thread, reply_triage, account_report, summarize_conversation). x-mcp tools lists every action.

See images and video

x_media action view returns a post's media as MCP image content. Photos come back directly (media_index 0–3 for carousels). Videos and GIFs are sampled into 1–6 JPEG frames when ffmpeg is installed (winget install Gyan.FFmpeg, brew install ffmpeg, apt install ffmpeg, or set X_MCP_FFMPEG); without it you get the preview frame and the video URL.

Commands

x-mcp                        # stdio (default)
x-mcp serve --http [port]    # Streamable HTTP at http://127.0.0.1:3333/mcp
x-mcp doctor                 # credentials, ffmpeg and connectivity check
x-mcp tools [--json]         # list tools and actions
x-mcp auth --logout          # remove stored tokens

Settings

| Variable | Default | Purpose | | --- | --- | --- | | X_BEARER_TOKEN | — | App-only token for public reads | | X_MCP_READ_ONLY | false | Refuse every write | | X_MCP_DRY_RUN | false | Return the requests a write would send, without sending | | X_MCP_TOOLSETS / X_MCP_DISABLE_TOOLSETS | all / none | Expose only some tools, e.g. posts,users | | X_MCP_MEDIA_ROOTS | cwd | Directories allowed for path uploads | | X_MCP_RATE_LIMIT_MODE | wait | wait for the window to reset, or fail fast | | X_MCP_HTTP_TOKEN | — | Bearer token for HTTP mode (required off-loopback) |

Full list in .env.example; a .env in the working directory is read too.

Safety

  • --read-only for research agents, --dry-run to preview writes.
  • Uploads only read real media files inside allowed roots; media downloads require https and reject private, loopback and link-local addresses, re-checked on every redirect.
  • HTTP mode binds to loopback by default, checks the Host header against DNS rebinding, compares tokens in constant time, and never reflects arbitrary CORS origins.
  • Posting and DMs reach real people; the server instructs agents to confirm first.

How it is built

src/
  main.rs            CLI: serve, auth, doctor, tools
  mcp/               JSON-RPC dispatcher, stdio and Streamable HTTP transports, prompts, resources
  tools/             one file per toolset; schema.rs declares each parameter once and derives
                     validation, defaults and the JSON Schema from it
  x/                 X client: auth selection, single-flight TTL/LRU cache, rate-limit windows,
                     retries, normalisation, chunked media upload, ffmpeg frame sampling
  auth/              OAuth 2.0 PKCE + refresh (one refresh across concurrent calls), OAuth 1.0a
                     signing, 0600 credential store
tests/mcp.rs         end-to-end: stdio, HTTP sessions, OAuth refresh after 401, upload and view
tests/parity/        123 cases recorded from the Node.js original, replayed with rust-anything
cargo test                                                        # no X credentials needed
rust-anything app replay tests/parity --build target/release/x-mcp

MIT. See LICENSE.