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

@side-quest/x-api

v0.2.0

Published

Read-only Twitter/X API v2 — tweets, threads, timelines, user profiles

Downloads

324

Readme

@side-quest/x-api

Read-only Twitter/X API v2 — tweets, threads, timelines, user profiles. Published as both an npm library and an MCP server for Claude Code.

Quick Start (Claude Code)

claude mcp add -e X_BEARER_TOKEN=your-token-here x-api -- bunx --bun @side-quest/x-api

That's it. The MCP tools are now available in Claude Code.

Get a Bearer Token

  1. Go to the Twitter Developer Portal
  2. Create a project and app
  3. Generate a Bearer Token (read-only access is sufficient)

MCP Tools

| Tool | Description | |------|-------------| | x_get_tweet | Get a single tweet by ID with author info and engagement metrics | | x_get_thread | Get a full conversation thread from a tweet ID | | x_get_timeline | Get a user's recent tweets by username | | x_get_user | Get a user profile — bio, follower counts, tweet count | | x_get_replies | Get replies to a specific tweet | | x_search | Search recent tweets (7-day window) |

Claude Desktop

One-Click Install (Desktop Extension)

Download the latest x-api.mcpb from GitHub Releases and double-click to install. Claude Desktop will prompt you for your Bearer Token.

Manual Setup

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "x-api": {
      "command": "bunx",
      "args": ["--bun", "@side-quest/x-api"],
      "env": {
        "X_BEARER_TOKEN": "your-token-here"
      }
    }
  }
}

Environment Variable

Instead of hardcoding the token, set it in your shell:

export X_BEARER_TOKEN="your-token-here"

Then use ${X_BEARER_TOKEN} in the config:

claude mcp add -e X_BEARER_TOKEN='${X_BEARER_TOKEN}' x-api -- bunx --bun @side-quest/x-api

Library Usage

import { createXApiClient } from '@side-quest/x-api';

const client = createXApiClient({ bearerToken: process.env.X_BEARER_TOKEN });

const user = await client.getUser('elonmusk');
const tweets = await client.getTimeline('elonmusk', { maxResults: 10 });
const tweet = await client.getTweet('1234567890');

License

MIT