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

x-search-mcp

v0.1.0

Published

MCP server for xAI X search via Responses API

Downloads

13

Readme

x-search-mcp

Minimal MCP server for xAI X search using the Responses API and structured outputs.

Features

  • Single MCP tool: x_search
  • Uses xAI Responses API with x_search tool calling
  • Structured output parsing + citation normalization

Requirements

  • Node.js >= 18
  • XAI_API_KEY environment variable

Install

npm install
npm run build

Run (stdio)

XAI_API_KEY=your-key-here node dist/index.js

Codex MCP config (example)

[mcp_servers.x-search]
command = "node"
args = ["/path/to/x-search-mcp/dist/index.js"]
[mcp_servers.x-search.env]
XAI_API_KEY = "your-key-here"

Smoke test (optional)

XAI_API_KEY=your-key-here npm run build
XAI_API_KEY=your-key-here npm run smoke-test

Note: this test requires network access and may fail in restricted environments.

MCP Tool

x_search

Searches X with optional filters.

Input

{
  "query": "string",
  "allowed_x_handles": ["string"],
  "excluded_x_handles": ["string"],
  "from_date": "YYYY-MM-DD",
  "to_date": "YYYY-MM-DD",
  "enable_image_understanding": true,
  "enable_video_understanding": true,
  "include_raw_response": false
}

Output

{
  "answer": "string",
  "citations": ["https://x.com/..."],
  "inline_citations": [
    {
      "url": "https://x.com/...",
      "start_index": 10,
      "end_index": 42,
      "title": "1"
    }
  ],
  "raw_response": {}
}

Environment Variables

  • XAI_API_KEY (required)
  • XAI_MODEL (default: grok-4-1-fast)
  • XAI_BASE_URL (default: https://api.x.ai/v1)
  • XAI_TIMEOUT (default: 30000)

Notes

  • allowed_x_handles and excluded_x_handles are mutually exclusive.
  • Date filters must be YYYY-MM-DD and from_date must be <= to_date.
  • Tool responses are returned as MCP structuredContent (with a text fallback for display).
  • Citations are normalized from xAI response annotations when available.